Proper install of playwright for TOX invocations

This commit is contained in:
Max Berger
2026-03-28 09:29:55 +01:00
parent ea43b98cad
commit 32a38e8802
2 changed files with 21 additions and 4 deletions

View File

@@ -6,6 +6,8 @@ These tests use Playwright to run the tests agains a full Radicale instance.
You need to install playwright. The easiest way to do this is to create a .venv with playwright inside. You can do this by trying to run the integ tests and then entering the .venv
### UV
Assuming you use uv to run/create your .venvs, note that the invocation will fail:
```lang=shell
@@ -19,14 +21,26 @@ then run
playwright install --with-deps
```
### Tox
Tox will install the needed browser automatically. However, it will not automatically install the needed system depedencies, since those would need root permissions. To install all playwright with all needed libraries, run:
```lang=shell
tox -c pyproject.toml -e integ_test exec -- playwright install --with-deps
```
## Running the tests
### UV
if you use uv, you can run
```lang=shell
uv run --extra dev pytest integ_tests
```
### Tox
if you use tox, you can run
```lang=shell

View File

@@ -82,6 +82,9 @@ skip_install = true
[tool.tox.env.integ_test]
deps = ["pytest", "pytest-playwright"]
# Store Playwright browsers inside .tox for better caching
setenv = { PLAYWRIGHT_BROWSERS_PATH = "{toxworkdir}/.playwright" }
commands_pre = [["playwright", "install", "chromium"]]
commands = [["pytest", "integ_tests"]]
[tool.pytest.ini_options]