First stab at adding support for running tests in a headless browser #92
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.
Uses Playwright under the hood. To keep hTest small, none of the browser binaries are installed by default.
One can run
npx playwright installto install all the browsers, ornpm install @playwright/browser-chromium,npm install @playwright/browser-firefox,npm install @playwright/browser-webkitto install Chromium, Firefox, or Webkit browser, respectively. We should probably add a note on this in our docs.On the first run, if no browser binary is downloaded, Playwright will show a friendly message:
Down there is a small demo that shows all the tests we have successfully run in a headless browser. Console formatting tests are ignored since they (not dynamically) import the Chalk package, but the browser didn't choke on them. We should probably add a separate message about what tests were ignored and why.
In the video, you can see a (intentionally) falling test from these tests (not in the PR):
hTest.Run.in.Headless.Browser.mp4