Stabilize Cypress login and time unit delete flow

This commit is contained in:
karilint
2026-03-24 17:24:58 +02:00
parent a057c9ecfa
commit 4fdc4b517f
2 changed files with 17 additions and 2 deletions
+8 -1
View File
@@ -34,7 +34,14 @@ Cypress.Commands.add('login', username => {
cy.get('[data-cy="password-basic"] input').should('be.visible').clear().type('test', { log: false })
cy.get('[data-cy="login-button"]').should('be.visible').click()
cy.wait('@loginRequest').its('response.statusCode').should('eq', 200)
cy.location('pathname', { timeout: 10000 }).should('not.eq', '/login')
cy.window().should(window => {
const storedUserState = window.localStorage.getItem('userState')
expect(storedUserState, 'stored user state').to.not.be.null
const parsedUserState = JSON.parse(storedUserState)
expect(parsedUserState?.token, 'stored login token').to.be.a('string').and.not.be.empty
})
cy.location('pathname', { timeout: 30000 }).should('not.eq', '/login')
})
Cypress.Commands.add('loginAsDeleteCoordinator', () => {