diff --git a/docs/src/test-api/class-testconfig.md b/docs/src/test-api/class-testconfig.md index 8503c212f5..39830f6945 100644 --- a/docs/src/test-api/class-testconfig.md +++ b/docs/src/test-api/class-testconfig.md @@ -173,9 +173,17 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ filter: test => test.title === 'some test', - // or +}); +``` +Or... +```js +export default defineConfig({ filter: { filterTests: tests => tests.filter((test, index) => index % 2 === 0) }, - // or +}); +``` +Or... +```js +export default defineConfig({ filter: { filterTestGroups: testgroups => testgroups.filter((testgroups, index) => index % 2 === 0) }, }); ``` diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 917a5e6fde..f53db33adc 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -1048,9 +1048,21 @@ interface TestConfig { * * export default defineConfig({ * filter: test => test.title === 'some test', - * // or + * }); + * ``` + * + * Or... + * + * ```js + * export default defineConfig({ * filter: { filterTests: tests => tests.filter((test, index) => index % 2 === 0) }, - * // or + * }); + * ``` + * + * Or... + * + * ```js + * export default defineConfig({ * filter: { filterTestGroups: testgroups => testgroups.filter((testgroups, index) => index % 2 === 0) }, * }); * ```