mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Stabilize Cypress login and time unit delete flow
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user