test navbar logout
This commit is contained in:
parent
93a8533d76
commit
6018764731
1 changed files with 6 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ describe('admin login page', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('logs in with valid credentials and redirects to the home page', () => {
|
it('logs in and logs out from the home page navbar', () => {
|
||||||
cy.visit('/login')
|
cy.visit('/login')
|
||||||
|
|
||||||
cy.get('[data-cy="login-email"]').type('admin@rabbigerzi.test')
|
cy.get('[data-cy="login-email"]').type('admin@rabbigerzi.test')
|
||||||
|
|
@ -44,5 +44,10 @@ describe('admin login page', () => {
|
||||||
|
|
||||||
cy.url().should('eq', Cypress.config().baseUrl + '/')
|
cy.url().should('eq', Cypress.config().baseUrl + '/')
|
||||||
cy.getCookie('auth_token').should('exist')
|
cy.getCookie('auth_token').should('exist')
|
||||||
|
cy.get('[data-cy="navbar-logout"]').should('be.visible')
|
||||||
|
cy.get('[data-cy="navbar-logout"]').click()
|
||||||
|
|
||||||
|
cy.getCookie('auth_token').should('not.exist')
|
||||||
|
cy.get('[data-cy="navbar-logout"]').should('not.exist')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue