Grouping and Organising Test Suite in Playwright

Ganesh Hegde
Geek Culture
Published in
2 min readAug 16, 2021


The Playwright doesn’t have some options like a test suite, If you are familiar with Protractor we had some options like a suite in the configuration file and it allowed us to execute tests with the --suite option in the command line.

How to Create Tests Suites like Smoke or Regression in Playwright?

The playwright provides multiple options to Organize and Group your tests

  1. Organize Playwright Tests in Folder
  2. Configure Playwright Test Suites

Organize Playwright Tests in Folder

This is a very simple option, you can create multiple folders and subfolders you can put the relevant tests accordingly

For Example, if you want to group your tests that are related to home page navigation simply create multiple spec files and put them in a single folder



Once you organize your tests inside the folder structure you can simply run all the tests together with the command

npx playwright tests tests/home/

The above command will execute all the tests inside your tests/home folder

Create Test Suite in Playwright

The above option is not suitable if you want to pick a set of tests from the different folders but with tagging, you can easily execute a group of tests like smoke, regression, etc.

Let’s take an example, if you want to create test suite smoke in playwright then you can add the tag @smoke in playwright tests like below.

test('Navigate to Google @smoke', async ({ page }) => {
//Some Code
test('Some test @smoke @regression', async ({ page }) => {
//Some code
test('Some test @smoke @regression @mysuite', async ({ page }) => {
//Some code

Considering the above example I have created multiple tests but I tagged the tests with different tags like smoke, regression, etc.

Now, If you want to execute only smoke tests simply use the below command

npx playright test --grep @smoke

The above command executes all the tests which you have tagged as @smoke in your playwright test script

Hope you enjoyed this article.


Buy me a Coffee

If you are looking for any help, support, guidance contact me on LinkedIn|