Rayrun
← Back to videos

Playwright Test Annotations (NodeJS)

Talking about some of the key annotations you can use within playwright test framework

The video features Jared from Commit Quality who gives a detailed guide on playwright test annotations. Playwright, he explains, provides test annotations to manage aspects such as failures, flaky tests, skipping tests, focusing on tests and running tests in parallel among other features.

Jared states that annotations can be used on a single test or a group of tests, and you can have more than one annotation at a time. Furthermore, these annotations can be conditional. For instance, the skip annotation can be used to omit certain tests during execution, conditional on certain factors such as the type of browser being used.

The speaker introduces an 'only' function, where tests that have the 'only' annotation will exclusively run. This can be used on a single test or a group of tests. The video illustrates how this works, and directions on how to examine the output of the tests are given.

Jared then explains the 'fail' annotation, which unconditionally marks a test as being expected to fail, even if it passes. This can help to highlight issues and bugs that need to be addressed. He also presents the 'slow' annotation, which extends the default timeout of a test threefold, therefore allowing extra time for poorly performing tests.

Finally, he explains parallelization, whereby tests can be run in parallel to save time. This can be applied at a describe block level, forcing all tests within the block to run in parallel. He concludes by encouraging viewers to explore the Playwright documentation for more comprehensive knowledge and offers help in the comments section.

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
Working with multiple elements in Playwright Test (NodeJS)
Working with multiple elements in Playwright Test (NodeJS)
Playwright Base URL | Playwright Tutorial - Part 39
Playwright Base URL | Playwright Tutorial - Part 39
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.