👷‍️ e2e: Add connection test

This commit is contained in:
Gina Häußge committed 2020-07-02 17:38:31 +02:00
1 parent fd1ddab50f
commit 75c1b02760
3 files changed
+51 -5

No files matched your search

+2
View File
@@ -1,6 +1,8 @@
accessControl:
salt: zXmvzI3uWuTLkSPOEfA2ZLwn3f3sGUNS
plugins:
virtual_printer:
enabled: true
tracking:
enabled: false
server:
+46
View File
@@ -0,0 +1,46 @@
describe('Connection test against virtual printer', () => {
const username = 'admin';
const password = 'test';
beforeEach(() => {
cy.request({
method: 'POST',
url: '/api/login',
body: {
"user": username,
"pass": password
}
});
cy.visit('/');
cy.get('#navbar', {timeout: 10000})
.should('be.visible');
});
it('connects', () => {
cy.get('#state .accordion-inner strong:first')
.should('contain', 'Offline');
cy.get('#connection_ports')
.select('VIRTUAL');
cy.get('#printer_connect')
.click();
cy.get('#state .accordion-inner strong:first')
.should('contain', 'Operational');
});
it('disconnects', () => {
cy.get('#state .accordion-inner strong:first')
.should('contain', 'Operational');
cy.get('#connection_wrapper a.accordion-toggle')
.click();
cy.get('#printer_connect')
.click();
cy.get('#state .accordion-inner strong:first')
.should('contain', 'Offline');
});
});
+3 -5
View File
@@ -13,9 +13,7 @@ describe('Login tests', () => {
cy.get('#login-button')
.click();
cy.wait(5000); // wait 5s for the page load before continuing
cy.get('#navbar')
cy.get('#navbar', {timeout: 10000})
.should('be.visible');
cy.get('#navbar_login a.dropdown-toggle span')
.should('contain', username);
@@ -39,7 +37,7 @@ describe('Login tests', () => {
cy.get('#login-button')
.click();
cy.get('#navbar')
cy.get('#navbar', {timeout: 10000})
.should('be.visible');
cy.get('#navbar_login a.dropdown-toggle span')
.should('contain', username);
@@ -64,7 +62,7 @@ describe('Login tests', () => {
cy.get('#login-button')
.click();
cy.get('#navbar')
cy.get('#navbar', {timeout: 10000})
.should('be.visible');
cy.get('#navbar_login a.dropdown-toggle')