最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do you specify a test folderpath with Playwright? - Stack Overflow

programmeradmin5浏览0评论

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?

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?

Share Improve this question asked Jun 24, 2022 at 23:23 CullyCully 6,9756 gold badges42 silver badges63 bronze badges 0
Add a ment  | 

1 Answer 1

Reset to default 3

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;

It's also possible to do this by providing a folder when running playwright from the mand line:

npx playwright test path/to/tests/playwright
发布评论

评论列表(0)

  1. 暂无评论