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
+2 -2
View File
@@ -9,7 +9,7 @@ from pathlib import Path
import psutil
import pytest
import requests
from conftest import cleanup_eos_eosdash
from conftest import cleanup_eos_eosdash, is_owned_pid
from loguru import logger
from pydantic import ValidationError
@@ -226,7 +226,7 @@ class TestServerStartStop:
health = resp.json()
assert health.get("status") == "alive"
assert health.get("version") == __version__
assert health.get("pid") == process.pid
assert is_owned_pid(owned_processes[0], health.get("pid"))
# Terminate the process started by this test, then reap it via asyncio.
process.terminate()