2023-07-19 06:42:36 +00:00
|
|
|
import { defineConfig } from "cypress";
|
|
|
|
|
import fs from "fs";
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
defaultCommandTimeout: 30000,
|
|
|
|
|
requestTimeout: 60000,
|
|
|
|
|
responseTimeout: 60000,
|
|
|
|
|
pageLoadTimeout: 60000,
|
2023-08-30 13:55:50 +00:00
|
|
|
videoUploadOnPasses: false,
|
2023-07-19 06:42:36 +00:00
|
|
|
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,
|
2023-09-02 05:59:08 +00:00
|
|
|
viewportHeight: 1200,
|
2023-07-19 06:42:36 +00:00
|
|
|
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,
|
2023-09-02 05:59:08 +00:00
|
|
|
excludeSpecPattern: [
|
|
|
|
|
"cypress/e2e/**/spec_utility.ts",
|
|
|
|
|
"cypress/e2e/GSheet/**/**/*",
|
|
|
|
|
"cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts",
|
2023-09-04 05:27:15 +00:00
|
|
|
"cypress/e2e/EE/Enterprise/MultipleEnv/ME_airtable_spec.ts",
|
2023-09-12 12:03:51 +00:00
|
|
|
"cypress/e2e/Regression/ServerSide/Datasources/ElasticSearch_Basic_Spec.ts",
|
2023-09-13 17:03:14 +00:00
|
|
|
"cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts",
|
2023-09-02 05:59:08 +00:00
|
|
|
],
|
2023-07-19 06:42:36 +00:00
|
|
|
},
|
|
|
|
|
});
|