Skip to content

Commit

Permalink
fix: improve excluding default steps, like Worker Cleanup, `Before …
Browse files Browse the repository at this point in the history
…Hook`, and `After Hook`.
  • Loading branch information
gibiw committed Oct 24, 2024
1 parent c50e77f commit 0588be9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
6 changes: 6 additions & 0 deletions qase-playwright/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# playwright-qase-reporter@2.0.16

## What's new

Improve excluding default steps, like `Worker Cleanup`, `Before Hook`, and `After Hook`.

# playwright-qase-reporter@2.0.15

## What's new
Expand Down
2 changes: 1 addition & 1 deletion qase-playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "playwright-qase-reporter",
"version": "2.0.15",
"version": "2.0.16",
"description": "Qase TMS Playwright Reporter",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
22 changes: 21 additions & 1 deletion qase-playwright/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export class PlaywrightQaseReporter implements Reporter {
continue;
}

if (defaultSteps.includes(testStep.title) && testStep.steps.length === 0) {
if (defaultSteps.includes(testStep.title) && this.checkChildrenSteps(testStep.steps)) {
continue;
}

Expand Down Expand Up @@ -510,4 +510,24 @@ export class PlaywrightQaseReporter implements Reporter {

return ids;
}

/**
* @param {TestStep[]} steps
* @returns {boolean}
* @private
*/
private checkChildrenSteps(steps: TestStep[]): boolean {
if (steps.length === 0) {
return true;
}

for (const step of steps) {
if (step.category === 'test.step' || step.category === 'hook') {
return false;
}
}

return true;
}

}

0 comments on commit 0588be9

Please sign in to comment.