Skip to content

Commit 9bcdcd0

Browse files
author
Fúlvio Carvalhido
committed
Add test.step from @NiklasBack
1 parent c472dfa commit 9bcdcd0

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class XrayReporter implements Reporter {
7676
};
7777

7878
// Set Test Error
79-
if (result.errors.length > 0) {
79+
const pwStepsExists = result.steps.some(step => step.category.includes("test.step"));
80+
if (result.errors.length > 0 && !pwStepsExists) {
8081
xrayTestData.comment = JSON.stringify(result.errors);
8182
} else {
8283
await Promise.all(

tests/with-steps.test.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('TES-49 | test with playwright steps', async ({ page }) => {
4+
5+
await test.step('Step 1', async () => {
6+
expect(true).toBe(true);
7+
});
8+
9+
await test.step('Step 2', async () => {
10+
expect(true).toBe(true);
11+
});
12+
13+
await test.step('Step 3', async () => {
14+
expect(false).toBe(true);
15+
});
16+
});

0 commit comments

Comments
 (0)