diff --git a/README.md b/README.md index d2765b2..1302744 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ The full list of available options presented below. | includeTestSteps | Optional | false | Allows you to see the test steps at the log level. | | includePlaywrightProjectNameToCodeReference | Optional | false | Includes Playwright project name to code reference. See [`testCaseId and codeRef calculation`](#setTestCaseId). It may be useful when you want to see the different history for the same test cases within different playwright projects. | | extendTestDescriptionWithLastError | Optional | true | If set to `true` the latest error log will be attached to the test case description. | +| skipProjectInSuiteStructure | Optional | false | If set to `true` the Playwright 'project' level (like 'chromium') is excluded from ReportPortal Suite structure. Eliminates extra folding. | | uploadVideo | Optional | true | Whether to attach the Playwright's [video](https://playwright.dev/docs/api/class-testoptions#test-options-video) to the test case. | | uploadTrace | Optional | true | Whether to attach the Playwright's [trace](https://playwright.dev/docs/api/class-testoptions#test-options-trace) to the test case. | | token | Deprecated | Not set | Use `apiKey` instead. | diff --git a/src/models/configs.ts b/src/models/configs.ts index 7c7066a..29c2a3e 100644 --- a/src/models/configs.ts +++ b/src/models/configs.ts @@ -50,6 +50,7 @@ export interface ReportPortalConfig extends ClientConfig, AttachmentsConfig { rerun?: boolean; rerunOf?: string; mode?: LAUNCH_MODES; + skipProjectInSuiteStructure?: boolean? // agent specific options skippedIssue?: boolean; diff --git a/src/reporter.ts b/src/reporter.ts index f3de1ee..58ad0a9 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -289,7 +289,13 @@ export class RPReporter implements Reporter { } createSuitesOrder(suite: PWSuite, suitesOrder: PWSuite[]): void { - if (!suite?.title) { + const { skipProjectInSuiteStructure } = this.config + const shouldSkipProjectNameInReportStructure = + skipProjectInSuiteStructure || + !!process.env.EXCLUDE_PROJECT_FROM_STRUCTURE + ? !suite?.location + : false; + if (!suite?.title || shouldSkipProjectNameInReportStructure ) { return; } suitesOrder.push(suite);