Home > Blockchain >  How do you specify a test folder/path with Playwright?
How do you specify a test folder/path with Playwright?

Time:06-28

I want to be able to specify a folder where my tests live so that Playwright doesn't try to run tests from all folders. Is there a way to tell Playwright to only run tests from a specific folder?

CodePudding user response:

You can do this using the testDir config option. For example:

// playwright.config.ts
import { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
  testDir: './tests/playwright',
};

export default config;
  • Related