From: Lucas Di Pentima Date: Mon, 16 Mar 2020 19:09:00 +0000 (-0300) Subject: 16029: Completes the basic set of login tests. X-Git-Tag: 2.1.0~32^2~10 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/c3601385a43e60ab6557b681f0290082bd56670f 16029: Completes the basic set of login tests. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/cypress/integration/login.spec.js b/cypress/integration/login.spec.js index 16ef915b..246055ae 100644 --- a/cypress/integration/login.spec.js +++ b/cypress/integration/login.spec.js @@ -14,7 +14,7 @@ describe('Login tests', function() { cy.clearLocalStorage() }) - it('logs in successfully', function() { + it('logs in successfully with correct token', function() { const active_user = this.users['active'] const active_token = this.client_auth['active']['api_token'] cy.visit('/token/?api_token='+active_token) @@ -29,4 +29,16 @@ describe('Login tests', function() { cy.contains('Please log in') cy.url().should('not.contain', '/projects/') }) + + it('fails to log in with no token', function() { + cy.visit('/token/?api_token=') + cy.contains('Please log in') + cy.url().should('not.contain', '/projects/') + }) + + it('shows login page on first visit', function() { + cy.visit('/') + cy.contains('Please log in') + cy.url().should('not.contain', '/projects/') + }) }) \ No newline at end of file