Appearance
date: 2026-06-06 tags: [testing, pest, browser, ci, composer-plugins, sandbox] status: active graduated_to:
pest-plugin-browser auto-connect needs composer plugins enabled
Symptom — In the remote sandbox, every browser test failed fast (~270ms) with "Call to a member function sendText() on null" / "WebSocket client is not connected" — the Playwright server was never started and the connect hook never ran. vendor/bin/pest --help showed no browser flags.
Root cause — The plugin registers its connect filter in Plugin::boot(), which Pest only runs if it discovers the plugin via extra.pest.plugins. This non-interactive remote environment disables composer plugins ("for safety"), so Plugin::boot() never registers and the __markAsBrowserTest proxy that calls connectTo() is never attached. (The Browsable trait still loads via composer autoload files, so visit() exists — which masks the real gap.)
Fix — Sandbox-only workaround: a beforeEach that manually ServerManager::instance()->playwright()->start() + Client::instance()->connectTo(...) + http()->bootstrap(). Do not commit it — in a normal dev/CI env (composer plugins enabled) the hook auto-fires and you just write visit(). Real CI must run composer with plugins allowed.
Guard — Epic #250 / Sprint 2 task #259 ("real-CI auto-wiring; drop the sandbox beforeEach"). If the suite is ever run in this sandbox again, expect to re-add the workaround.