Installing Diff Stage in a Laravel project
Connect your Laravel repository to Diff Stage, install the Pest browser recorder, and check your first local recording before adding GitHub Actions.
Guide 1 of 43 min readPest 5 · Browser 5.1.2
On this page
Check your project requirements
This guide uses Pest 5. The recorder also supports Pest 4 with Browser 4.3.1.
- A Laravel project hosted on GitHub
- Composer, Node.js and npm
- Pest 5 with Browser 5.1.2
- PHP 8.4 or later with the
socketsextension - An app that runs in its test environment with disposable test data
Diff Stage records Pest browser tests so reviewers can watch the flow a pull request changes. Start by connecting your repository and installing the recorder. Then add the GitHub Actions recording workflow.
Look at your existing browser-test workflow first. Keep its working Docker image, services and app setup, and install the recorder inside that environment. Check what it already has:
php -v
php -m
composer show pestphp/pest
composer show pestphp/pest-plugin-browserIf you have no Pest browser tests yet, follow Pest's browser testing setup first. Install the supported Browser version above, not an unrestricted version.
Connect your GitHub repository#
Sign in at Diff Stage and select the team that will own the evidence. During the free beta, no paid plan or payment details are required. Outside the beta, choose a plan in setup if your team doesn't have one.
A team owner or admin can choose Connect GitHub, install the Diff Stage GitHub App and select repositories. Complete the GitHub flow. Then, before you prepare the app or record, check that Diff Stage shows this exact repository as connected. The CI guide adds an authenticated preflight before expensive setup. Your selection must fit the team's repository allowance.
Install the recorder#
Install the recorder with Composer:
composer require --dev diff-stage/recorder:^0.3 -W-W lets Composer update related dependencies, including PHPUnit, to satisfy Pest. Review and commit the changes to composer.json and composer.lock.
Keep the Playwright version your browser tests already pass with. Install a tested pairing only if Playwright is missing: Browser 5.1.2 with Playwright 1.63.0, or Browser 4.3.1 with Playwright 1.59.1. For Browser 5.1.2:
npm install --save-dev playwright@1.63.0
npx --no-install playwright install chromiumCommit your npm manifest and lockfile too. On Linux machines without the browser libraries, use npx --no-install playwright install --with-deps chromium.
Check one recording locally#
Pick an existing browser test that covers a real user flow. Run it in the Docker or browser environment you already use. Replace this example path with your test:
./vendor/bin/pest tests/Browser/CheckoutTest.php --record-videosThe default output directory is tests/Browser/Videos. Each recorded test produces a .webm video and JSON telemetry. Watch the video and check that it shows the interaction and the final result. Add this entry to .gitignore to keep generated recordings out of Git:
/tests/Browser/Videos/Add CI publishing#
Install the Diff Stage agent skill so your coding agent can choose recordings and write the PR review notes. The guide also covers selecting evidence by hand.
Continue with Recording Pest browser tests in GitHub Actions. It covers selecting tests, recording the PR commit and publishing with GitHub Actions identity. You don't need an upload token.
Troubleshooting#
- Composer cannot find the recorder. Check that Composer can reach Packagist and that your project meets the supported Pest and Browser versions.
- Unsupported Browser version. Use Browser 5.1.2 with Pest 5, or Browser 4.3.1 with Pest 4. Resolve the dependency constraint before you record again.
- Playwright or Chromium is missing. Keep your installed Playwright version and install Chromium with
npx --no-install playwright install chromium. If Playwright is missing too, use a tested pairing from the install step above. - Your repository is missing. Check the active Diff Stage team and the GitHub App's selected repositories. If needed, ask the team owner or admin to reconnect.
Related guides
Recording Pest browser tests in GitHub Actions
Record selected tests on pull requests and publish them with a two-job workflow and GitHub Actions identity.
Comparing browser test videos before merging a PR
Watch a PR's videos beside the approved default-branch recording, then check actions and browser problems.
Using the Diff Stage agent skill
Ask your coding agent for a local feature demo or browser recordings to review before merging.
Show your reviewers what changed
Add the recorder to your test suite, and your next pull request gets a video.