From bd3f2d5cc5b3d8c83c14787330e1342c95f10ace Mon Sep 17 00:00:00 2001 From: pengoosedev <73521518+pengoosedev@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:53:31 +0900 Subject: [PATCH] chore: remove unused signature(fail.only) --- packages/playwright/types/test.d.ts | 248 +---------------------- utils/generate_types/overrides-test.d.ts | 7 +- 2 files changed, 2 insertions(+), 253 deletions(-) diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 9ab9ae1612..13b380e622 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -4019,10 +4019,6 @@ export interface TestType browserName === 'webkit', 'not implemented yet'); - * - * test('fail in WebKit 1', async ({ page }) => { - * // This test will not run - * }); - * test('fail in WebKit 2', async ({ page }) => { - * // This test will not run - * }); - * ``` - * * @param title Test title. * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) 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" and focused when the condition is `true`. - * @param callback A function that returns whether to mark as "should fail" and focused, based on test fixtures. Test or tests are - * marked as "should fail" and focused when the return value is `true`. - * @param description Optional description that will be reflected in a test report. */ - only: { - /** - * You can use `test.fail.only` to focus on a specific test that is expected to fail. This is particularly useful when - * debugging a failing test or working on a specific issue. - * - * To declare a focused "failing" test: - * - `test.fail.only(title, body)` - * - `test.fail.only(title, details, body)` - * - * To conditionally focus a "failing" test: - * - `test.fail.only(condition, description)` - * - `test.fail.only(callback, description)` - * - * **Usage** - * - * You can declare a focused failing test, so that Playwright runs only this test and ensures it actually fails. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail.only('focused failing test', async ({ page }) => { - * // This test is expected to fail - * }); - * test('not in the focused group', async ({ page }) => { - * // This test will not run - * }); - * ``` - * - * You can mark all tests within a file or - * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as - * focused "should fail" based on some condition with a single `test.fail.only(callback, description)` call. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail.only(({ browserName }) => browserName === 'webkit', 'not implemented yet'); - * - * test('fail in WebKit 1', async ({ page }) => { - * // This test will not run - * }); - * test('fail in WebKit 2', async ({ page }) => { - * // This test will not run - * }); - * ``` - * - * @param title Test title. - * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) 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" and focused when the condition is `true`. - * @param callback A function that returns whether to mark as "should fail" and focused, based on test fixtures. Test or tests are - * marked as "should fail" and focused 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; - /** - * You can use `test.fail.only` to focus on a specific test that is expected to fail. This is particularly useful when - * debugging a failing test or working on a specific issue. - * - * To declare a focused "failing" test: - * - `test.fail.only(title, body)` - * - `test.fail.only(title, details, body)` - * - * To conditionally focus a "failing" test: - * - `test.fail.only(condition, description)` - * - `test.fail.only(callback, description)` - * - * **Usage** - * - * You can declare a focused failing test, so that Playwright runs only this test and ensures it actually fails. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail.only('focused failing test', async ({ page }) => { - * // This test is expected to fail - * }); - * test('not in the focused group', async ({ page }) => { - * // This test will not run - * }); - * ``` - * - * You can mark all tests within a file or - * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as - * focused "should fail" based on some condition with a single `test.fail.only(callback, description)` call. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail.only(({ browserName }) => browserName === 'webkit', 'not implemented yet'); - * - * test('fail in WebKit 1', async ({ page }) => { - * // This test will not run - * }); - * test('fail in WebKit 2', async ({ page }) => { - * // This test will not run - * }); - * ``` - * - * @param title Test title. - * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) 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" and focused when the condition is `true`. - * @param callback A function that returns whether to mark as "should fail" and focused, based on test fixtures. Test or tests are - * marked as "should fail" and focused 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; - /** - * You can use `test.fail.only` to focus on a specific test that is expected to fail. This is particularly useful when - * debugging a failing test or working on a specific issue. - * - * To declare a focused "failing" test: - * - `test.fail.only(title, body)` - * - `test.fail.only(title, details, body)` - * - * To conditionally focus a "failing" test: - * - `test.fail.only(condition, description)` - * - `test.fail.only(callback, description)` - * - * **Usage** - * - * You can declare a focused failing test, so that Playwright runs only this test and ensures it actually fails. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail.only('focused failing test', async ({ page }) => { - * // This test is expected to fail - * }); - * test('not in the focused group', async ({ page }) => { - * // This test will not run - * }); - * ``` - * - * You can mark all tests within a file or - * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as - * focused "should fail" based on some condition with a single `test.fail.only(callback, description)` call. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail.only(({ browserName }) => browserName === 'webkit', 'not implemented yet'); - * - * test('fail in WebKit 1', async ({ page }) => { - * // This test will not run - * }); - * test('fail in WebKit 2', async ({ page }) => { - * // This test will not run - * }); - * ``` - * - * @param title Test title. - * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) 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" and focused when the condition is `true`. - * @param callback A function that returns whether to mark as "should fail" and focused, based on test fixtures. Test or tests are - * marked as "should fail" and focused when the return value is `true`. - * @param description Optional description that will be reflected in a test report. - */ - (condition: boolean, description?: string): void; - /** - * You can use `test.fail.only` to focus on a specific test that is expected to fail. This is particularly useful when - * debugging a failing test or working on a specific issue. - * - * To declare a focused "failing" test: - * - `test.fail.only(title, body)` - * - `test.fail.only(title, details, body)` - * - * To conditionally focus a "failing" test: - * - `test.fail.only(condition, description)` - * - `test.fail.only(callback, description)` - * - * **Usage** - * - * You can declare a focused failing test, so that Playwright runs only this test and ensures it actually fails. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail.only('focused failing test', async ({ page }) => { - * // This test is expected to fail - * }); - * test('not in the focused group', async ({ page }) => { - * // This test will not run - * }); - * ``` - * - * You can mark all tests within a file or - * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as - * focused "should fail" based on some condition with a single `test.fail.only(callback, description)` call. - * - * ```js - * import { test, expect } from '@playwright/test'; - * - * test.fail.only(({ browserName }) => browserName === 'webkit', 'not implemented yet'); - * - * test('fail in WebKit 1', async ({ page }) => { - * // This test will not run - * }); - * test('fail in WebKit 2', async ({ page }) => { - * // This test will not run - * }); - * ``` - * - * @param title Test title. - * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) 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" and focused when the condition is `true`. - * @param callback A function that returns whether to mark as "should fail" and focused, based on test fixtures. Test or tests are - * marked as "should fail" and focused 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; - } + only: TestFunction; } /** * Marks a test as "slow". Slow test will be given triple the default timeout. diff --git a/utils/generate_types/overrides-test.d.ts b/utils/generate_types/overrides-test.d.ts index 12dca025b0..54fffb5345 100644 --- a/utils/generate_types/overrides-test.d.ts +++ b/utils/generate_types/overrides-test.d.ts @@ -116,12 +116,7 @@ export interface TestType boolean, description?: string): void; (): 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; - (condition: boolean, description?: string): void; - (callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void; - } + only: TestFunction; } slow(): void; slow(condition: boolean, description?: string): void;