Playwright Data Attributes: Simplify Test Automation and Enhance Maintainability
Using data attributes in HTML elements for testing purposes greatly improves the experience and stability of tests. Here's a guide by Khurram Muslim explaining it, using Playwright as an example.
However, someone on Reddit shared a concern about this approach: Should we not use data-testid for element identification?.
Why I switched from Cypress to Playwright
Lucy Diaz shares an interesting, detailed experience of using both Cypress and Playwright frameworks for a few years and how that led to switching to the latter.
Also, following up on the rumours, some people on Reddit are discussing: Is Cypress really on its tail end?.
Are ChatGPT or Claude better than Playwright Codegen?
Interesting question! Stefan Judis checks how general-purpose LLM chatbots compare to Playwright Codegen when it comes to the accuracy and effectiveness of generating tests.
How to Use Playwright for Advanced Network Interception
If you're looking into validating your web app behaviour in failure scenarios, Balaji Kumarasamy shows a handy guide to validating that with Playwright tests.
Also, Rinkesh Patel shares a concise Recipe for managing Playwright tests for different deployment environments.
How to do authentication in Playwright
If your web app requires authentication, there's a smart way of handling that across several Playwright tests without repeating the login scenario all over again. Filip Hric explains how.
Similarly, Butch Mayhew has an example of Playwright Login Test With 2FA Enabled.
API Testing with Playwright and OpenAPI-Generated Types
Playwright can test both the UI and API of web apps. Adam Pajda wrote a detailed, example-based overview of implementing tests for the latter.
Ruff — The Fastest Python Linter for Playwright with Python
If you write your Playwright tests in Python, you might be interested in leveraging Ruff for code linting. Joan Alejandro Esquivel Montero explains how to do this in a 14-minute video.
Strategic Tagging: Optimizing Your Playwright Test Suite
Playwright v1.42 introduces a new, more convenient way of tagging tests. Meris Stupar gives a fine overview of that with practical examples.
Similarly, Parthiban Rajasekaran describes The Art of Playwright Tags.
How to Avoid Flaky Tests in Playwright
Playwright has quite a few features that help reduce test flakiness, but that might not be enough by itself. Antonello Zanini shows what more you can do.
And here's a handy overview of Playwright's auto-wait is simple and superb by Cerosh Jacob.
Introduction to the first Playwright project
Just starting with Playwright? You may enjoy Kostiantyn Teltov's helpful and thorough guide.
Also, Luciano Renzi shows how to Simplify Tests by Using a Main Page Object Class in Playwright.