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

Tests that rely on a Cookie header fail after first tests run #62

Closed
adgad opened this issue Jul 19, 2018 · 3 comments
Closed

Tests that rely on a Cookie header fail after first tests run #62

adgad opened this issue Jul 19, 2018 · 3 comments

Comments

@adgad
Copy link

adgad commented Jul 19, 2018

We have a test suite that sets a Cookie header with a different value for each test. With the default concurrency of 2, what happens is:

  1. First two tests run, with the correct cookie, all is well
  2. Subsequent tests run, they have a different set of cookies, not the ones that are set in the header.

What I think is happening is that some JS from the first two pages is setting cookies that's overriding what the header tries to use.

We've worked around this by bumping up the concurrency so all the tests are run at once - but wondering if there's a better way to make the tests more idempotent (e.g. clearing cookies after each test?)

/cc @remybach

@JakeChampion
Copy link

I've been speaking to @rowanmanning about this issue and we think it might be solvable by using separate browser contexts for each "url". Puppeteer has browser context functionality already built-in, it would take some development work to integrate this into Pa11y.

@rowanmanning
Copy link
Member

Yep what Jake said. If anybody is interested in trying to resolve this then I'd appreciate the help :) it would probably require changes to https://github.com/pa11y/pa11y rather than CI though

@josebolos
Copy link
Member

Hi @adgad

Pa11y-ci v3 uses an incognito context by default in order to avoid these kinds of issues. Concurrency has also been set to 1 by default so race conditions like this are avoided.

Feel free to reopen the issue if you're still experiencing this with a recent version of pa11y-ci.

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

4 participants