You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you ever spent hours tracking down a frontend bug that only happens in production? When working with web applications, debugging frontend issues can be challenging. Console errors and unexpected UI behaviors often require careful inspection and reproducible test cases. Wouldn’t it be great if you could automate this process, capture errors, and even record a video of the session for later analysis?
15
19
@@ -20,16 +24,15 @@ With **Playwright** and **Laravel Workflow**, you can achieve just that! In this
20
24
* Converts the video to an MP4 format for easy sharing.
21
25
* Runs seamlessly in a **GitHub Codespace**.
22
26
23
-
The Stack
24
-
=========
27
+
# The Stack
25
28
26
29
***Playwright**: A powerful browser automation tool for testing web applications.
27
30
***Laravel Workflow**: A durable workflow engine for handling long-running, distributed processes.
28
31
***FFmpeg**: Used to convert Playwright’s WebM recordings to MP4 format.
The Playwright script automates a browser session, navigates to a given URL, and logs any console errors. It also records a video of the entire session.
35
38
@@ -74,7 +77,7 @@ import fs from 'fs';
74
77
})();
75
78
```
76
79
77
-
# 2. Running the Workflow
80
+
##2. Running the Workflow
78
81
79
82
A Laravel console command (`php artisan app:playwright`) starts the workflow which:
80
83
@@ -105,7 +108,7 @@ class Playwright extends Command
105
108
}
106
109
```
107
110
108
-
# 3. The Workflow
111
+
##3. The Workflow
109
112
110
113
```php
111
114
namespace App\Workflows\Playwright;
@@ -129,7 +132,7 @@ class CheckConsoleErrorsWorkflow extends Workflow
129
132
}
130
133
```
131
134
132
-
# 4. Running Playwright
135
+
##4. Running Playwright
133
136
134
137
```php
135
138
namespace App\Workflows\Playwright;
@@ -150,7 +153,7 @@ class CheckConsoleErrorsActivity extends Activity
150
153
}
151
154
```
152
155
153
-
# 5. Video Conversion with FFmpeg
156
+
##5. Video Conversion with FFmpeg
154
157
155
158
The Playwright recording is stored in WebM format, but we need an MP4 for wider compatibility. Laravel Workflow runs this process asynchronously.
156
159
@@ -177,7 +180,7 @@ class ConvertVideoActivity extends Activity
177
180
}
178
181
```
179
182
180
-
##Try It Now in Your Browser
183
+
# Try It Now in Your Browser
181
184
182
185
You don’t need to set up anything on your local machine. Everything is already configured in the Laravel Workflow [Sample App](https://github.com/laravel-workflow/sample-app).
183
186
@@ -198,14 +201,6 @@ php artisan app:playwright
198
201
199
202
That’s it! The workflow will execute, capture console errors, record a video, and convert it to MP4. You can find the video in the videos folder. Take a look at the sample app’s README.md for more information on other workflows and how to view the Waterline UI.
200
203
201
-
# Conclusion
204
+
##Conclusion
202
205
203
206
By integrating Playwright with Laravel Workflow, we’ve automated frontend error detection and debugging. This setup allows teams to quickly identify and resolve issues, all while leveraging Laravel’s queue system to run tasks asynchronously.
204
-
205
-
## 🔗 **Next Steps**
206
-
207
-
* Check out the [Laravel Workflow repo](https://github.com/laravel-workflow/laravel-workflow) on GitHub.
208
-
* Explore more workflows in the [sample app](https://github.com/laravel-workflow/sample-app).
0 commit comments