docs: update more step.skip() examples (#35052)
This commit is contained in:
parent
a3fafb60d4
commit
9e76b3695c
|
@ -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
|
||||
// ...
|
||||
});
|
||||
|
|
|
@ -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
|
||||
* // ...
|
||||
* });
|
||||
|
|
Loading…
Reference in New Issue