Gutenberg: Allow tests to run against non-Docker environments again

Created on 31 Jul 2018  路  8Comments  路  Source: WordPress/gutenberg

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.

Automated Testing [Type] Code Quality [Type] Enhancement

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-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.

All 8 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

melchoyce picture melchoyce  路  169Comments

afercia picture afercia  路  73Comments

Pikkals picture Pikkals  路  98Comments

melchoyce picture melchoyce  路  95Comments

DeveloperWil picture DeveloperWil  路  102Comments