👷️ Combine connect & disconnect
This commit is contained in:
1 parent
75c1b02760
commit
7c4e0b2344
1 file changed
+16
-6
@@ -3,6 +3,7 @@ describe('Connection test against virtual printer', () => {
|
||||
const password = 'test';
|
||||
|
||||
beforeEach(() => {
|
||||
// login
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: '/api/login',
|
||||
@@ -12,32 +13,41 @@ describe('Connection test against virtual printer', () => {
|
||||
}
|
||||
});
|
||||
|
||||
// ensure we are disconnected
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: '/api/connection',
|
||||
body: {
|
||||
"command": "disconnect"
|
||||
}
|
||||
});
|
||||
|
||||
cy.visit('/');
|
||||
|
||||
cy.get('#navbar', {timeout: 10000})
|
||||
.should('be.visible');
|
||||
});
|
||||
|
||||
it('connects', () => {
|
||||
it('connect & disconnect', () => {
|
||||
cy.get('#state .accordion-inner strong:first')
|
||||
.should('contain', 'Offline');
|
||||
|
||||
cy.get('#connection_ports')
|
||||
.select('VIRTUAL');
|
||||
cy.get('#printer_connect')
|
||||
.should('contain', 'Connect')
|
||||
.click();
|
||||
|
||||
cy.get('#state .accordion-inner strong:first')
|
||||
.should('contain', 'Operational');
|
||||
});
|
||||
|
||||
it('disconnects', () => {
|
||||
cy.get('#connection .accordion-inner')
|
||||
.should('not.be.visible');
|
||||
cy.get('#state .accordion-inner strong:first')
|
||||
.should('contain', 'Operational');
|
||||
|
||||
cy.get('#connection_wrapper a.accordion-toggle')
|
||||
.click();
|
||||
cy.get('#printer_connect')
|
||||
.should('be.visible')
|
||||
.should('contain', 'Disconnect')
|
||||
.click();
|
||||
|
||||
cy.get('#state .accordion-inner strong:first')
|
||||
|
||||
Reference in new issue
Block a user