Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to intercept requests to give pa11y static data #240

Open
kussmaul opened this issue Nov 13, 2024 · 0 comments
Open

how to intercept requests to give pa11y static data #240

kussmaul opened this issue Nov 13, 2024 · 0 comments

Comments

@kussmaul
Copy link

What would you like to see in the library?

A way to use cypress-audit and pa11y with cy.intercept() and responses.

Why?

I use cypress-audit and pa11y in E2E tests, and they work well. Thank you!
However, pa11y does not seem to use cy.intercept() with (static) responses.

For example (adapted & simplified from my actual code)

it('pa11y', () => {
  cy.intercept ('/data/usr/get/**' , userA);
  cy.visit     (`/user/edit/${userA._id}`);
  cy.pa11y     (Cypress.env('pa11yOpts'));
});

The cypress runner shows that visit() loads the page and the data request is intercepted correctly.
However, pa11y() causes a separate data request which is not intercepted,
I assumed that pa11y would scan the current page, but I think cypress-audit passes the url to pa11y, which loads the url separately.

  • Is this summary correct?
  • Are there (straightforward) ways to intercept requests for pa11y?

Any other information that may help understanding the need

This link seems related, and suggests that puppeteer can do this with pa11y:
pa11y/pa11y#454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant