Files
vikunja/frontend/cypress/e2e/user/logout.spec.ts
Claude Loop c3353e8641 feat: optimize E2E test performance and reliability
- Increase GitHub Actions E2E timeout from 20 to 25 minutes
- Reduce CYPRESS_DEFAULT_COMMAND_TIMEOUT from 60s to 30s for faster failures
- Replace hard-coded waits with proper API intercepts for better reliability:
  - Add @createTask intercept for task creation (task.spec.ts)
  - Add @createBucket intercept for bucket creation (kanban.spec.ts)
  - Reduce unnecessary 1000ms wait to 500ms in logout test
- Improve test performance while maintaining stability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 22:30:01 +00:00

47 lines
1.1 KiB
TypeScript

import {createFakeUserAndLogin} from '../../support/authenticateUser'
import {createProjects} from '../project/prepareProjects'
function logout() {
cy.get('.navbar .username-dropdown-trigger')
.click()
cy.get('.navbar .dropdown-item')
.contains('Logout')
.click()
}
describe('Log out', () => {
createFakeUserAndLogin()
it('Logs the user out', () => {
cy.visit('/')
expect(localStorage.getItem('token')).to.not.eq(null)
logout()
cy.url()
.should('contain', '/login')
.then(() => {
expect(localStorage.getItem('token')).to.eq(null)
})
})
it.skip('Should clear the project history after logging the user out', () => {
const projects = createProjects()
cy.visit(`/projects/${projects[0].id}`)
.then(() => {
expect(localStorage.getItem('projectHistory')).to.not.eq(null)
})
logout()
cy.wait(500) // This makes re-loading of the project and associated entities (and the resulting error) visible
cy.url()
.should('contain', '/login')
.then(() => {
expect(localStorage.getItem('projectHistory')).to.eq(null)
})
})
})