lakion/mink-debug-extension
MinkDebugExtension (friends-of-behat/mink-debug-extension) is a Behat extension that logs and debugs Mink data after every failed step, especially useful on CI. With a supported driver it can save screenshots. Configure the log directory, screenshot option, and clean_start.
Framing correction (must be stated up front). This is not a Laravel package. There is no service provider, no facade, no config/*.php, and no integration with Laravel's container, Artisan, or test runner. It is a Behat extension — a Composer library loaded via a block in behat.yml that hooks the Mink step lifecycle and writes artifacts when a step fails. A TPM who frames this as "a Laravel test improvement" will mis-set expectations with stakeholders; the accurate framing is "a post-failure artifact collector for teams already running Behat + Mink acceptance tests." If the team runs PHPUnit, Pest, or Laravel Dusk, the package delivers zero functional value regardless of how well it is installed.
Architecture fit. Fit is binary rather than graduated: near-perfect where a Behat/Mink suite already exists, zero everywhere else. Where it fits, it is architecturally clean. It operates at the Behat extension boundary — it does not modify application code, does not wrap or replace the Mink driver, and does not instrument anything in production paths. On each failed step it serialises Mink session state (current URL, page source, driver metadata) to a directory, and can additionally persist a screenshot when the underlying driver supports it. That containment is the main architectural virtue from a delivery-risk standpoint: the blast radius of adoption is confined to test infrastructure and CI configuration.
Integration feasibility. Genuinely low effort at the install layer: one composer require --dev, one YAML block, three options (directory required; screenshot defaults false; clean_start defaults true). No migrations, no schema, no runtime configuration, no coupling to application code. The real work is not installation — it is the surrounding CI plumbing: making the artifact directory writable by the CI user and uploading the artifacts on failure so engineers can actually open them. Treat the install as a half-day task and the CI wiring plus team communication as the actual scoped work.
Technical risk. Moderate-low overall, with several items that must be surfaced before commitment:
| Risk | Severity | Detail |
|---|---|---|
| Package identity split | High | Repository is Lakion/MinkDebugExtension; the installable is friends-of-behat/mink-debug-extension; the namespace changed from Lakion\Behat\MinkDebugExtension to FriendsOfBehat\MinkDebugExtension at v2.0.0. Internal docs referencing the old namespace will silently fail to load. Budget for this confusion explicitly. |
| License = NOASSERTION | Medium-High | GitHub cannot classify the license. Compliance must read the actual LICENSE file. For an internal, dev-only test dependency this is usually tolerable; for anything audited or shipped, obtain written clearance. |
| v1 → v2 breaking surface | Medium | Log extension changed .log → .html; the upload-textfiles, upload-screenshots, and wait-for-port helper binaries were removed. Any CI script calling the old travis/tools/* paths breaks. CI must upload artifacts natively (actions/upload-artifact, GitLab artifacts:). |
| Screenshot conditional on driver | Medium | Screenshots require a screenshot-capable driver (Selenium and others since v2.0.0). Goutte and similar yield logs only. Promising "screenshots on failure" without verifying the driver sets a false expectation. |
| Log volume and sensitive data | Medium | HTML dumps of page source can contain session tokens, emails, and customer data. clean_start: true limits accumulation, not content sensitivity. |
| Thin adoption evidence | Medium | 204 stars but 0 listed dependents and a low composite score. Stars reflect the legacy Lakion era; the FriendsOfBehat fork carries maintenance. Treat it as a small, effectively single-maintainer utility — not a strategic dependency. |
Key questions to resolve before commitment.
screenshot: true actually do anything?NOASSERTION dependency for our tier?Stack fit. Valid only in this intersection: PHP project + Behat + Mink + a CI pipeline. Laravel is incidental — a Laravel app can host a Behat suite, but Laravel's own tooling (php artisan test, Dusk, Pest listeners) does not compose with this extension at all. Secondary fit: any PHP codebase with a Behat acceptance layer. Non-fit: PHPUnit/Pest-only suites, Dusk-only suites, JS-based E2E (Cypress, Playwright), or anything where the driver in use cannot produce screenshots and log-only output is not worth the wiring.
Migration path. Two distinct paths depending on starting point:
Greenfield (no Behat debugging today):
composer require --dev friends-of-behat/mink-debug-extension.FriendsOfBehat\MinkDebugExtension block to the relevant Behat profile with directory: %paths.base%/var/behat-logs.screenshot: false) to validate the directory, permissions, and artifact shape with no driver dependency.screenshot: true on a suite whose driver supports it.Upgrading from the Lakion era (v1.x):
UPGRADE.md before touching composer.Lakion\Behat\MinkDebugExtension namespace reference in behat.yml and internal docs with FriendsOfBehat\MinkDebugExtension.vendor/lakion/mink-debug-extension/travis/tools/* — those binaries no longer exist. Replace with native pipeline artifact upload..html; update any glob patterns, artifact paths, or dashboard links that match *.log.Compatibility. Requires PHP ≥7.4 on the v2.1.0 line; v2.2.0 adds Behat 4 support. Verify the Behat major version in use before pinning — a Behat 3 project must not float onto a v2.2.0 requirement it cannot satisfy. Pin an explicit version rather than allowing a floating constraint, given the thin maintainer base.
Sequencing. Run this as a bounded pilot, not a rollout:
Maintenance. Low code-level maintenance but non-zero dependency risk. The package is a small, effectively single-maintainer utility with 0 listed dependents; there is no vendor, no SLA, and no commercial backstop. Assign an explicit internal owner (typically a QA lead or the platform/test-infra engineer) so it does not become orphaned config that nobody understands. Budget a periodic review: Behat major bumps, PHP runtime upgrades, and driver changes are all events that can silently break artifact capture.
Support. No vendor support path. Support is internal: whoever owns the Behat suite owns the extension. The single highest-value support artifact is a short internal runbook covering the namespace rename trap, the required directory setting, where artifacts land, and how to download them from CI. Without that, every new engineer will re-hit the same two failure modes.
Scaling. Scales well horizontally in the sense that cost per job is trivial — writing a few HTML files per failure is negligible against browser-driven acceptance test runtime. The scaling concern is storage and noise, not compute: clean_start: true clears logs per execution, but with parallel CI runners each job writes its own directory and artifact uploads accumulate per pipeline. Set retention (e.g. 14–30 days on failed builds only) at the pipeline level, not the package level. Also note artifacts should upload only on failure — uploading on every green build is pure cost with no diagnostic value.
Failure modes to plan for.
%paths.base%/.... Fails opaquely or produces empty output. Mitigate with an explicit writable path and a smoke assertion in the pipeline.Ramp-up. Very low for engineers: it is configuration, not code, and the mental model ("failed step writes a file") takes minutes to grasp. The genuine ramp-up cost sits with CI/DevOps (artifact upload, retention, permissions) and compliance (license, data handling). Estimate roughly one engineer-day of engineering effort plus legal turnaround for the pilot; the dominant calendar risk is the license review, not the technical work.
Value measurement. Track three things against the pre-pilot baseline: time-to-first-diagnosis on red acceptance builds, count of "cannot reproduce locally" handoffs, and proportion of failures resolved without a local rerun. If those do not move after four weeks on one suite, the honest conclusion is that the team's bottleneck is elsewhere, and the pilot should be closed rather than expanded.
How can I help you explore Laravel packages today?