Add puppeteer end-to-end integration test #807
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds end-to-end tests on top of #801.
Terminology
The
puppeteer
integration intoJest
is done via the jest-puppeteer plugin, as recommended in Jest: Using with puppeteer.Note: Installing
puppeteer
via npm auto-downloads an instance of Chromium intonode_modules/puppeteer/.local-chromium
, which is around 400MB large!There might a way to disable this which I haven't bothered to find yet. Also, you might be able to define the browser used, e.g.
/usr/bin/chromium
instead of the auto-download. Even Firefox seems to be supported.Running
You need to have a working Isso instance running on
localhost:8080
in order for the end-to-end integration tests usingpuppeteer
to work.Install the needed packages:
(I might add those to
package.json
at some point, but the caveat of the chromium 400MB automatic download applies)Then run:
npm run test-unit
for Jest unit testsnpm run test-integration
for puppeteer browser automationHighly WIP at the moment, but could be useful to someone else working on the same issues. Please communicate and collaborate!
Depends on #800. I have temporarily changed the base to that branch to make it easier to review this change.