6

A have multiple test files into specific folder with extension spec.ts, how I can run particular file with Playwright. Currently for configuration is set as test folder and will run all files (tests) from it:

testDir: './smokeTests',

Assume that is some option in the config file, but which one that the question

Gaj Julije
  • 1,538
  • 15
  • 32

1 Answers1

8

Use testMatch in config:

testMatch:['sampleTest.spec.ts']

https://playwright.dev/docs/api/class-testconfig#test-config-test-match

senaid
  • 534
  • 2
  • 8
  • 10
    Also, if you want to run it outside of your config and as part of your terminal command line you can use `npx playwright test sampleTest.spec.ts` – Cathal Mac Donnacha Dec 25 '21 at 00:35