docs: update more step.skip() examples (#35052)

This commit is contained in:
Yury Semikhatsky 2025-03-05 08:38:05 -08:00 committed by GitHub
parent a3fafb60d4
commit 9e76b3695c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 10 deletions

View File

@ -90,8 +90,8 @@ Abort the currently running step and mark it as skipped. Useful for steps that a
import { test, expect } from '@playwright/test';
test('my test', async ({ page }) => {
await test.step('check expectations', async () => {
test.skip();
await test.step('check expectations', async step => {
step.skip();
// step body below will not run
// ...
});
@ -109,9 +109,8 @@ Conditionally abort the currently running step and mark it as skipped with an op
import { test, expect } from '@playwright/test';
test('my test', async ({ page, isMobile }) => {
await test.step('check desktop expectations', async () => {
test.skip(isMobile, 'not present in the mobile layout');
await test.step('check desktop expectations', async step => {
step.skip(isMobile, 'not present in the mobile layout');
// step body below will not run
// ...
});

View File

@ -9674,8 +9674,8 @@ export interface TestStepInfo {
* import { test, expect } from '@playwright/test';
*
* test('my test', async ({ page }) => {
* await test.step('check expectations', async () => {
* test.skip();
* await test.step('check expectations', async step => {
* step.skip();
* // step body below will not run
* // ...
* });
@ -9695,9 +9695,8 @@ export interface TestStepInfo {
* import { test, expect } from '@playwright/test';
*
* test('my test', async ({ page, isMobile }) => {
* await test.step('check desktop expectations', async () => {
* test.skip(isMobile, 'not present in the mobile layout');
*
* await test.step('check desktop expectations', async step => {
* step.skip(isMobile, 'not present in the mobile layout');
* // step body below will not run
* // ...
* });