Repository navigation
test: add a Playwright E2E suite - #116
Merged
Merged
Conversation
The fake assignments could pick a terminated campaign, which the assignment observer refuses, making the fake data seeding fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Serve isolated app and setup instances, seed fixed users per role and share helpers for Filament pages, emails and 2FA codes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run the setup wizard on the empty instance, and the settings that change the whole app alone, restoring their defaults after each test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The app does not support PostgreSQL yet (JSON operators on text columns): it will come in its own change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read the busy timeout and journal mode of SQLite from the env, use WAL and database sessions in the E2E instances, and seed English users. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also add helpers for the Filament 5 menus, searchable selects, filters, imports and exports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LukeSavefrogs
marked this pull request as draft
November 27, 2026 09:58
Leave out the connection and request lines of the PHP server, as `php artisan serve` does, keeping its errors in the test output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On CI, record the retry of a failed test (trace and video), keep the errors of the test servers with the report, and explain in the job summary how to open them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Note when the app server stops answering during the run, and print its errors, the killed processes and the memory at the end of the failed jobs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On CI (PHP 8.2, JIT on by setup-php) the workers of the PHP server segfaulted one after the other until it refused every connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wait for the saved notification before reloading, and search for the campaign, which other tests can push to another page of the list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rename "Run tests" to "Pest tests" and "Run E2E tests" to "E2E tests", with their files and jobs, so that the two suites are told apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Other emails (e.g. a new campaign, sent to every user) may reach an address while a test waits for its invitation or reset link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Zone to territory to assignment and return, a campaign from start to end, and a user invited who then assigns a territory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Give each test instance its own config, route and event caches, so that a cached development config never points it at that database. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PHP server workers write at once, leaving the ends of cut request lines (e.g. ".3.3.0") on lines of their own: drop them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LukeSavefrogs
marked this pull request as ready for review
November 27, 2026 13:56
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.
Summary
Browser end-to-end tests with Playwright, covering the features of the app, run in CI on SQLite and MySQL: about 230 tests, of which a smoke subset also runs on a phone viewport.
Infrastructure
playwright.config.ts, with these projects:auth-setup: signs in each role once.chromium.mobile: the@mobiletests, on a Pixel 7.global-state: settings and requirements, run alone after the others.setup-wizard.tests/e2e/support/serve.shserves isolated instances on the ports 8010 and 8011. Each has its own.env.e2e-*, storage (storage/e2e/), database and session cookie:app: installed and seeded with the newE2eSeeder, with a user per role and known records.setup: empty, for the setup wizard.setup-phpturns it on, and on PHP 8.2 the workers segfaulted one after the other until every connection was refused.logs/server.log.X-Forwarded-For, so that the per-IP login rate limit doesn't throttle the parallel tests.tests/e2e/support/:php(), which runs code in the app through Tinker.DB_BUSY_TIMEOUT/DB_JOURNAL_MODEfrom the environment. Without them nothing changes. The E2E instances use WAL, so that the parallel writers wait for each other.Specs
workflows.spec.ts): the whole workflows of the users, through the pages they use.CLAUDE.mdnow asks to keep the E2E tests in step with every change to the UI, and to cover the whole workflows.Fix
FakeTerritoryAssignmentSeedercould pick a terminated campaign, which the observer refuses, so seeding the fake data failed. It now uses active campaigns only.CI
New
E2E testsworkflow (run-e2e-tests.yml), with a[sqlite, mysql]matrix.When a test fails, its retry is recorded: trace and video.
On failure, the job:
The existing workflow is renamed, so that the two suites are told apart. The required checks of
mainneed updating after the merge:Run tests→Pest testsrun-tests.yml→run-pest-tests.ymlRun tests (prefixed=no/yes)→Pest (prefixed=no/yes)Run E2E tests→E2E testsrun-e2e.yml→run-e2e-tests.ymlRun E2E tests (sqlite/mysql)→E2E (sqlite/mysql)PostgreSQL is left out: the app doesn't support it yet. Almost every page fails with
operator does not exist: text ->> unknown, which comes from the database notifications queryingdata->>'format'on atextcolumn. It will come in its own PR.Found while writing the tests (not fixed here, marked
test.fixme)/app/campaigns/{id}/assignmentsthrowsLazyLoadingViolationExceptionoutside production when a campaign has 2 or more assignments in progress. The page hides the campaign column, and the row classes still read the campaign.achyutn/filament-log-viewer) lists no entries when the environment name has a hyphen, e.g.e2e-apporpr-123previews.Spatie\Tags\HasSlugrebuilds it from the name on every save.Other findings:
Test plan
php artisan test --compact tests/Feature/E2eSeederTest.php tests/Feature/FakeDataSeederTest.php tests/Feature/SqliteConnectionConfigTest.php--repeat-each=2 --workers=3;workflows.spec.tswith--repeat-each=4 --workers=3.E2E testsandPest testsgreen on SQLite and MySQL, under the new names.🤖 Generated with Claude Code
https://claude.ai/code/session_019ELFCvU9iyEytKmTVmJRXU