Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes in e2e-cypress #1086

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
- Mobile testing enablement adding Appium & Sauce Labs in e2e-spock-geb quickstarter ([#1083](https://github.com/opendevstack/ods-quickstarters/pull/1083))

### Added
Expand Down
1 change: 1 addition & 0 deletions e2e-cypress/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions e2e-cypress/files/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ declare global {
addContextPath(title: string, screenshot: string);
}
}
}
4 changes: 2 additions & 2 deletions e2e-cypress/files/support/test-evidence.ts
Original file line number Diff line number Diff line change
@@ -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 => {
Expand Down Expand Up @@ -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);
});
});
Expand Down
Loading