-
Notifications
You must be signed in to change notification settings - Fork 46
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency filemodernisationtests
Description
Our functional test suite currently uses Selenium with gunicorn, Chrome, Firefox, geckodriver and chromedriver. This is somewhat troublesome to maintain:
- Dependencies are pinned to outdated versions (Selenium and urrlib) due to breaking changes that are left unresolved. This also affects integration tests.
- Test infrastructure is somewhat fragile. Gunicorn polls the subprocess until it responds, and tests use a lot of
sleep()commands to wait for the frontend to update its state. - The Docker image installs a lot of dependencies in order to run the headless browser for testing, and requires drivers to interact with the browsers.
Playwright offers a better alternative:
- Auto-waiting allows Playwright to wait for elements to be actionable, and is handled by the library instead of manual sleep calls.
- The test server can be simplified by using the built-in
LiveServerThreadin Django - The docker image is lighter because we can use the browser binary from Playwright, without extra browser repositories or drivers.
- Fewer dependencies are needed to run functional tests, and we can remove selenium, gunicorn and whitenoise.
The test suite is small (7 tests across 6 files), so this change is low risk and should make the tests more reliable.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency filemodernisationtests