From 1b353f13f240c1d797406fe6bbdc31e7173974b9 Mon Sep 17 00:00:00 2001 From: Scott Bishel Date: Wed, 30 Mar 2022 15:04:18 -0600 Subject: [PATCH] cypress tests must logout before attempting to login again --- webapp/cypress/integration/loginActions.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/webapp/cypress/integration/loginActions.ts b/webapp/cypress/integration/loginActions.ts index 8a25c29d6..34c05578c 100644 --- a/webapp/cypress/integration/loginActions.ts +++ b/webapp/cypress/integration/loginActions.ts @@ -58,12 +58,10 @@ describe('Login actions', () => { cy.get('button').contains('Change password').click() cy.get('.succeeded').click() workspaceIsAvailable() - logoutUser() - + // Can log in user with new password cy.log('**Can log in user with new password**') loginUser(newPassword).then(() => resetPassword(newPassword)) - logoutUser() // Can't register second user without invite link cy.log('**Can\'t register second user without invite link**') @@ -87,7 +85,9 @@ describe('Login actions', () => { cy.get('a.shareUrl').invoke('attr', 'href').then((inviteLink) => { // Log out existing user - logoutUser() + cy.log('**Log out existing user**') + cy.get('.Sidebar .SidebarUserMenu').click() + cy.get('.menu-name').contains('Log out').click() // Register a new user cy.log('**Register new user**') @@ -114,13 +114,6 @@ describe('Login actions', () => { return workspaceIsAvailable() } - const logoutUser = () => { - cy.log('**Log out existing user**') - cy.get('.SidebarUserMenu').click() - cy.get('.menu-name').contains('Log out').click() - cy.location('pathname').should('eq', '/login') - } - const resetPassword = (oldPassword: string) => { cy.apiGetMe().then((userId) => cy.apiChangePassword(userId, oldPassword, password)) }