Skip to content

Add E2E tests for Axe plugin #1224

Closed

Description

@hanna-skryl

User story

Add E2E test coverage for the setupScript option to verify the Axe plugin works correctly when testing login-protected pages.

The existing E2E test in e2e/plugin-axe-e2e only covers basic usage with a static HTML file:

  • mocks/fixtures/index.html - static HTML page
  • mocks/fixtures/code-pushup.config.ts - config using axePlugin(url) without options

Acceptance criteria

  • Add E2E tests for the Axe plugin running against a local example app
  • Include a test scenario that validates the setupScript option for authentication
    • Test should authenticate against a login-protected page before running accessibility scans
    • Verify that audits are correctly reported for authenticated content

Implementation details

  1. Create a mock authenticated app fixture

Add a new fixture directory e2e/plugin-axe-e2e/mocks/fixtures/auth-setup/ including:

  • simple Express server with:
    • login page with username/password form
    • protected page that redirects to login if not authenticated
    • session handling via cookies
  • Playwright setup script
  • code-pushup config file using setupScript option
  1. Add a new E2E test case that verifies report.json contains audits for the authenticated page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions