jeffersongoncalves/screentest-cli
screentest-cli is a Laravel/PHP command-line tool for screen testing. It lets developers run automated visual checks from the terminal, integrate them into local dev or CI workflows, and catch UI regressions early before they reach production. A focused CLI for repeatable screen tests.
screentest binary (Laravel Zero app) as a dev dependency or globally, and confirm Docker is available — the bundled headless Chrome lives under stubs/docker/, so screenshots won't render without it.cd into the Filament plugin you want to document (not the host app), then run screentest init. It analyzes the plugin, guesses the package name, detects resources/pages, and writes a screentest.json at the repo root.init with flags instead of prompts:
screentest init --path=. \
--name="My Plugin" \
--package=vendor/my-plugin \
--screenshots=all \
--no-readme
Add --deps=vendor/wrapped-package when the plugin is a thin wrapper around a standalone "kit" package.screentest.json in this order: plugin → filakit → install.publish → install.env → seed → screenshots → output → readme. Those are the fields that break screenshots most often.screentest run. It executes the full pipeline create → install → publish → post-install → build assets → seed → serve → capture → readme, drops PNGs into output.directory, and rewrites the README section between the configured markers.stubs/screentest.json.stub (the fully annotated config reference), and stubs/docker/ for the browser image. Then CaptureService for URL resolution and warning behavior.screentest.json as committed config. One file per plugin repo, reviewed in PRs like any other build config. It declares targets, seeding, and README output in one place.install (extra packages, plugin registration, publish, post_install_commands, env) always runs before seed, which runs before serve and capture. Ordering inside the JSON doesn't matter — a publish tag being present does.spatie/laravel-package-tools with ->hasMigrations(), migrations ship as *.php.stub and are not auto-loaded. Add the publish tag to install.publish; the tag is shortName() . '-migrations' (e.g. laravel-short-url → short-url-migrations). Confirm with php artisan vendor:publish --provider="Vendor\Plugin\PluginServiceProvider" inside a scratch project rather than guessing.config('package.feature.enabled', false) backed by env('SOME_FLAG', false), put "SOME_FLAG": "true" in install.env. These are written into the temp project's .env before install/seed/serve.seed.auto_detect: true plus an explicit seed.models list ({ "model": "...", "count": 10 }) covers list pages and /1/edit-style URLs. Explicit models beat auto-detection when factories miss required relations.route + routeParams with signed: true for routes behind Laravel's signed middleware; a literal url can't carry a valid signature because it depends on the temp project's APP_KEY. CaptureService::resolveRouteUrls() injects a throwaway screentest:resolve-urls command into the temp project to generate real signed URLs.output.themes: ["light", "dark"] gives parity between Filament panel modes in a single run; expect roughly 2× capture time.<!-- SCREENSHOTS -->, "template": "table"). Keep everything inside the marker generated, everything outside hand-written.screentest run = full pipeline from scratch; screentest capture reuses the temp project and just re-shoots the configured URLs. Use capture while tuning selectors/URLs, run for a clean verification and CI.screentest run on release PRs or a scheduled job, fail the build on non-zero exit, and upload output.directory as an artifact. Use --no-readme on init if README updates are handled elsewhere.SQLSTATE ... no such table: X with debug on). Fix install.publish first; don't chase CSS or selectors.getResources() for config('...') calls, then check the referenced package's config/*.php for the matching env(..., false) default and set it in install.env.Generating and running seeds: ✔ can still leave a table empty when a factory throws on required relations. If an /1/edit screenshot looks wrong, verify row count before assuming a capture bug.url with a signature will 403 in the temp project. Use route/routeParams/signed: true; a bad route name or param surfaces as a normal failed CaptureResult per theme, which is the signal to look at.capture/run prints a warning (after the run, no non-zero exit) when a screenshot's HTTP status is 4xx/5xx or the HTML looks like a Laravel debug page. A green CI run can still ship blank PNGs — scrape the CLI output or diff PNG sizes in CI if you need hard guarantees.null/empty/invalid values must not break a run).stubs/docker/ image before debugging Filament code.build assets stage for Vite/npm failures in the temp project, not the screenshot config.screentest.json and the generated images under output.directory.How can I help you explore Laravel packages today?