Add global beforeEach / afterEach hooks using Playwright automatic fixtures

Add global beforeEach / afterEach hooks using Playwright automatic fixtures

Nov 8, 2024

Join Stefan Judis, Checkly's Playwright ambassador, as he shows you how to make your end-to-end testing life easier using Playwright's automatic fixtures. Learn how to implement global "beforeEach" and "afterEach" test hooks to add runtime annotation and JavaScript exception monitoring without repeating yourself across spec files.

Playwright fixture docs: https://playwright.dev/docs/test-fixtures#automatic-fixtures
"Reuse Playwright Code across Files and Tests with Fixtures" (video): https://www.youtube.com/watch
"How to combine POMs with Playwright Fixtures" (video): https://www.youtube.com/watch
Checkly synthetic monitoring: https://www.checklyhq.com/product/synthetic-monitoring/

0:00 Intro

0:43 Base setup with "beforeEach" / "afterEach"

2:32 Add basic custom fixture implementation

3:48 Replace "beforeEach" / "afterEach" with a fixture

4:51 Add annotations with automatic fixtures

6:42 Add JavaScript error monitoring with automatic fixtures

10:23 Outro

#playwright #syntheticmonitoring #checkly