Rayrun
← Back to videos

Playwright - Set timeout, parallelisation and retries directly in your test files

Some new additions have been made to the latest version of playwright test

In the video tutorial, we dive into a feature of the describe annotation in Playwright - the configure method. Playwright facilitates various configurations for setting up tests, which are demonstrated using well-explained examples in the tutorial.

To begin with, we explore a test file in the code editor, featuring a single test scoped at the top level and a test scoped within a describe block. Then, we observe the impact of different configurations on the execution of these tests.

Notably, various aspects of the configuration can be controlled. For instance, the execution mode can be set to parallel or serial. Tests can also be retried multiple times or not retried at all, and the timeout duration can also be adjusted.

Next, we experiment with these configurations, starting with setting parallel execution, a retry value of one, and a timeout of 3000 milliseconds. After running the tests, it's noted that they are running in two separate workers due to the parallel mode being set, while the retries and timeouts also occur as configured.

The next piece of the video involves setting different configuration parameters for the tests inside the top level and the 'describe' block. It's shown that the configurations are respected in their respective scopes without affecting each other.

Finally, the video demonstrates that the configuration settings affect only the specific files in which they are set. We verify this by creating a duplicate of our test file without any configuration settings and noticing that the default values are used when the tests in this file are run.

In conclusion, the configure method provided by Playwright is a powerful way to manage the settings for your test scenarios, whether they are broad end-to-end tests or narrow, atomic tests.

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?
How to Code a Test Automation on Youtube | Playwright JS
How to Code a Test Automation on Youtube | Playwright JS
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)
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 [email protected].