This directory contains JS tests that make use of Puppeteer. Puppeteer is a Node.js library that provides an API to instantiate and control a headless Chromium browser. Most things that can be done manually in the browser can be done using Puppeteer.
Examples of such tests might include:
Screenshot-grabbing tests. For example, in the case of lit-html components, such a test might perform the following steps:
Integration tests. Example steps:
Tests under this directory use the Mocha test runner.
Any output files generated from these tests (e.g. screenshots) will be found in
Puppeteer tests run inside a Docker container. This provides a more stable testing environment and reduces screenshot flakiness.
Dockerfile can be found in
make puppeteer-test from
$SKIA_INFRA_ROOT/golden. This will build and run a Docker container that executes the Mocha test runner.
If you wish to run these tests outside of Docker, try
make puppeteer-test-nodocker. Or equivalently,
$SKIA_INFRA_ROOT/golden/puppeteer-tests/test and run
The two options below run the tests outside of Docker.
npx mocha debug. This will start the tests and immediately drop into the Node.js inspector.
npx mocha --inspect-brk. This will start the tests and wait until a debugger is attached. Attach any debgger of your liking, e.g. Chrome Dev Tools, VSCode, IntelliJ, etc. See here for more.