test(eosdash): run EOSdash in a headless Chromium browser

Run EOSdash in a headless Chromium browser for testing. Every menu tab must
load with HTTP 200 and render content, in light and dark mode, without
JavaScript errors.

Additional changes
Enable the browser tests by --browser-test (marker browser), skip them otherwise
Add the CI job browser-test that installs Chromium and runs them
Add the make target test-browser, run with --extra dev so playwright is installed
Add playwright to the dev dependencies
Document how to run the browser tests with --extra dev, incl. the browser system
libraries on Linux
Accept a child PID of the started server in the server startup checks, on Windows
only: there the venv python.exe runs the real interpreter as a child process
Share one Chromium per test class, so Playwright stops before other tests run
Request chromium before servers so a missing browser fails before EOS starts
Make the missing-browser hint platform neutral (Linux: add --with-deps)
Set PYTHONIOENCODING=utf-8 for the test server to avoid encoding errors on Windows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bobby Noelte
2026-11-09 12:39:30 +01:00
co-authored by Claude Opus 5.5
parent 2245976de4
commit 4475774c06
8 changed files with 479 additions and 11 deletions
+33
View File
@@ -405,6 +405,39 @@ resources:
make test-system
```
If you change EOSdash, also run the browser tests. They start EOS and EOSdash and check the
pages in a headless Chromium browser, e.g. that every page renders in light and dark mode without
JavaScript errors. The browser has to be installed once:
```{eval-rst}
.. tabs::
.. tab:: Windows
.. code-block:: powershell
uv run --extra dev playwright install chromium
uv run --extra dev pytest --browser-test -m browser -vs
.. tab:: Linux
.. code-block:: bash
uv run --extra dev playwright install --with-deps chromium
uv run --extra dev pytest --browser-test -m browser -vs
.. tab:: Linux Make
.. code-block:: bash
sudo $(which uv) run --extra dev playwright install-deps chromium
make test-browser
```
On Linux the browser needs system libraries. Install them once with `--with-deps` or
`install-deps` (requires root). On Windows no system libraries are needed. Without
`--browser-test` the browser tests are skipped.
To do profiling use:
```{eval-rst}