friends-of-behat/mink-debug-extension
Behat extension that logs Mink-related data after every failed step and can save screenshots with a supporting driver. Configure a log directory, optional screenshots, and clean starts; especially useful for debugging CI runs like Travis.
What it actually is. friends-of-behat/mink-debug-extension is a Behat extension — not a Laravel package. It has no service provider, no facade, no publishable config, and no awareness of the Laravel container. It hooks Behat's step-failure lifecycle and, on a red step, writes an HTML dump of the Mink session state (current URL, page source, and optionally a screenshot) to a directory. It is a developer-experience utility for a BDD test suite, nothing more.
Architecture fit. For a Laravel-centric engineering org the fit is conditional and narrow. Laravel's first-party testing story is PHPUnit/Pest for feature and unit tests and Laravel Dusk for browser tests; Dusk already ships failure screenshots and console/browser logs. This extension therefore only creates leverage where Behat + Mink is already a mandated or inherited layer — e.g. enterprise acceptance-test contracts written in Gherkin, a Symfony-era suite carried into a Laravel monorepo, or cross-team specs shared with QA. If Behat is not already in the repo, adopting this package means adopting Behat, Mink, and a driver first; that is a stack decision far larger than this dependency and should not be driven by a 200-star debugger.
Integration feasibility. Composer-level integration is trivial: composer require --dev friends-of-behat/mink-debug-extension, then enable it in behat.yml by supplying directory — that key is what activates the extension, so omitting it is a silent no-op. screenshot (default false) requires a driver capable of capture; BrowserKit/Goutte cannot, Selenium/WebDriver can. clean_start (default true) wipes the log directory each run, which is friendly locally and hostile in parallel CI. Total engineering effort for a pilot is measured in hours, not days.
Technical risk.
NOASSERTION. That must be resolved by legal before anything ships in a commercial CI pipeline, even as a dev-only dependency.directory, screenshot, clean_start). Guidance circulating internally that references enabled, session, screenshot_dir, or CLI flags such as --debug / --debug-clear is fabricated — this extension adds no commands. Any onboarding estimate built on those docs is wrong, and the discrepancy should be corrected before it becomes a support ticket.Key questions for the team. (1) Is Behat a committed capability or an inherited artifact we intend to retire? (2) If browser testing is the need, why not Dusk, which gives this for free and is first-party? (3) Which Mink driver — if it isn't a real browser, screenshots are off the table and half the value evaporates. (4) Who owns the fork if upstream stalls? (5) What is our artifact retention and PII policy for failure dumps? (6) Has legal cleared the NOASSERTION license flag?
Stack fit.
| Layer | Fit | Note |
|---|---|---|
| Laravel core | None | No coupling, no config, no container awareness |
| Behat + Mink | Native | Purpose-built for this |
| Goutte/BrowserKit driver | Works, no screenshots | Logs only |
| Selenium/WebDriver driver | Full | Screenshots available |
| PHPUnit/Pest | Not applicable | Separate runner |
| Laravel Dusk | Redundant | Dusk has equivalent built-in artifacts |
Migration path. There is no migration — it is an additive dev dependency with a single YAML block. Realistic path: install as --dev, point directory at a gitignored path such as %paths.base%/build/behat-logs, set clean_start: false if you want run-over-run history, enable screenshot only where a capturing driver is configured, run the existing suite once against a deliberately failing scenario to prove output, then delete if it doesn't earn its keep.
Compatibility. Verify PHP constraint alignment with the application's runtime (v2.1.0 requires PHP ≥7.4; confirm the Behat and Mink major versions in the lockfile are the ones this extension's branch targets). Pin explicitly and let Composer's resolver arbitrate rather than bumping Behat to chase a debugger. Where the Laravel app must be bootstrapped inside a Behat context (container, database, migrations, auth), that glue is custom work unrelated to this package — budget for it separately, because the extension assumes a working Mink session, not a working application.
Sequencing.
Maintenance. Low steady-state effort: one YAML block, no application code. The maintenance liability is transitive — it tracks Behat, Mink, and the driver, and the driver is usually the volatile piece. Set a review trigger on any Behat/Mink major upgrade and on PHP minor bumps; expect to vendor or fork if upstream goes quiet.
Support. Upstream is small-team, issue-tracker-based, with no commercial backing and no LTS commitment. Internal support requires someone fluent in Gherkin and Mink sessions; Laravel developers without BDD exposure will not self-serve. Because the failure artifacts are static HTML, triage is cheap once they exist — that is the package's entire value proposition, and it is a genuine one for teams already in Behat.
Scaling. The output model is a single flat directory with optional wipe-on-start, which does not compose with parallel Behat workers. Parameterize directory per worker (environment-driven profile values) so workers don't overwrite each other, and set clean_start: false in CI so post-run artifacts survive for upload. Storage grows linearly with failures; a nightly retention job is required, not optional.
Failure modes.
directory omitted → extension silently inert, team believes it is "on".screenshot: true on a non-capturing driver → no images, wasted debugging time.clean_start: true combined with parallel jobs → nondeterministic, partially erased artifacts.Ramp-up. Half a day for an engineer already comfortable with Behat: install, configure, run a failing scenario, read the HTML. A Laravel-only engineer needs materially longer because the prerequisite is Gherkin and Mink concepts, not this extension. Documentation should be a short internal README correcting the three real options and stating the artifact/PII rules — do not point people at secondary write-ups, several of which are wrong about this package's interface.
Recommendation. Treat this as a zero-cost, low-risk, low-leverage tactical aid: approve it as a dev-only dependency only where Behat + Mink already exists, with license clearance, gitignored output, per-worker directories, and explicit retention. Do not fund it as a strategic capability, and do not let it become the reason a Laravel team chooses Behat over Dusk.
How can I help you explore Laravel packages today?