Implement pest --record command for browser test generation#222
Open
J87NL wants to merge 6 commits into
Open
Conversation
Add --server/--migrate-fresh/--seed flags and auto-detect login sequences - Record.php: add --server (starts `php artisan serve`), --env, --migrate-fresh, --seed options - TestGenerator: strip password form fills and inject actingAs(factory()) automatically; pass $actingAs when --acting-as is set - Locator: use Selector::getByLabelSelector for textbox/searchbox/combobox roles - README: document --server (env mismatch problem), expand --acting-as section, fix example output
…using factory session, remove login sequence auto-detection, add RECORDING.md
…dex bug in EventSanitizer
…neration into a dedicated Laravel script, and fix various recorder issues
…s to the recorder
This was referenced May 24, 2026
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.
As more code (and tests) gets written by AI, (browser)tests matter more than ever.
Not just as a safety net, but as the source of truth.
vendor/bin/pest --record(orphp artisan test --record) opens a real browser, lets you click through your app, fill and save forms, close the browser, give the test a name and Pest writes a ready-to-run test to tests/Browser/.This implementation is based on my POC https://github.com/ComfyCodersBV/laravel-pest-recorder which I talked about with Nuno at Laracon EU.
Pest-browserrecorder-demo.mp4
What's in here:
--author--userbootstraps a factory user with a session cookie; generated test uses actingAs(). Built in auth for Laravel included, manual override option possible for other frameworks or extended authentication.playwright codegensupported & more like the--url=...flag.