From cdba2fcc0c822a9bf10e9b638646682f6aeb22ed Mon Sep 17 00:00:00 2001 From: Dmitrii Gridnev Date: Wed, 28 Aug 2024 14:12:04 +0200 Subject: [PATCH] feature: exclude empty default steps Exclude `Before Hook` and `After Hook` from a result if they don't have children steps. --- qase-playwright/changelog.md | 6 ++++++ qase-playwright/package.json | 2 +- qase-playwright/src/reporter.ts | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/qase-playwright/changelog.md b/qase-playwright/changelog.md index 19618030..0010378c 100644 --- a/qase-playwright/changelog.md +++ b/qase-playwright/changelog.md @@ -1,3 +1,9 @@ +# playwright-qase-reporter@2.0.12 + +## What's new + +Exclude `Before Hook` and `After Hook` if they don't have children steps. + # playwright-qase-reporter@2.0.11 ## What's new diff --git a/qase-playwright/package.json b/qase-playwright/package.json index 7f33ce17..8987720d 100644 --- a/qase-playwright/package.json +++ b/qase-playwright/package.json @@ -1,6 +1,6 @@ { "name": "playwright-qase-reporter", - "version": "2.0.11", + "version": "2.0.12", "description": "Qase TMS Playwright Reporter", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/qase-playwright/src/reporter.ts b/qase-playwright/src/reporter.ts index c2a4e40a..eb9e8e3b 100644 --- a/qase-playwright/src/reporter.ts +++ b/qase-playwright/src/reporter.ts @@ -256,6 +256,10 @@ export class PlaywrightQaseReporter implements Reporter { continue; } + if ((testStep.title === 'Before Hooks' || testStep.title === 'After Hooks') && testStep.steps.length === 0) { + continue; + } + const attachments = this.stepAttachments.get(testStep); const id = uuidv4();