From c3601385a43e60ab6557b681f0290082bd56670f Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Mon, 16 Mar 2020 16:09:00 -0300 Subject: [PATCH] 16029: Completes the basic set of login tests. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- cypress/integration/login.spec.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 -- 2.30.2