Skip to content

Add e2e playwright tests#51929

Open
bramkragten wants to merge 23 commits into
devfrom
e2e-playwright-tests
Open

Add e2e playwright tests#51929
bramkragten wants to merge 23 commits into
devfrom
e2e-playwright-tests

Conversation

@bramkragten
Copy link
Copy Markdown
Member

Proposed change

Adds playwright tests covering demo/gallery and new test app with multiple scenarios.

Screenshots

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to backend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

To help with the load of incoming pull requests:

@github-actions github-actions Bot added GitHub Actions Pull requests that update GitHub Actions code Build Related to building the code Demo Related to frontend demo content Design Related to Home Assistant design gallery labels May 8, 2026
Comment thread test/e2e/app/src/ha-test.ts Dismissed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread test/e2e/gallery.spec.ts
Comment thread test/e2e/app.spec.ts Outdated
Comment thread test/e2e/app/src/ha-test.ts
Comment thread test/e2e/app/src/ha-test.ts
@silamon
Copy link
Copy Markdown
Contributor

silamon commented May 8, 2026

Nice work! 👍

@bramkragten bramkragten reopened this May 10, 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:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weren't we going to run this only on demand?

Comment thread test/e2e/app.spec.ts
* E2E tests for the HA test app (port 8095).
*
* Run with:
* yarn test:e2e:app:local
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* yarn test:e2e:app:local
* yarn test:e2e:app

Comment thread test/e2e/gallery.spec.ts
* the demo content renders without JS errors and the page element is visible.
*
* Run with:
* yarn test:e2e:gallery:local
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* yarn test:e2e:gallery:local
* yarn test:e2e:gallery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Related to building the code cla-signed Demo Related to frontend demo content Design Related to Home Assistant design gallery GitHub Actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants