Files
Charon/docs/issues/e2e-session-expiration-tests.md
GitHub Actions afcaaf1a35 chore(e2e): complete Phase 1 foundation tests and Phase 2 planning
Phase 1 Complete (112/119 tests passing - 94%):

Added authentication.spec.ts (16 tests)
Added dashboard.spec.ts (24 tests)
Added navigation.spec.ts (25 tests)
Created 6 test fixtures (auth, test-data, proxy-hosts, access-lists, certificates, TestDataManager)
Created 4 test utilities (api-helpers, wait-helpers, health-check)
Updated current_spec.md with completion status
Created issue tracking for session expiration tests
Phase 2 Planning:

Detailed 2-week implementation plan for Proxy Hosts, Certificates, Access Lists
95-105 additional tests planned
UI selectors, API endpoints, and acceptance criteria documented
Closes foundation for E2E testing framework
2026-01-20 06:11:59 +00:00

1016 B

[E2E] Fix Session Expiration Test Failures

Summary

3 tests in tests/core/authentication.spec.ts are failing due to difficulty simulating session expiration scenarios.

Failing Tests

  1. should clear authentication cookies on logout (line 219)
  2. should redirect to login when session expires (line 310)
  3. should handle 401 response gracefully (line 335)

Root Cause

These tests require either:

  1. Backend API endpoint to invalidate sessions programmatically
  2. Playwright route interception to mock 401 responses

Proposed Solution

Add a route interception utility in tests/utils/route-mocks.ts:

export async function mockAuthenticationFailure(page: Page) {
  await page.route('**/api/v1/**', route => {
    route.fulfill({ status: 401, body: JSON.stringify({ error: 'Unauthorized' }) });
  });
}

Priority

Medium - Edge case handling, does not block core functionality testing

Labels

  • e2e-testing
  • phase-2
  • enhancement

Phase

Phase 2 - Critical Path