From d676c5fbd5720e633f149f2422690e1b3c96546a Mon Sep 17 00:00:00 2001 From: Pengoose Date: Wed, 2 Oct 2024 00:27:23 +0900 Subject: [PATCH] chore: add fail.only signature --- packages/playwright/types/test.d.ts | 776 ++++++++++++++-------------- 1 file changed, 391 insertions(+), 385 deletions(-) diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index a1128c519e..717a93c296 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -3549,391 +3549,397 @@ export interface TestType boolean, description?: string): void; - /** - * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful - * for documentation purposes to acknowledge that some functionality is broken until it is fixed. - * - * To declare a "failing" test: - * - `test.fail(title, body)` - * - `test.fail(title, details, body)` - * - * To annotate test as "failing" at runtime: - * - `test.fail(condition, description)` - * - `test.fail(callback, description)` - * - `test.fail()` - * - * **Usage** - * - * You can declare a test as failing, so that Playwright ensures it actually fails. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail('not yet ready', async ({ page }) => { - * // ... - * }); - * ``` - * - * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based - * on some condition. We recommend passing a `description` argument in this case. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test('fail in WebKit', async ({ page, browserName }) => { - * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet'); - * // ... - * }); - * ``` - * - * You can mark all tests in a file or - * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as - * "should fail" based on some condition with a single `test.fail(callback, description)` call. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet'); - * - * test('fail in WebKit 1', async ({ page }) => { - * // ... - * }); - * test('fail in WebKit 2', async ({ page }) => { - * // ... - * }); - * ``` - * - * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We - * recommend declaring a failing test with `test.fail(title, body)` instead. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test('less readable', async ({ page }) => { - * test.fail(); - * // ... - * }); - * ``` - * - * @param title Test title. - * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details - * description. - * @param body Test body that takes one or two arguments: an object with fixtures and optional - * [TestInfo](https://playwright.dev/docs/api/class-testinfo). - * @param condition Test is marked as "should fail" when the condition is `true`. - * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as - * "should fail" when the return value is `true`. - * @param description Optional description that will be reflected in a test report. - */ - fail(title: string, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; - /** - * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful - * for documentation purposes to acknowledge that some functionality is broken until it is fixed. - * - * To declare a "failing" test: - * - `test.fail(title, body)` - * - `test.fail(title, details, body)` - * - * To annotate test as "failing" at runtime: - * - `test.fail(condition, description)` - * - `test.fail(callback, description)` - * - `test.fail()` - * - * **Usage** - * - * You can declare a test as failing, so that Playwright ensures it actually fails. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail('not yet ready', async ({ page }) => { - * // ... - * }); - * ``` - * - * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based - * on some condition. We recommend passing a `description` argument in this case. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test('fail in WebKit', async ({ page, browserName }) => { - * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet'); - * // ... - * }); - * ``` - * - * You can mark all tests in a file or - * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as - * "should fail" based on some condition with a single `test.fail(callback, description)` call. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet'); - * - * test('fail in WebKit 1', async ({ page }) => { - * // ... - * }); - * test('fail in WebKit 2', async ({ page }) => { - * // ... - * }); - * ``` - * - * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We - * recommend declaring a failing test with `test.fail(title, body)` instead. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test('less readable', async ({ page }) => { - * test.fail(); - * // ... - * }); - * ``` - * - * @param title Test title. - * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details - * description. - * @param body Test body that takes one or two arguments: an object with fixtures and optional - * [TestInfo](https://playwright.dev/docs/api/class-testinfo). - * @param condition Test is marked as "should fail" when the condition is `true`. - * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as - * "should fail" when the return value is `true`. - * @param description Optional description that will be reflected in a test report. - */ - fail(title: string, details: TestDetails, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; - /** - * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful - * for documentation purposes to acknowledge that some functionality is broken until it is fixed. - * - * To declare a "failing" test: - * - `test.fail(title, body)` - * - `test.fail(title, details, body)` - * - * To annotate test as "failing" at runtime: - * - `test.fail(condition, description)` - * - `test.fail(callback, description)` - * - `test.fail()` - * - * **Usage** - * - * You can declare a test as failing, so that Playwright ensures it actually fails. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail('not yet ready', async ({ page }) => { - * // ... - * }); - * ``` - * - * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based - * on some condition. We recommend passing a `description` argument in this case. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test('fail in WebKit', async ({ page, browserName }) => { - * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet'); - * // ... - * }); - * ``` - * - * You can mark all tests in a file or - * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as - * "should fail" based on some condition with a single `test.fail(callback, description)` call. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet'); - * - * test('fail in WebKit 1', async ({ page }) => { - * // ... - * }); - * test('fail in WebKit 2', async ({ page }) => { - * // ... - * }); - * ``` - * - * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We - * recommend declaring a failing test with `test.fail(title, body)` instead. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test('less readable', async ({ page }) => { - * test.fail(); - * // ... - * }); - * ``` - * - * @param title Test title. - * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details - * description. - * @param body Test body that takes one or two arguments: an object with fixtures and optional - * [TestInfo](https://playwright.dev/docs/api/class-testinfo). - * @param condition Test is marked as "should fail" when the condition is `true`. - * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as - * "should fail" when the return value is `true`. - * @param description Optional description that will be reflected in a test report. - */ - fail(condition: boolean, description?: string): void; - /** - * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful - * for documentation purposes to acknowledge that some functionality is broken until it is fixed. - * - * To declare a "failing" test: - * - `test.fail(title, body)` - * - `test.fail(title, details, body)` - * - * To annotate test as "failing" at runtime: - * - `test.fail(condition, description)` - * - `test.fail(callback, description)` - * - `test.fail()` - * - * **Usage** - * - * You can declare a test as failing, so that Playwright ensures it actually fails. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail('not yet ready', async ({ page }) => { - * // ... - * }); - * ``` - * - * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based - * on some condition. We recommend passing a `description` argument in this case. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test('fail in WebKit', async ({ page, browserName }) => { - * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet'); - * // ... - * }); - * ``` - * - * You can mark all tests in a file or - * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as - * "should fail" based on some condition with a single `test.fail(callback, description)` call. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet'); - * - * test('fail in WebKit 1', async ({ page }) => { - * // ... - * }); - * test('fail in WebKit 2', async ({ page }) => { - * // ... - * }); - * ``` - * - * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We - * recommend declaring a failing test with `test.fail(title, body)` instead. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test('less readable', async ({ page }) => { - * test.fail(); - * // ... - * }); - * ``` - * - * @param title Test title. - * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details - * description. - * @param body Test body that takes one or two arguments: an object with fixtures and optional - * [TestInfo](https://playwright.dev/docs/api/class-testinfo). - * @param condition Test is marked as "should fail" when the condition is `true`. - * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as - * "should fail" when the return value is `true`. - * @param description Optional description that will be reflected in a test report. - */ - fail(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void; - /** - * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful - * for documentation purposes to acknowledge that some functionality is broken until it is fixed. - * - * To declare a "failing" test: - * - `test.fail(title, body)` - * - `test.fail(title, details, body)` - * - * To annotate test as "failing" at runtime: - * - `test.fail(condition, description)` - * - `test.fail(callback, description)` - * - `test.fail()` - * - * **Usage** - * - * You can declare a test as failing, so that Playwright ensures it actually fails. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail('not yet ready', async ({ page }) => { - * // ... - * }); - * ``` - * - * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based - * on some condition. We recommend passing a `description` argument in this case. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test('fail in WebKit', async ({ page, browserName }) => { - * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet'); - * // ... - * }); - * ``` - * - * You can mark all tests in a file or - * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as - * "should fail" based on some condition with a single `test.fail(callback, description)` call. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet'); - * - * test('fail in WebKit 1', async ({ page }) => { - * // ... - * }); - * test('fail in WebKit 2', async ({ page }) => { - * // ... - * }); - * ``` - * - * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We - * recommend declaring a failing test with `test.fail(title, body)` instead. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test('less readable', async ({ page }) => { - * test.fail(); - * // ... - * }); - * ``` - * - * @param title Test title. - * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details - * description. - * @param body Test body that takes one or two arguments: an object with fixtures and optional - * [TestInfo](https://playwright.dev/docs/api/class-testinfo). - * @param condition Test is marked as "should fail" when the condition is `true`. - * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as - * "should fail" when the return value is `true`. - * @param description Optional description that will be reflected in a test report. - */ - fail(): void; + fail: { + /** + * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful + * for documentation purposes to acknowledge that some functionality is broken until it is fixed. + * + * To declare a "failing" test: + * - `test.fail(title, body)` + * - `test.fail(title, details, body)` + * + * To annotate test as "failing" at runtime: + * - `test.fail(condition, description)` + * - `test.fail(callback, description)` + * - `test.fail()` + * + * **Usage** + * + * You can declare a test as failing, so that Playwright ensures it actually fails. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test.fail('not yet ready', async ({ page }) => { + * // ... + * }); + * ``` + * + * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based + * on some condition. We recommend passing a `description` argument in this case. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test('fail in WebKit', async ({ page, browserName }) => { + * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet'); + * // ... + * }); + * ``` + * + * You can mark all tests in a file or + * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as + * "should fail" based on some condition with a single `test.fail(callback, description)` call. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet'); + * + * test('fail in WebKit 1', async ({ page }) => { + * // ... + * }); + * test('fail in WebKit 2', async ({ page }) => { + * // ... + * }); + * ``` + * + * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We + * recommend declaring a failing test with `test.fail(title, body)` instead. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test('less readable', async ({ page }) => { + * test.fail(); + * // ... + * }); + * ``` + * + * @param title Test title. + * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details + * description. + * @param body Test body that takes one or two arguments: an object with fixtures and optional + * [TestInfo](https://playwright.dev/docs/api/class-testinfo). + * @param condition Test is marked as "should fail" when the condition is `true`. + * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as + * "should fail" when the return value is `true`. + * @param description Optional description that will be reflected in a test report. + */ + (title: string, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; + /** + * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful + * for documentation purposes to acknowledge that some functionality is broken until it is fixed. + * + * To declare a "failing" test: + * - `test.fail(title, body)` + * - `test.fail(title, details, body)` + * + * To annotate test as "failing" at runtime: + * - `test.fail(condition, description)` + * - `test.fail(callback, description)` + * - `test.fail()` + * + * **Usage** + * + * You can declare a test as failing, so that Playwright ensures it actually fails. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test.fail('not yet ready', async ({ page }) => { + * // ... + * }); + * ``` + * + * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based + * on some condition. We recommend passing a `description` argument in this case. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test('fail in WebKit', async ({ page, browserName }) => { + * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet'); + * // ... + * }); + * ``` + * + * You can mark all tests in a file or + * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as + * "should fail" based on some condition with a single `test.fail(callback, description)` call. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet'); + * + * test('fail in WebKit 1', async ({ page }) => { + * // ... + * }); + * test('fail in WebKit 2', async ({ page }) => { + * // ... + * }); + * ``` + * + * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We + * recommend declaring a failing test with `test.fail(title, body)` instead. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test('less readable', async ({ page }) => { + * test.fail(); + * // ... + * }); + * ``` + * + * @param title Test title. + * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details + * description. + * @param body Test body that takes one or two arguments: an object with fixtures and optional + * [TestInfo](https://playwright.dev/docs/api/class-testinfo). + * @param condition Test is marked as "should fail" when the condition is `true`. + * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as + * "should fail" when the return value is `true`. + * @param description Optional description that will be reflected in a test report. + */ + (title: string, details: TestDetails, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; + /** + * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful + * for documentation purposes to acknowledge that some functionality is broken until it is fixed. + * + * To declare a "failing" test: + * - `test.fail(title, body)` + * - `test.fail(title, details, body)` + * + * To annotate test as "failing" at runtime: + * - `test.fail(condition, description)` + * - `test.fail(callback, description)` + * - `test.fail()` + * + * **Usage** + * + * You can declare a test as failing, so that Playwright ensures it actually fails. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test.fail('not yet ready', async ({ page }) => { + * // ... + * }); + * ``` + * + * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based + * on some condition. We recommend passing a `description` argument in this case. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test('fail in WebKit', async ({ page, browserName }) => { + * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet'); + * // ... + * }); + * ``` + * + * You can mark all tests in a file or + * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as + * "should fail" based on some condition with a single `test.fail(callback, description)` call. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet'); + * + * test('fail in WebKit 1', async ({ page }) => { + * // ... + * }); + * test('fail in WebKit 2', async ({ page }) => { + * // ... + * }); + * ``` + * + * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We + * recommend declaring a failing test with `test.fail(title, body)` instead. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test('less readable', async ({ page }) => { + * test.fail(); + * // ... + * }); + * ``` + * + * @param title Test title. + * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details + * description. + * @param body Test body that takes one or two arguments: an object with fixtures and optional + * [TestInfo](https://playwright.dev/docs/api/class-testinfo). + * @param condition Test is marked as "should fail" when the condition is `true`. + * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as + * "should fail" when the return value is `true`. + * @param description Optional description that will be reflected in a test report. + */ + (condition: boolean, description?: string): void; + /** + * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful + * for documentation purposes to acknowledge that some functionality is broken until it is fixed. + * + * To declare a "failing" test: + * - `test.fail(title, body)` + * - `test.fail(title, details, body)` + * + * To annotate test as "failing" at runtime: + * - `test.fail(condition, description)` + * - `test.fail(callback, description)` + * - `test.fail()` + * + * **Usage** + * + * You can declare a test as failing, so that Playwright ensures it actually fails. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test.fail('not yet ready', async ({ page }) => { + * // ... + * }); + * ``` + * + * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based + * on some condition. We recommend passing a `description` argument in this case. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test('fail in WebKit', async ({ page, browserName }) => { + * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet'); + * // ... + * }); + * ``` + * + * You can mark all tests in a file or + * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as + * "should fail" based on some condition with a single `test.fail(callback, description)` call. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet'); + * + * test('fail in WebKit 1', async ({ page }) => { + * // ... + * }); + * test('fail in WebKit 2', async ({ page }) => { + * // ... + * }); + * ``` + * + * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We + * recommend declaring a failing test with `test.fail(title, body)` instead. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test('less readable', async ({ page }) => { + * test.fail(); + * // ... + * }); + * ``` + * + * @param title Test title. + * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details + * description. + * @param body Test body that takes one or two arguments: an object with fixtures and optional + * [TestInfo](https://playwright.dev/docs/api/class-testinfo). + * @param condition Test is marked as "should fail" when the condition is `true`. + * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as + * "should fail" when the return value is `true`. + * @param description Optional description that will be reflected in a test report. + */ + (callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void; + /** + * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful + * for documentation purposes to acknowledge that some functionality is broken until it is fixed. + * + * To declare a "failing" test: + * - `test.fail(title, body)` + * - `test.fail(title, details, body)` + * + * To annotate test as "failing" at runtime: + * - `test.fail(condition, description)` + * - `test.fail(callback, description)` + * - `test.fail()` + * + * **Usage** + * + * You can declare a test as failing, so that Playwright ensures it actually fails. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test.fail('not yet ready', async ({ page }) => { + * // ... + * }); + * ``` + * + * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based + * on some condition. We recommend passing a `description` argument in this case. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test('fail in WebKit', async ({ page, browserName }) => { + * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet'); + * // ... + * }); + * ``` + * + * You can mark all tests in a file or + * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as + * "should fail" based on some condition with a single `test.fail(callback, description)` call. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet'); + * + * test('fail in WebKit 1', async ({ page }) => { + * // ... + * }); + * test('fail in WebKit 2', async ({ page }) => { + * // ... + * }); + * ``` + * + * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We + * recommend declaring a failing test with `test.fail(title, body)` instead. + * + * ```js + * import { test, expect } from '@playwright/test'; + * + * test('less readable', async ({ page }) => { + * test.fail(); + * // ... + * }); + * ``` + * + * @param title Test title. + * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details + * description. + * @param body Test body that takes one or two arguments: an object with fixtures and optional + * [TestInfo](https://playwright.dev/docs/api/class-testinfo). + * @param condition Test is marked as "should fail" when the condition is `true`. + * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as + * "should fail" when the return value is `true`. + * @param description Optional description that will be reflected in a test report. + */ + (): void; + only: { + (title: string, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; + (title: string, details: TestDetails, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; + }; + } /** * Marks a test as "slow". Slow test will be given triple the default timeout. *