Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: address step.skip() API review comments (#34958)

Yury Semikhatsky4a79c214f03f
diff --git a/docs/src/test-api/class-test.md b/docs/src/test-api/class-test.md
index 9384ac61b9..eefaeb4246 100644
--- a/docs/src/test-api/class-test.md
+++ b/docs/src/test-api/class-test.md
@@ -1771,7 +1771,7 @@ Specifies a custom location for the step to be shown in test reports and trace v
* since: v1.50
- returns: <[void]>
-Mark a test step as "skip" to temporarily disable its execution, useful for steps that are currently failing and planned for a near-term fix. Playwright will not run the step.
+Mark a test step as "skip" to temporarily disable its execution, useful for steps that are currently failing and planned for a near-term fix. Playwright will not run the step. See also [`method: TestStepInfo.skip#2`].
We recommend [`method: TestStepInfo.skip#1`] instead.
diff --git a/docs/src/test-api/class-teststepinfo.md b/docs/src/test-api/class-teststepinfo.md
index f13632a776..e5467abff1 100644
--- a/docs/src/test-api/class-teststepinfo.md
+++ b/docs/src/test-api/class-teststepinfo.md
@@ -7,7 +7,7 @@
```js
import { test, expect } from '@playwright/test';
-test('basic test', async ({ page, browserName }, TestStepInfo) => {
+test('basic test', async ({ page, browserName }) => {
await test.step('check some behavior', async step => {
await step.skip(browserName === 'webkit', 'The feature is not available in WebKit');
// ... rest of the step code
@@ -102,7 +102,7 @@ test('my test', async ({ page }) => {
## method: TestStepInfo.skip#2
* since: v1.51
-Conditionally skip the currently running step with an optional description. Useful for steps that should not be executed in some cases.
+Conditionally abort the currently running step and mark it as skipped with an optional description. Useful for steps that should not be executed in some cases.
**Usage**
diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts
index 713c3c9871..739993e1b1 100644
--- a/packages/playwright/types/test.d.ts
+++ b/packages/playwright/types/test.d.ts
@@ -962,9 +962,9 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
/**
* - These settings control whether git information is captured and stored in the config
* [testConfig.metadata](https://playwright.dev/docs/api/class-testconfig#test-config-metadata).
- * - The structure of the git commit metadata is not documented and is a subject to change.
+ * - The structure of the git commit metadata is subject to change.
* - Default values for these settings depend on the environment. When tests run as a part of CI where it is safe to
- * obtain git information, the default value is true, false otherise.
+ * obtain git information, the default value is true, false otherwise.
*
* **Usage**
*
@@ -5824,7 +5824,8 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
<T>(title: string, body: (step: TestStepInfo) => T | Promise<T>, options?: { box?: boolean, location?: Location, timeout?: number }): Promise<T>;
/**
* Mark a test step as "skip" to temporarily disable its execution, useful for steps that are currently failing and
- * planned for a near-term fix. Playwright will not run the step.
+ * planned for a near-term fix. Playwright will not run the step. See also
+ * [testStepInfo.skip(condition[, description])](https://playwright.dev/docs/api/class-teststepinfo#test-step-info-skip-2).
*
* We recommend [testStepInfo.skip()](https://playwright.dev/docs/api/class-teststepinfo#test-step-info-skip-1)
* instead.
@@ -9587,7 +9588,7 @@ export interface TestInfoError {
* ```js
* import { test, expect } from '@playwright/test';
*
- * test('basic test', async ({ page, browserName }, TestStepInfo) => {
+ * test('basic test', async ({ page, browserName }) => {
* await test.step('check some behavior', async step => {
* await step.skip(browserName === 'webkit', 'The feature is not available in WebKit');
* // ... rest of the step code
@@ -9686,8 +9687,8 @@ export interface TestStepInfo {
skip(): void;
/**
- * Conditionally skip the currently running step with an optional description. Useful for steps that should not be
- * executed in some cases.
+ * Conditionally abort the currently running step and mark it as skipped with an optional description. Useful for
+ * steps that should not be executed in some cases.
*
* **Usage**
*