Appearance
date: 2026-06-11 tags: [testing, pest, browser, composer, sandbox, ci] status: active graduated_to:
A missing pest-plugin-browser kills the whole Pest suite at collection — --exclude-group=browser can't save it
Symptom — In a fresh web container, php artisan test (any filter, even a single non-browser file) aborts at bootstrap with Error: Trait "Pest\Browser\Browsable" not found at tests/BrowserTestCase.php:12, chained from tests/Pest.php via Pest\PendingCalls\UsesCall::__destruct(). No test runs — not even non-browser ones.
Root cause — pestphp/pest-plugin-browser was declared in composer.json (require-dev) but absent from vendor/ (the container's install was incomplete). tests/Pest.php binds uses(BrowserTestCase::class)->in('Browser'), and BrowserTestCase uses the plugin's Browsable trait. That binding is resolved at collection time, before any --group / --exclude-group filter is applied — so a missing trait is a hard fatal for the entire suite, not just tests/Browser. This is distinct from 2026-06-06-pest-browser-needs-composer-plugins.md: there the package is installed but composer plugins are disabled (auto-connect hook never fires, browser tests fail at runtime, visit() still resolves); here the package is missing entirely and even the trait won't load.
Fix — composer install (the dep is declared, just not vendored) restores it; the suite then collects and runs (verified: 59 harness tests passed afterward). Don't read "Trait … not found" at collection as "the tests are broken" — read it as "vendor/ is incomplete".
Guard — Best fixed once via a SessionStart hook that runs composer install on web-container start — filed as issue #411. Until that lands: in a fresh web session, run composer install before trusting any "the whole suite fails" signal. Surfaced building PR #410.