From b9804c6688fdc619da754864dab6ebef690d510d Mon Sep 17 00:00:00 2001 From: Yi Cai Date: Thu, 12 Oct 2023 17:06:51 -0400 Subject: [PATCH] Updated cypress config for the upgrade Signed-off-by: Yi Cai --- .../gitops-plugin/integration-tests/README.md | 6 +-- .../integration-tests/cypress.config.js | 51 +++++++++++++++++++ .../integration-tests/cypress.json | 29 ----------- .../features/BestPractices.md | 2 +- 4 files changed, 55 insertions(+), 33 deletions(-) create mode 100644 frontend/packages/gitops-plugin/integration-tests/cypress.config.js delete mode 100644 frontend/packages/gitops-plugin/integration-tests/cypress.json diff --git a/frontend/packages/gitops-plugin/integration-tests/README.md b/frontend/packages/gitops-plugin/integration-tests/README.md index 23d31edc299..0493f162d28 100644 --- a/frontend/packages/gitops-plugin/integration-tests/README.md +++ b/frontend/packages/gitops-plugin/integration-tests/README.md @@ -1,6 +1,6 @@ # Getting Started -- Guidelines related to Setup, Standards, Review process are present in [README.md](frontend/packages/dev-console/integration-tests/README.md) +- Guidelines related to Setup, Standards, Review process are present in [README.md](../../dev-console/integration-tests/README.md) ## Directory Structure @@ -31,7 +31,7 @@ frontend/packages/gitops-plugin/integration-tests/ | | | └──common.ts ├── testData <--- Test data required for scripts and installation yaml files | ├── install-gitops-operator.yaml <--- GitOps installation yaml file -├── cypress.json <--- cypress configuration file +├── cypress.config.js <--- cypress configuration file ├── tsconfig.json <--- typescript configuration file ├── reporter-config.json <--- reporter configuration file ``` @@ -40,7 +40,7 @@ frontend/packages/gitops-plugin/integration-tests/ Feature file - "regression" suite - execution from Cypress Dashboard -1. Update the TAGS under env section in config file [Cypress.json file](frontend/packages/gitops-plugin/integration-tests/cypress.json) as +1. Update the TAGS under env section in config file [Cypress.config.js file](frontend/packages/gitops-plugin/integration-tests/cypress.config.js) as "env": { "TAGS": "@regression and not @manual and not @to-do" } 2. In command prompt, navigate to frontend folder 3. Execute command `yarn run test-cypress-gitops` and select that particular file or run all files in cypress dashboard diff --git a/frontend/packages/gitops-plugin/integration-tests/cypress.config.js b/frontend/packages/gitops-plugin/integration-tests/cypress.config.js new file mode 100644 index 00000000000..eba5be482ed --- /dev/null +++ b/frontend/packages/gitops-plugin/integration-tests/cypress.config.js @@ -0,0 +1,51 @@ +const { defineConfig } = require("cypress"); + +module.exports = defineConfig({ + projectId: "j4jxoy", + viewportWidth: 1920, + viewportHeight: 1080, + defaultCommandTimeout: 40000, + execTimeout: 90000, + pageLoadTimeout: 90000, + requestTimeout: 15000, + responseTimeout: 15000, + animationDistanceThreshold: 20, + screenshotsFolder: "../../../gui_test_screenshots/cypress/screenshots", + videosFolder: "../../../gui_test_screenshots/cypress/videos", + video: true, + reporter: "../../node_modules/cypress-multi-reporters", + + reporterOptions: { + configFile: "reporter-config.json", + }, + + fixturesFolder: "testData", + defaultCommandTimeout: 40000, + + retries: { + runMode: 1, + openMode: 0, + }, + + env: { + TAGS: "@gitOps and @smoke and not (@manual or @to-do or @un-verified)", + NAMESPACE: "aut-gitops", + }, + + e2e: { + // TODO: see https://issues.redhat.com/browse/CONSOLE-3781 + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + setupNodeEvents(on, config) { + // eslint-disable-next-line global-require + return require("../../dev-console/integration-tests/plugins/index.js")( + on, + config + ); + }, + specPattern: "**/*.{feature,features}", + supportFile: "support/commands/index.ts", + baseUrl: "http://localhost:9000", + testIsolation: false, + }, +}); diff --git a/frontend/packages/gitops-plugin/integration-tests/cypress.json b/frontend/packages/gitops-plugin/integration-tests/cypress.json deleted file mode 100644 index c1413c13478..00000000000 --- a/frontend/packages/gitops-plugin/integration-tests/cypress.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "integrationFolder": "features", - "testFiles": "**/*.{feature,features}", - "defaultCommandTimeout": 40000, - "viewportWidth": 1920, - "viewportHeight": 1080, - "animationDistanceThreshold": 20, - "execTimeout": 90000, - "pageLoadTimeout": 90000, - "requestTimeout": 15000, - "responseTimeout": 15000, - "supportFile": "support/commands/index.ts", - "pluginsFile": "../../dev-console/integration-tests/plugins/index.js", - "fixturesFolder": "testData", - "reporter": "../../../node_modules/cypress-multi-reporters", - "reporterOptions": { - "configFile": "reporter-config.json" - }, - "screenshotsFolder": "../../../gui_test_screenshots/cypress/screenshots", - "videosFolder": "../../../gui_test_screenshots/cypress/videos", - "env": { - "TAGS": "@gitOps and @smoke and not (@manual or @to-do or @un-verified)", - "NAMESPACE": "aut-gitops" - }, - "retries": { - "runMode": 1, - "openMode": 0 - } -} diff --git a/frontend/packages/gitops-plugin/integration-tests/features/BestPractices.md b/frontend/packages/gitops-plugin/integration-tests/features/BestPractices.md index 4d21826a3c7..0f626e8ecfd 100644 --- a/frontend/packages/gitops-plugin/integration-tests/features/BestPractices.md +++ b/frontend/packages/gitops-plugin/integration-tests/features/BestPractices.md @@ -1,3 +1,3 @@ # Gherkin Scenarios designing Best Practices -Follow the rules present in [BestPractices.md](frontend/packages/dev-console/integration-tests/features/BestPractices.md) \ No newline at end of file +Follow the rules present in [BestPractices.md](../../../dev-console/integration-tests/features/BestPractices.md) \ No newline at end of file