From b8435e452d1bff9aaf5dbbf99735af1600683cf6 Mon Sep 17 00:00:00 2001 From: Roi Carrera Date: Wed, 18 Dec 2024 08:37:44 +0100 Subject: [PATCH 1/2] fixed typo fixed missing dependency fixed reportDir retrieve --- e2e-cypress/files/package.json | 1 + e2e-cypress/files/support/commands.ts | 1 + e2e-cypress/files/support/test-evidence.ts | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/e2e-cypress/files/package.json b/e2e-cypress/files/package.json index 9eca70a2..d6e10254 100644 --- a/e2e-cypress/files/package.json +++ b/e2e-cypress/files/package.json @@ -27,6 +27,7 @@ "cypress-multi-reporters": "^1.6.4", "junit-report-merger": "^7.0.0", "mocha-junit-reporter": "^2.2.1", + "mochawesome": "^7.1.3", "npm-run-all": "^4.1.5", "otplib": "^12.0.1", "puppeteer": "^23.5.1", diff --git a/e2e-cypress/files/support/commands.ts b/e2e-cypress/files/support/commands.ts index b85f54cd..7ee0c891 100644 --- a/e2e-cypress/files/support/commands.ts +++ b/e2e-cypress/files/support/commands.ts @@ -26,3 +26,4 @@ declare global { addContextPath(title: string, screenshot: string); } } +} diff --git a/e2e-cypress/files/support/test-evidence.ts b/e2e-cypress/files/support/test-evidence.ts index ceb38559..49ce678c 100644 --- a/e2e-cypress/files/support/test-evidence.ts +++ b/e2e-cypress/files/support/test-evidence.ts @@ -1,7 +1,6 @@ import * as path from 'path'; import { isScreenshotEvidenceResult, ScreenshotEvidenceData } from "../plugins/screenshot.types"; import { consoleLogs } from "./e2e"; -import baseConfig from './cypress.config'; const logEvidence = (name: string, step: number, description: string, evidenceLogs: string[]) => { cy.url().then(url => { @@ -68,7 +67,8 @@ export const takeScreenshotEvidence = (testName: string, testStep: number, testS ]); // Create a relative path from the screenshots folder to the mochawesome test-results folder - const relativePath = path.relative(baseConfig.reporterOptions.mochawesomeReporterOptions.reportDir, result.path.replace(/^.*(build.*)$/, '$1')); + const reportDir = Cypress.config('reporterOptions').mochawesomeReporterOptions.reportDir; + const relativePath = path.relative(reportDir, result.path.replace(/^.*(build.*)$/, '$1')); cy.addContextPath(`${testName} ${testStep} ${testSubStep}`, relativePath); }); }); From 3fb48395acd7ce5b3fd11199cc50120249a9815b Mon Sep 17 00:00:00 2001 From: Roi Carrera Date: Wed, 18 Dec 2024 08:41:13 +0100 Subject: [PATCH 2/2] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c252739a..304b1d41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - Removal of deprecated versions ([#1068](https://github.com/opendevstack/ods-quickstarters/issues/1068)) - Generate PDF report for cypress and improved environment management ([#1079](https://github.com/opendevstack/ods-quickstarters/pull/1079)) - Change PDF report zip file name in Cypress Quickstarter ([#1082](https://github.com/opendevstack/ods-quickstarters/pull/1082)) +- Included small fixes in e2e-cypress ([#1086](https://github.com/opendevstack/ods-quickstarters/pull/1086)) ### Added