Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mink Debug Extension Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.

  • Governance: license metadata reports NOASSERTION. That must be resolved by legal before anything ships in a commercial CI pipeline, even as a dev-only dependency.
  • Maintenance trajectory: the project has a real release history (v1.0.x → v2.1.0, PHP 8.0 support added in v2.0.0, PHP <7.4 dropped in v2.1.0), but zero reported dependents and a very small contributor base. Treat it as "likely to need a fork" within a two-to-three-year horizon.
  • Documentation drift: the README documents exactly three options (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.
  • Data exposure: captured HTML and screenshots contain authenticated pages, cookies, headers, and form values. This is the largest real risk and it is entirely under our control — log directories must be gitignored and CI artifact retention policy must be deliberate.
  • Performance: negligible CPU; the meaningful cost is I/O and artifact storage. A prior release removed request-body dumping precisely because it blew up file size and memory, so the project has already learned this lesson once.

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?

Integration Approach

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.

  1. Confirm Behat + Mink already runs green in CI and that a capturing driver is available.
  2. Clear license and artifact-handling policy.
  3. Pilot in one repo, one profile, local-only, for a single sprint; measure time-to-diagnosis on red builds.
  4. If it pays, add a CI profile with a per-job directory and an artifact upload step — the bundled CI helper binaries were removed in v2.0.0, so upload is now your pipeline's responsibility.
  5. Record the fork/no-fork decision and the owner before it becomes urgent.

Operational Impact

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".
  • Directory not writable in containerized CI → logs lost with no loud error.
  • screenshot: true on a non-capturing driver → no images, wasted debugging time.
  • clean_start: true combined with parallel jobs → nondeterministic, partially erased artifacts.
  • Authenticated-page screenshots and DOM dumps landing in CI artifacts or, worse, in git → credential/PII exposure.
  • Large failing suites producing multi-hundred-megabyte artifact sets and slow, expensive pipeline storage.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels