pest icon indicating copy to clipboard operation
pest copied to clipboard

[Bug]: Browser test screenshots are not generated (even with `--headed`)

Open zackijack opened this issue 2 months ago • 0 comments

What Happened

When adding a Browser test, no screenshots are generated, even when running with the --headed flag.

Expected: screenshots to appear under tests/Browser/Screenshots.

Actual: no screenshots are saved, and when I manually create tests/Browser/Screenshots, the directory is deleted after running ./vendor/bin/pest.

Image

How to Reproduce

Reproduce on an existing Laravel project or from a fresh starter with nunomaduro/laravel-starter-kit

  1. Install dependencies and set up Laravel as usual
  • Install dependencies and set up Laravel as usual
  • run: npx playwright install
  1. Run the tests with Pest
  • ./vendor/bin/pest; or
  • sail pest
  1. Observe:
  • No screenshots are produced in tests/Browser/Screenshots.
  • If the Screenshots folder existed beforehand, it gets removed after the run.

Sample Repository

No response

Pest Version

4.1.2

PHP Version

8.4.13

Operation System

macOS

Notes

Environments where I reproduced it:

  • Local (host): macOS
  • Local (container): Laravel Sail
  • CI: GitHub Actions (ubuntu-latest)

zackijack avatar Oct 20 '25 14:10 zackijack