| 1 |
# Visual regression tests using Galata |
| 2 |
|
| 3 |
This directory contains visual regression tests for bqplot, using Galata. |
| 4 |
|
| 5 |
In order to run them, you need to install dependencies: |
| 6 |
|
| 7 |
```bash |
| 8 |
const install -c conda-forge yarn jupyterlab=3.0.7 |
| 9 |
|
| 10 |
yarn install |
| 11 |
``` |
| 12 |
|
| 13 |
Then start JupyterLab in one terminal (you need to check that it properly starts on port 8888): |
| 14 |
```bash |
| 15 |
yarn run start-jlab |
| 16 |
``` |
| 17 |
|
| 18 |
Finally, run the galata tests: |
| 19 |
```bash |
| 20 |
yarn run test |
| 21 |
``` |
| 22 |
|
| 23 |
If bqplot visuals change, you can re-generate reference images by running: |
| 24 |
```bash |
| 25 |
yarn run update-references |
| 26 |
``` |
| 27 |
|
| 28 |
## Notebooks directory |
| 29 |
|
| 30 |
The `tests/notebooks` directory contains the test notebooks. For most notebooks (*e.g.* `bars.ipynb`, `scatter.ipynb`) Galata will run them cell by cell and take a screenshot of each output, comparing with the reference images. |
| 31 |
|
| 32 |
When running notebooks named `*_update.ipynb`, Galata will always take the first cell output as reference which must contain the plot, later cells will only be used to update the plot, those notebooks are checking that bqplot is properly taking updates into account on already-created plots. |
| 33 |
|
| 34 |
## Add a new test |
| 35 |
|
| 36 |
You can add a new test by simply adding a new notebook to the `tests/notebooks` directory and updating the references. If you want to test updating plots, create notebook named `*_update.ipynb`, create a plot in your first cell then update the plot in later cells. |