test: migrate integration tests to Playwright

Merged
HA
1mo ago
+4612-6687

Part of #7617

Summary

  • Migrate the Selenium-driven integration tests to Playwright. Each test keeps its checks, test ID and dev/prod parameters.
  • Keep the existing Selenium-backed AppHarness APIs and testing dependencies for downstream compatibility. Step 4 of #7617 (remove Selenium and its dependency) stays open.
  • Consolidate the integration workflows under the integration-tests required gate. The Playwright job runs in two pytest-split groups.
  • Move the large-state browser benchmark to tests/performance (smoke scale: 1 and 100 vars). Also fix it: its app template was invalid Python for every size above 1, and the harness reran the 1-var app for all sizes (on main too). It now asserts that the app has the requested number of state vars.

Testing

  • The changed modules pass locally in dev and prod with reruns turned off (-p no:rerunfailures): all 21 changed Playwright modules on the memory state manager (102 passed, 1 redis-only skip), and the modules with logic changes on redis.
  • Lifespan on redis: the app fixture is session-scoped, and test_lifespan closes its page and waits until the server drops the token before it stops the backend. A disconnect still in flight at shutdown logged Redis error deleting token and failed the test (the per-test fixture hit this in every local run; the in-test shutdown hit it in CI).
  • test_large_state passes at smoke scale. With a shared app_name, the new state-var check fails (assert 1 == 100).
  • tests/units/test_workflow_gates.py, ruff, pyright and pre-commit pass on the changed files.