Skip to content

Conversation

@zoldar
Copy link
Contributor

@zoldar zoldar commented Jan 29, 2026

Changes

This PR implements basis for running end-to-end dashboard tests using playwright.

  • A distinct e2e_test MIX environment is introduced for running the tests
  • The end-to-end tests live under ./e2e directory, with playwright and all dependencies installed directly there
  • A test specific seeds file is put under ./priv/repo/e2e_seeds.exs - it might be subject to change if we decide to change out approach to setting up system state for tests - it's being discussed internally
  • End-to-end tests are run as a part of CI pipeline; screenshots for failed tests uploaded to GH artifacts

The tests can be run locally in two ways:

  • mix test.e2e - standard mode outputting test report in the terminal
  • mix test.e2e.ui - interactive mode running in a dedicated window, with ability to run tests and review the outputs selectively

When run on CI, the tests are sharded (just two shards for now).

Failed test report for a single shard:

https://github.com/plausible/analytics/actions/runs/21710287043/job/62611828894

Full test report summary available under merge-sharded-e2e-test-report job (after expanding "Merge into list report"):

https://github.com/plausible/analytics/actions/runs/21710287043/job/62612031552

Screenshots from failed tests on CI are available as downloadable artifacts from CI worflow summary page, like this one:

https://github.com/plausible/analytics/actions/runs/21710287043

image

While we could work towards fancier report output, I'd opt for keeping things simple for now and not adding en explicit report the the PR thread just yet, to reduce noise.

There are only a couple example tests for now. Follow-up work will involve expanding it into a more comprehensive set of test scenarios.

@zoldar zoldar force-pushed the e2e-exploration-playwright branch 5 times, most recently from bdf0a5a to 80ee512 Compare February 3, 2026 11:05
@zoldar zoldar force-pushed the e2e-exploration-playwright branch from 0386ab7 to a44d103 Compare February 5, 2026 09:21
@zoldar zoldar force-pushed the e2e-exploration-playwright branch from 33f6ec9 to bd620a1 Compare February 5, 2026 10:24
@zoldar zoldar changed the title [PoC] Implement basics for E2E tests driven by playwright (JS) Implement basics for E2E tests driven by playwright Feb 5, 2026
@zoldar zoldar marked this pull request as ready for review February 5, 2026 12:24
@zoldar zoldar requested a review from a team February 5, 2026 12:24
@zoldar zoldar enabled auto-merge February 5, 2026 14:36
@zoldar zoldar added this pull request to the merge queue Feb 5, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 5, 2026
* [PoC] Implement basics for E2E tests driven by playwright (JS)

* Update tracker test run instructions in README

* Update package config on e2e tests

* Set playwright reporter format to list

* Add mix task for running e2e tests in UI mode

* Add e2e test run job to CI config

* Add missing PG and CH services to e2e CI config

* Increase timeouts for e2e CI tasks

* Temporarily remove tzdata updater

* Revert "Temporarily remove tzdata updater"

This reverts commit 6105473.

* Add step downloading geo data

* Setup E2E seeds before running CI

* Run e2e tests via mix task to ensure setup env variables

* Set `BASE_URL` env var explicitly in CI config instead

* Reduce shards to 1

* Change how cwd is set for playwright server

* Show server log output in e2e tests

* Install asset dependencies during e2e setup

* Build assets as well

* Hide server output in e2e tests again

* Parallelize e2e tests again

* Reduce test sharding from 4 to 2

* Cache more fetched and compiled assets

* Remove redundant tests

* Clean up playwright config slightly

* Try reducing the time spent fetching system deps

* Output screenshots on failure

* Upload screenshots from failed tests to GH artifacts

* Make one test fail on purpose

* Revert "Make one test fail on purpose"

This reverts commit 3372a82.

* Update gitignore inside e2e to ignore outputDir

* Add notes about how to run e2e tests locally

* Add preferred envs for E2E mix tasks

* Don't dump screenshots and don't upload them as GH artifacts

* Rely on cached `tracker/node_modules` and not install tracker conditionally

* Remove no longer relevant comments from mix.exs
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2026
@zoldar zoldar enabled auto-merge February 5, 2026 14:52
@zoldar zoldar added this pull request to the merge queue Feb 5, 2026
Merged via the queue into master with commit c292057 Feb 5, 2026
26 checks passed
@zoldar zoldar deleted the e2e-exploration-playwright branch February 5, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants