Skip to content

Commit 72622fe

Browse files
authored
cherry-pick(#35052): docs: update more step.skip() examples (#35055)
1 parent 9603226 commit 72622fe

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

Diff for: docs/src/test-api/class-teststepinfo.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ Abort the currently running step and mark it as skipped. Useful for steps that a
9090
import { test, expect } from '@playwright/test';
9191

9292
test('my test', async ({ page }) => {
93-
await test.step('check expectations', async () => {
94-
test.skip();
93+
await test.step('check expectations', async step => {
94+
step.skip();
9595
// step body below will not run
9696
// ...
9797
});
@@ -109,9 +109,8 @@ Conditionally abort the currently running step and mark it as skipped with an op
109109
import { test, expect } from '@playwright/test';
110110

111111
test('my test', async ({ page, isMobile }) => {
112-
await test.step('check desktop expectations', async () => {
113-
test.skip(isMobile, 'not present in the mobile layout');
114-
112+
await test.step('check desktop expectations', async step => {
113+
step.skip(isMobile, 'not present in the mobile layout');
115114
// step body below will not run
116115
// ...
117116
});

Diff for: packages/playwright/types/test.d.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -9674,8 +9674,8 @@ export interface TestStepInfo {
96749674
* import { test, expect } from '@playwright/test';
96759675
*
96769676
* test('my test', async ({ page }) => {
9677-
* await test.step('check expectations', async () => {
9678-
* test.skip();
9677+
* await test.step('check expectations', async step => {
9678+
* step.skip();
96799679
* // step body below will not run
96809680
* // ...
96819681
* });
@@ -9695,9 +9695,8 @@ export interface TestStepInfo {
96959695
* import { test, expect } from '@playwright/test';
96969696
*
96979697
* test('my test', async ({ page, isMobile }) => {
9698-
* await test.step('check desktop expectations', async () => {
9699-
* test.skip(isMobile, 'not present in the mobile layout');
9700-
*
9698+
* await test.step('check desktop expectations', async step => {
9699+
* step.skip(isMobile, 'not present in the mobile layout');
97019700
* // step body below will not run
97029701
* // ...
97039702
* });

0 commit comments

Comments
 (0)