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

Allow tests to run against non-Docker environments again #8317

Closed
tofumatt opened this issue Jul 31, 2018 · 9 comments
Closed

Allow tests to run against non-Docker environments again #8317

tofumatt opened this issue Jul 31, 2018 · 9 comments
Assignees
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Code Quality Issues or PRs that relate to code quality [Type] Enhancement A suggestion for improvement.

Comments

@tofumatt
Copy link
Member

Since #8041 was merged a few people have got the error:

WordPress e2e tests run in their own Docker container, but that container wasn’t 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.

@tofumatt tofumatt added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Code Quality Issues or PRs that relate to code quality labels Jul 31, 2018
@tofumatt tofumatt self-assigned this Jul 31, 2018
@youknowriad
Copy link
Contributor

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.

@designsimply designsimply added the [Type] Enhancement A suggestion for improvement. label Jul 31, 2018
@ellatrix
Copy link
Member

ellatrix commented Sep 4, 2018

npx jest test/e2e/specs no longer works for me either.

@youknowriad
Copy link
Contributor

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 :)

@ellatrix
Copy link
Member

ellatrix commented Sep 4, 2018

Getting ReferenceError: page is not defined.

@ellatrix
Copy link
Member

ellatrix commented Sep 4, 2018

Oh, thanks @youknowriad, just saw your comment :)

@youknowriad
Copy link
Contributor

This is actually simple now npx wp-scripts test-e2e --config test/e2e/jest.config.json

Closing as fixed.

@tofumatt
Copy link
Member Author

As there anything in the docs or something mentioning this? 😏

@youknowriad
Copy link
Contributor

No but there's an issue about it :P #8319

@jbasdf
Copy link

jbasdf commented Oct 23, 2021

I keep getting the error "ReferenceError: page is not defined". Was this ever resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Code Quality Issues or PRs that relate to code quality [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

5 participants