|
3 年之前 | |
---|---|---|
.. | ||
docker | 3 年之前 | |
reference-output | 3 年之前 | |
tests | 3 年之前 | |
.dockerignore | 3 年之前 | |
Dockerfile | 3 年之前 | |
README.md | 3 年之前 | |
galata-config.json | 3 年之前 | |
jupyter_server_config.py | 3 年之前 | |
package.json | 3 年之前 | |
repeated_test_run.sh | 3 年之前 | |
yarn.lock | 3 年之前 |
JupyterLab UI tests use Galata which is based on playwright and jest frameworks. Galata provides a high level API to control and inspect JupyterLab UI programmatically, testing tools and CLI to manage tests and other tasks.
.test.ts
in ui-tests/tests
directory.describe
and test
methods from Galata instead of jest, since Galata overrides them to be able to provide additional functionality.import { galata, describe, test } from '@jupyterlab/galata';
# run UI tests once to create test captures to use as reference images for your new feature
docker-compose -f "./ui-tests/docker/docker-compose.yml" run --rm e2e yarn run test:create-references --jlab-base-url=http://jupyterlab:8888
# copy test captures into reference-output directory to use as references
# cp test-output/test/screenshots/*.* reference-output/screenshots
# run UI tests locally, repeatedly. make sure no test fails. wait for 10-20 successful repeats
docker-compose -f "./ui-tests/docker/docker-compose.yml" run --rm e2e
Once you are done testing locally, push the new references on your PR and check CI is passing.
If your tests are failing or if you want to debug UI tests, you can use the script yarn run test:debug --include=...
by specifying the particular test suite(s) you want to debug. Check Galata CLI Options for list of available command-line options.