Add e2e playwright tests#51929
Open
bramkragten wants to merge 23 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces Playwright-based end-to-end (e2e) testing to the Home Assistant frontend, adding coverage for the demo and gallery builds plus a dedicated “e2e test app” with controllable scenarios, and wiring it into CI.
Changes:
- Add Playwright test suites + configs for demo, gallery, and a new e2e test app (with local + BrowserStack execution modes).
- Add build pipeline support for the e2e test app (rspack + gulp tasks, static gathering, HTML entry generation).
- Add a GitHub Actions workflow to build artifacts once and run e2e tests locally (Chromium) and on BrowserStack, then merge reports.
Reviewed changes
Copilot reviewed 32 out of 35 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds Playwright dependencies to the lockfile. |
| tsconfig.json | Excludes test/e2e from the main TypeScript project. |
| test/e2e/tsconfig.json | Adds a Node-typed TS config for e2e tests. |
| test/e2e/playwright.merge.config.ts | Defines merged-report reporters (HTML/JSON). |
| test/e2e/playwright.gallery.config.ts | Playwright config for gallery tests (local/BrowserStack + webServer). |
| test/e2e/playwright.demo.config.ts | Playwright config for demo tests (local/BrowserStack + webServer). |
| test/e2e/playwright.app.config.ts | Playwright config for the dedicated e2e test app. |
| test/e2e/gallery.spec.ts | Adds gallery page-smoke and a few interaction tests. |
| test/e2e/demo.spec.ts | Adds demo app smoke/navigation/more-info tests. |
| test/e2e/browserstack.capabilities.ts | Adds BrowserStack capability matrix used by configs. |
| test/e2e/app/src/scenarios/index.ts | Adds scenario hooks to mutate the mock hass for different test cases. |
| test/e2e/app/src/html/index.html.template | Adds the e2e test app HTML template. |
| test/e2e/app/src/ha-test.ts | Implements the ha-test app element backed by provideHass + stubs. |
| test/e2e/app/src/ha-test-panels.ts | Defines the panel map used by the e2e test app. |
| test/e2e/app/src/entrypoint.ts | Entry point importing ha-test. |
| test/e2e/app.spec.ts | Adds tests targeting the e2e test app scenarios/panels. |
| src/fake_data/provide_hass.ts | Adds a formatEntityName implementation to the mock hass object. |
| package.json | Adds Playwright and yarn scripts for running/merging e2e suites. |
| demo/src/stubs/update.ts | Adds WS stubs for update panel calls. |
| demo/src/stubs/cloud.ts | Adds REST stub for cloud status to keep config UI from erroring. |
| demo/src/stubs/assist.ts | Adds WS stubs for Assist pipeline list/run for developer tools. |
| build-scripts/rspack.cjs | Exposes a rspack config factory for the e2e test app. |
| build-scripts/paths.cjs | Adds e2e test app build/output paths. |
| build-scripts/gulp/rspack.js | Adds rspack dev server + prod build tasks for e2e test app. |
| build-scripts/gulp/index.mjs | Registers the e2e test app gulp tasks. |
| build-scripts/gulp/gather-static.js | Adds static asset gathering for e2e test app output. |
| build-scripts/gulp/entry-html.js | Adds HTML generation tasks for the e2e test app. |
| build-scripts/gulp/e2e-test-app.js | New gulp orchestration tasks for develop/build of the e2e test app. |
| build-scripts/gulp/clean.js | Adds a clean task for the e2e test app outputs. |
| build-scripts/get-built-in-node-module-shim.cjs | Removes a global comment header (no functional change). |
| build-scripts/eslint.config.mjs | Configures Node globals for build-scripts linting. |
| build-scripts/bundle.cjs | Adds bundle config for the e2e test app (entry/defines/output). |
| .serena/project.yml | Adds Serena project configuration. |
| .serena/.gitignore | Ignores Serena cache/local config files. |
| .gitignore | Ignores Playwright reports/test-results and e2e app build output. |
| .github/workflows/e2e.yaml | Adds CI workflow to build artifacts, run e2e, and merge reports. |
7b1f0b0 to
908a518
Compare
Contributor
|
Nice work! 👍 |
…lectors for iPhone
…r can't pierce shadow DOM
MindFreeze
reviewed
May 20, 2026
| # ── Run Playwright tests on BrowserStack (real devices + browsers) ───────── | ||
| # The BrowserStack SDK manages the Local tunnel and uploads results to the | ||
| # BrowserStack Automate dashboard automatically — no tunnel action needed. | ||
| e2e-browserstack: |
Member
There was a problem hiding this comment.
Weren't we going to run this only on demand?
| * E2E tests for the HA test app (port 8095). | ||
| * | ||
| * Run with: | ||
| * yarn test:e2e:app:local |
Member
There was a problem hiding this comment.
Suggested change
| * yarn test:e2e:app:local | |
| * yarn test:e2e:app |
| * the demo content renders without JS errors and the page element is visible. | ||
| * | ||
| * Run with: | ||
| * yarn test:e2e:gallery:local |
Member
There was a problem hiding this comment.
Suggested change
| * yarn test:e2e:gallery:local | |
| * yarn test:e2e:gallery |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Adds playwright tests covering demo/gallery and new test app with multiple scenarios.
Screenshots
Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
To help with the load of incoming pull requests: