Skip to content

Implement comprehensive E2E test suite with accurate selectors #231

@nicholaspsmith

Description

@nicholaspsmith

Summary

Several E2E test files have been temporarily skipped in CI due to selector mismatches and incomplete test implementations. This issue tracks the work needed to implement a comprehensive, reliable E2E test suite.

Current State

The following test files are skipped in CI with test.skip(!!process.env.CI, ...):

tests/e2e/goal-creation.spec.ts

  • Issue: Selectors don't match current UI
  • Details: Tests look for placeholder*="goal" but actual placeholder is "e.g., Kubernetes Administration..."
  • Fix needed: Update selectors to match GoalForm component's actual input placeholders

tests/e2e/quiz-card-flip.spec.ts

  • Issue: Quiz page loading issues in CI environment
  • Details: beforeEach times out waiting for either "Show Answer" button or "All Caught Up" text
  • Fix needed: Investigate quiz page rendering in CI, may need longer timeouts or different wait strategies

tests/e2e/page-transitions.spec.ts

  • Issue: Tests incomplete - require authentication setup
  • Details: Has TODO comment "Add actual login logic when authentication is set up"
  • Fix needed: Complete authentication flow in tests using existing auth.setup.ts pattern

tests/e2e/mastery-dashboard.spec.ts

  • Issue: Dashboard selectors don't match current UI
  • Details: Tests use data-testid attributes that don't exist in current components
  • Fix needed: Either add data-testid attributes to components or update selectors

Acceptance Criteria

  • All test files run successfully in CI without skipping
  • Tests use accurate selectors matching actual UI elements
  • Tests are resilient to CI environment timing differences
  • Add data-testid attributes to key UI elements for reliable testing
  • Document test patterns in a TESTING.md guide

Related

  • Tests are for valid features that exist in the codebase
  • File agent guardian hook was temporarily updated to allow test maintenance
  • Original CI failures traced to selector mismatches, not missing features

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions