Skip to content

[BUG] fix: E2E dashboard-widgets smoke tests consistently fail in CI due to missing auth session #1972

@ask-z4ch

Description

@ask-z4ch

Summary:

The Playwright smoke tests in CI consistently fail on 4 tests across e2e/dashboard-widgets.spec.js and e2e/notifications.spec.js:

  1. dashboard widgets render with mocked metrics
  2. contribution graph range buttons request a new range
  3. goal form posts a new goal
  4. notification bell opens and closes drawer

All four fail with the same root cause — the "Dashboard" heading never appears:

await expect(page.getByRole("heading", { name: /dashboard/i })).toBeVisible({ timeout: 30000 });

The test navigates to /dashboard, but the page either redirects to the login screen or renders an empty state because no authenticated session is available in the CI runner. The 30s timeout expires and the test fails.

Why this matters: These failures affect every open PR (see #1925, #1962) and add review noise. The core CI checks (type-check, lint, build, dependency audit) are unaffected, but the red "checks failed" banner creates confusion for contributors and maintainers.

Likely investigation path:

  • Check how page.goto("/dashboard") handles unauthenticated state in CI vs local
  • Verify that the Playwright test setup (e.g., test.use({ storageState }) or mock API routes) properly seeds an auth session
  • The tests mock API responses but may depend on a pre-existing cookie/localStorage token that isn't set up in the CI environment

To reproduce locally:

npx playwright test e2e/dashboard-widgets.spec.js --reporter=line

Look for the "Dashboard" heading assertion at line 179, 195, and 214 of e2e/dashboard-widgets.spec.js.

Suggested fix: Either ensure the test runner injects a valid session token before navigation, or guard dashboard-dependent tests behind an auth-ready check and skip gracefully when unauthenticated.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggssoc:assignedGSSoC: Issue assigned to a contributor

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions