Skip to content

Commit d91e9bb

Browse files
authored
Refactor blog post formatting and headings
Updated headings and image formatting in the blog post to improve readability and structure.
1 parent d4a89a6 commit d91e9bb

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

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

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ authors:
99
tags: [playwright, workflow, automation, qa, testing]
1010
---
1111

12-
![playwright](https://miro.medium.com/v2/resize:fit:1400/format:webp/1*b6eXVs5J3aRNzYAiqnS9Vw.png)
12+
<img
13+
src="https://miro.medium.com/v2/resize:fit:1400/format:webp/1*b6eXVs5J3aRNzYAiqnS9Vw.png"
14+
alt="Playwright"
15+
style="min-width: 100px; max-width: 600px; width: 30%;"
16+
/>
1317

1418
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?
1519

@@ -20,16 +24,15 @@ With **Playwright** and **Laravel Workflow**, you can achieve just that! In this
2024
* Converts the video to an MP4 format for easy sharing.
2125
* Runs seamlessly in a **GitHub Codespace**.
2226

23-
The Stack
24-
=========
27+
# The Stack
2528

2629
* **Playwright**: A powerful browser automation tool for testing web applications.
2730
* **Laravel Workflow**: A durable workflow engine for handling long-running, distributed processes.
2831
* **FFmpeg**: Used to convert Playwright’s WebM recordings to MP4 format.
2932

3033
[![](https://mermaid.ink/img/pako:eNpNkl1P2zAUhv-KdS52FbrWNMGNEBOkDSDRDVEE2pJemOaQWiR25NoF1va_z3Zg252Pn_c9Xzo7WKkKIYXnRr2u1lwbcj8tJSHnxcL46FHpF8-W5OjojFwUd1aS24a_v2pRrw1ZrLTozLKU3nPhNfuMd8ZqJJmSG9UgmWmt9GZPsl3_Irmysvp28I4sOH6iw9PiRtUf4uU_9l3tyaxwuYyQFgOYhlby4rM1V6ntGjQ9nfX0_47ucKV0RR5EhS7bZbHgWySP-DQnuWh612VwXflCW_Rje2oUmd-OyVbw0yf99SzP2w7rIL8K8mu3I-Um_UJ-WNNZ49UBX_c9QAS1FhWkRluMoEXdch_CzotKMGtssYTUPSuuX0oo5cF5Oi5_KdV-2rSy9RrSZ95sXGS7ihucCl5r3v791Sgr1JlbrIGUxiEHpDt4g3SUxIPkhMUnI0bj4YQNkwjenYglg2QcJ2wypkMW0_j4EMHvUHY4iMfHE8omdEQpTVjCIsBKuFHn_a2Ekzn8AZMbsr4?type=png)](https://mermaid.live/edit#pako:eNpNkl1P2zAUhv-KdS52FbrWNMGNEBOkDSDRDVEE2pJemOaQWiR25NoF1va_z3Zg252Pn_c9Xzo7WKkKIYXnRr2u1lwbcj8tJSHnxcL46FHpF8-W5OjojFwUd1aS24a_v2pRrw1ZrLTozLKU3nPhNfuMd8ZqJJmSG9UgmWmt9GZPsl3_Irmysvp28I4sOH6iw9PiRtUf4uU_9l3tyaxwuYyQFgOYhlby4rM1V6ntGjQ9nfX0_47ucKV0RR5EhS7bZbHgWySP-DQnuWh612VwXflCW_Rje2oUmd-OyVbw0yf99SzP2w7rIL8K8mu3I-Um_UJ-WNNZ49UBX_c9QAS1FhWkRluMoEXdch_CzotKMGtssYTUPSuuX0oo5cF5Oi5_KdV-2rSy9RrSZ95sXGS7ihucCl5r3v791Sgr1JlbrIGUxiEHpDt4g3SUxIPkhMUnI0bj4YQNkwjenYglg2QcJ2wypkMW0_j4EMHvUHY4iMfHE8omdEQpTVjCIsBKuFHn_a2Ekzn8AZMbsr4)
3134

32-
# 1. Capturing Errors and Video with Playwright
35+
## 1. Capturing Errors and Video with Playwright
3336

3437
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.
3538

@@ -74,7 +77,7 @@ import fs from 'fs';
7477
})();
7578
```
7679

77-
# 2. Running the Workflow
80+
## 2. Running the Workflow
7881

7982
A Laravel console command (`php artisan app:playwright`) starts the workflow which:
8083

@@ -105,7 +108,7 @@ class Playwright extends Command
105108
}
106109
```
107110

108-
# 3. The Workflow
111+
## 3. The Workflow
109112

110113
```php
111114
namespace App\Workflows\Playwright;
@@ -129,7 +132,7 @@ class CheckConsoleErrorsWorkflow extends Workflow
129132
}
130133
```
131134

132-
# 4. Running Playwright
135+
## 4. Running Playwright
133136

134137
```php
135138
namespace App\Workflows\Playwright;
@@ -150,7 +153,7 @@ class CheckConsoleErrorsActivity extends Activity
150153
}
151154
```
152155

153-
# 5. Video Conversion with FFmpeg
156+
## 5. Video Conversion with FFmpeg
154157

155158
The Playwright recording is stored in WebM format, but we need an MP4 for wider compatibility. Laravel Workflow runs this process asynchronously.
156159

@@ -177,7 +180,7 @@ class ConvertVideoActivity extends Activity
177180
}
178181
```
179182

180-
## Try It Now in Your Browser
183+
# Try It Now in Your Browser
181184

182185
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).
183186

@@ -198,14 +201,6 @@ php artisan app:playwright
198201

199202
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.
200203

201-
# Conclusion
204+
## Conclusion
202205

203206
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).
209-
* Join the community and share your workflows!
210-
211-
Happy automating! 🚀

0 commit comments

Comments
 (0)