From f2ca247731e119105a516b1c5114eeb23b868a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 6 Jul 2020 22:30:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Fix=20cypress=20login=20test's?= =?UTF-8?q?=20wobbliness?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hopefully at least... --- tests/cypress/integration/connect.js | 2 +- tests/cypress/integration/login.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/cypress/integration/connect.js b/tests/cypress/integration/connect.js index 24d2594a0..6960597e0 100644 --- a/tests/cypress/integration/connect.js +++ b/tests/cypress/integration/connect.js @@ -42,7 +42,7 @@ describe('Connection test against virtual printer', () => { .should('contain', 'Connect') .click(); - cy.get('#connection .accordion-inner') + cy.get('#connection .accordion-inner', {timeout: 10000}) .should('not.be.visible'); cy.get('#state .accordion-inner strong:first') .should('contain', 'Operational'); diff --git a/tests/cypress/integration/login.js b/tests/cypress/integration/login.js index 3b4abf17a..bc0567224 100644 --- a/tests/cypress/integration/login.js +++ b/tests/cypress/integration/login.js @@ -2,6 +2,20 @@ describe('Login tests', () => { const username = 'admin'; const password = 'test'; + it('ensure cache hit', () => { + // login + cy.request({ + method: 'POST', + url: '/api/login', + body: { + "user": username, + "pass": password + } + }); + + cy.visit('/'); + }); + context('Successful login', () => { it('logs in', () => { cy.visit('/');