Since #8041 was merged a few people have got the error:
WordPress e2e tests run in their own Docker container, but that container wasn鈥檛 found.
When they don't want to run tests in the new Docker container. While I think we should discourage this (the point of isolating the tests was to be able to write tests that depend on a certain site state, like having X comments or X posts), giving someone at least the option to do it could be useful if they know the caveats.
We should allow people to run tests against an arbitrary environment. It should be a relatively straightforward change.
Two important workflows for me are:
Being able to run the tests on my own environment: I used to do npm run test-e2e for that, now I can do npx jest test/e2e/specs to do it.
The most important use-case I don't want to lose is the possibility to run a single file test with a simple command line: npx jest test/e2e/specs/adding-blocks.test.js
It seems a bit heavy to have to trigger a Docker container for each run when debugging/working on tests.
npx jest test/e2e/specs no longer works for me either.
I do something like that now
PUPPETEER_HEADLESS=false JEST_PUPPETEER_CONFIG=test/e2e/puppeteer.config.js npx wp-scripts test-unit-js --config test/e2e/jest.config.json --runInBand "test/e2e/specs/block-deletion.test.js"
which is obviously not the greatest experience :)
Getting ReferenceError: page is not defined.
Oh, thanks @youknowriad, just saw your comment :)
This is actually simple now npx wp-scripts test-e2e --config test/e2e/jest.config.json
Closing as fixed.
As there anything in the docs or something mentioning this? 馃槒
No but there's an issue about it :P #8319
Most helpful comment
Two important workflows for me are:
Being able to run the tests on my own environment: I used to do
npm run test-e2efor that, now I can donpx jest test/e2e/specsto do it.The most important use-case I don't want to lose is the possibility to run a single file test with a simple command line:
npx jest test/e2e/specs/adding-blocks.test.jsIt seems a bit heavy to have to trigger a Docker container for each run when debugging/working on tests.