Files
dredgegram/app/Console/Commands/RunsPlaywrightScript.php
dredgy f00405ed24
linter / quality (push) Canceled after 0s
tests / ci (8.3) (push) Canceled after 0s
tests / ci (8.4) (push) Canceled after 0s
tests / ci (8.5) (push) Canceled after 0s
Initial Commit
2026-08-28 22:55:32 +10:00

39 lines
860 B
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Process;
abstract class RunsPlaywrightScript extends Command
{
protected string $script;
protected int $processTimeout = 300;
public function handle(): int
{
$this->info("Running {$this->script}...");
$result = Process::path(base_path('playwright'))
->timeout($this->processTimeout)
->run("npx playwright test {$this->script} --reporter=line");
$this->line($result->output());
if (! $result->successful()) {
$this->error($result->errorOutput());
return self::FAILURE;
}
$this->afterRun();
$this->info('Done.');
return self::SUCCESS;
}
protected function afterRun(): void
{
// no-op by default
}
}