Rayrun
← Back to videos

Playwright Hard & Soft Assert, Highlight Locators | Playwright tutorial - part 70

In this video, we'll understand how to use hard and soft assert (expect) in Playwright and also how to mask locators.

In this video, Kaushik introduces the new release of Playwright version 1.20. He covers one highlighted feature, which is the ability to highlight elements by creating a mask on them. This feature can be useful for hiding sensitive locators, such as user IDs, in a test report. He demonstrates how to use this feature by taking a screenshot and attaching it to the report.

Kaushik also mentions other features included in the release, such as updates to the Python Docker image, the grip support for tagging test cases, and the projects feature for running the same test script in multiple browsers with multiple configurations. He briefly mentions the update to the Chromium browser and the addition of hard and soft assert options in the expect function for better test case control.

He recommends using the JavaScript or TypeScript versions of Playwright for the best experience, as the 1.20 release is currently only available for those languages. He concludes the video by discussing an issue with the Playwright test plugin in the VS Code editor, where some tests may not be displayed. He suggests searching for the specific test if it doesn't appear in the plugin. Finally, he reminds viewers to update their package.json file to include the latest version of Playwright (1.20).

Related Videos

#16 - ARIA and how Playwright is making use of it to identify UI controls?
#16 - ARIA and how Playwright is making use of it to identify UI controls?
Create feature, steps & config | Playwright & Cucumber - Typescript | Part 1
Create feature, steps & config | Playwright & Cucumber - Typescript | Part 1
Getting Started with Playwright and VS Code
Getting Started with Playwright and VS Code
Working with multiple elements in Playwright Test (NodeJS)
Working with multiple elements in Playwright Test (NodeJS)
TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.