Also renames the update script to use standard formatting: ``` yarn run test:e2e:update ``` ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-1003-e2e-Add-update-test-expectations-procedure-1a76d73d36508158a597dce69a802b12) by [Unito](https://www.unito.io)
1.3 KiB
Testing
Unit Tests
Unit tests are run with vitest. Tests are run in parallel.
Running
yarn run test:unit
End-to-End Tests
End-to-end tests are run with Playwright. Tests are run sequentially.
Tests are intended to be run on virtualised, disposable systems, such as CI runners.
Caution
End-to-end tests erase settings and other app data. They will delete ComfyUI directories without warning.
Enabling E2E tests
To run tests properly outside of CI, set env var COMFYUI_ENABLE_VOLATILE_TESTS=1 or use .env.test.
Tip
Copy
.env.test_exampleto.env.testand modify as needed.
Running
yarn run test:e2e
Note
As a precaution, if the app data directory already exists, it will have a random suffix appended to its name.
App data directories:
%APPDATA%\ComfyUI(Windows)Application Support/ComfyUI(Mac)
Updating screenshots (snapshots)
When test screenshots are out of date, they must be updated with the following process:
- Run tests
- Manually verify that the only things changed are what's expected
- Run this locally:
npm run test:e2e:update - Commit new expectations
Tip
All screenshot expectations are overwritten by playwright. To update a single test, discard any unrelated changes before committing.