From a776843d0b2c4d1d9ed6a29342d5f05ef0f9960a Mon Sep 17 00:00:00 2001 From: Jason Luong Date: Mon, 16 Oct 2023 12:20:51 +0100 Subject: [PATCH] chore: update cypress to v13 --- .github/workflows/smoke_tests.yaml | 6 +++--- test/smoke/cypress.config.js | 12 ++++++++++++ test/smoke/cypress.json | 3 --- .../cypress-test.spec.js => e2e/cypress-test.cy.js} | 13 +++++++------ 4 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 test/smoke/cypress.config.js delete mode 100644 test/smoke/cypress.json rename test/smoke/cypress/{integration/cypress-test.spec.js => e2e/cypress-test.cy.js} (91%) diff --git a/.github/workflows/smoke_tests.yaml b/.github/workflows/smoke_tests.yaml index 9529f95..280bcd5 100644 --- a/.github/workflows/smoke_tests.yaml +++ b/.github/workflows/smoke_tests.yaml @@ -63,7 +63,7 @@ jobs: export NEXUS_PASS=$(cat /tmp/password) echo $NEXUS_PASS cat /tmp/password - cypress run --headless --browser chrome + cypress run env: TEST_SNYK_TOKEN: ${{ secrets.TEST_SNYK_TOKEN }} TEST_SNYK_ORG: ${{ secrets.TEST_SNYK_ORG }} @@ -83,14 +83,14 @@ jobs: if: always() with: name: screenshots - path: /home/runner/work/nexus-snyk-security-plugin/nexus-snyk-security-plugin/test/smoke/cypress/screenshots/cypress-test.spec.js/ + path: /home/runner/work/nexus-snyk-security-plugin/nexus-snyk-security-plugin/test/smoke/cypress/screenshots/cypress-test.cy.js/test retention-days: 1 - uses: actions/upload-artifact@v2 if: always() with: name: video - path: /home/runner/work/nexus-snyk-security-plugin/nexus-snyk-security-plugin/test/smoke/cypress/videos/cypress-test.spec.js.mp4 + path: /home/runner/work/nexus-snyk-security-plugin/nexus-snyk-security-plugin/test/smoke/cypress/videos/cypress-test.cy.js.mp4 retention-days: 1 - name: Save docker logs to file diff --git a/test/smoke/cypress.config.js b/test/smoke/cypress.config.js new file mode 100644 index 0000000..e772ceb --- /dev/null +++ b/test/smoke/cypress.config.js @@ -0,0 +1,12 @@ +module.exports = { + defaultCommandTimeout: 20000, + e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + setupNodeEvents(on, config) { + return require('./cypress/plugins/index.js')(on, config); + }, + supportFile: false, + video: true, + }, +}; diff --git a/test/smoke/cypress.json b/test/smoke/cypress.json deleted file mode 100644 index f1f0f50..0000000 --- a/test/smoke/cypress.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "defaultCommandTimeout": 10000 -} diff --git a/test/smoke/cypress/integration/cypress-test.spec.js b/test/smoke/cypress/e2e/cypress-test.cy.js similarity index 91% rename from test/smoke/cypress/integration/cypress-test.spec.js rename to test/smoke/cypress/e2e/cypress-test.cy.js index fdd7873..6eabdf0 100644 --- a/test/smoke/cypress/integration/cypress-test.spec.js +++ b/test/smoke/cypress/e2e/cypress-test.cy.js @@ -26,7 +26,8 @@ describe("test", () => { cy.log("in the diaglog callback"); if ($dialog.find("a").length) { cy.log("found the Next button"); - cy.wrap($dialog).should("be.visible").contains("Next").click(); + // cy.wrap($dialog).should("be.visible").contains("Next").click(); + cy.contains("Next").click(); cy.log("clicked the Next button"); // Set new password @@ -56,11 +57,11 @@ describe("test", () => { cy.log("found an anonymous access radio button"); cy.wrap($anonymous).get('div[role="radiogroup"] input').check(); cy.log("checked the first anonymous access radio buttong"); - cy.contains( - 'div[role="dialog"] a[role="button"]:visible', - "Next" - ).click(); - cy.log("clicked the Next button"); + // cy.contains( + // 'div[role="dialog"] a[role="button"]:visible', + // "Next" + // ).click(); + // cy.log("clicked the Next button"); } });