Skip to content

Commit 7535652

Browse files
authored
Update 2025-02-07-automating-qa-with-playwright-and-laravel-workflow.md
1 parent 8183110 commit 7535652

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

blog/2025-02-07-automating-qa-with-playwright-and-laravel-workflow.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ use Workflow\WorkflowStub;
9292
class Playwright extends Command
9393
{
9494
protected $signature = 'app:playwright';
95+
9596
protected $description = 'Runs a playwright workflow';
97+
9698
public function handle()
9799
{
98100
$workflow = WorkflowStub::make(CheckConsoleErrorsWorkflow::class);
@@ -116,8 +118,11 @@ class CheckConsoleErrorsWorkflow extends Workflow
116118
public function execute(string $url)
117119
{
118120
$result = yield ActivityStub::make(CheckConsoleErrorsActivity::class, $url);
121+
119122
$mp4 = yield ActivityStub::make(ConvertVideoActivity::class, $result['video']);
120-
return [ 'errors' => $result['errors'],
123+
124+
return [
125+
'errors' => $result['errors'],
121126
'mp4' => $mp4,
122127
];
123128
}
@@ -139,6 +144,7 @@ class CheckConsoleErrorsActivity extends Activity
139144
$result = Process::run([
140145
'node', base_path('playwright-script.js'), $url
141146
])->throw();
147+
142148
return json_decode($result->output(), true);
143149
}
144150
}
@@ -159,10 +165,13 @@ class ConvertVideoActivity extends Activity
159165
public function execute(string $webm)
160166
{
161167
$mp4 = str_replace('.webm', '.mp4', $webm);
168+
162169
Process::run([
163170
'ffmpeg', '-i', $webm, '-c:v', 'libx264', '-preset', 'fast', '-crf', '23', '-c:a', 'aac', '-b:a', '128k', $mp4
164171
])->throw();
172+
165173
unlink($webm);
174+
166175
return $mp4;
167176
}
168177
}

0 commit comments

Comments
 (0)