PromucFlow_constructor/app/client/cypress_ci_custom.config.ts
Saroj 07dc6ee9ad
ci: Changes to enable rerun with custom script (#25480)
## Description
- Changes to enable rerun with custom script
#### Type of change
- Workflow file changes
## Testing
>
#### How Has This Been Tested?
 - Workflow run
## Checklist:
#### Dev activity
#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-07-19 17:02:24 +05:30

56 lines
1.6 KiB
TypeScript

import { defineConfig } from "cypress";
import fs from "fs";
export default defineConfig({
defaultCommandTimeout: 30000,
requestTimeout: 60000,
responseTimeout: 60000,
pageLoadTimeout: 60000,
videoUploadOnPasses: false,
numTestsKeptInMemory: 5,
experimentalMemoryManagement: true,
reporter: "cypress-mochawesome-reporter",
reporterOptions: {
reportDir: "results",
charts: true,
reportPageTitle: "Cypress-report",
videoOnFailOnly: true,
embeddedScreenshots: true,
inlineAssets: true,
saveAllAttempts: true,
},
chromeWebSecurity: false,
viewportHeight: 1100,
viewportWidth: 1400,
scrollBehavior: "center",
retries: {
runMode: 1,
openMode: 0,
},
e2e: {
baseUrl: "http://localhost/",
setupNodeEvents(on, config) {
require("cypress-mochawesome-reporter/plugin")(on);
on(
"after:spec",
(spec: Cypress.Spec, results: CypressCommandLine.RunResult) => {
if (results && results.video) {
// Do we have failures for any retry attempts?
const failures = results.tests.some((test) =>
test.attempts.some((attempt) => attempt.state === "failed"),
);
if (!failures) {
// delete the video if the spec passed and no tests retried
fs.unlinkSync(results.video);
}
}
},
);
return require("./cypress/plugins/index.js")(on, config);
},
specPattern: "cypress/e2e/**/*.{js,ts}",
testIsolation: false,
excludeSpecPattern: "cypress/e2e/**/spec_utility.ts",
},
});