diff --git a/tests/cypress.config.js b/cypress.config.ts similarity index 83% rename from tests/cypress.config.js rename to cypress.config.ts index 4e81f9b4e..0b2385833 100644 --- a/tests/cypress.config.js +++ b/cypress.config.ts @@ -7,7 +7,9 @@ module.exports = defineConfig({ env: { failSilently: false, }, + supportFile: "./cypress/support/index.ts", e2e: { + specPattern: "**/*.*cy.*", setupNodeEvents(on, config) { getCompareSnapshotsPlugin(on, config); }, diff --git a/tests/jest/helper.ts b/cypress/helper.ts similarity index 100% rename from tests/jest/helper.ts rename to cypress/helper.ts diff --git a/cypress/plugins/index.ts b/cypress/plugins/index.ts new file mode 100644 index 000000000..eb7e40298 --- /dev/null +++ b/cypress/plugins/index.ts @@ -0,0 +1,4 @@ +module.exports = (on, config) => { + const getCompareSnapshotsPlugin = require("cypress-visual-regression/dist/plugin"); + getCompareSnapshotsPlugin(on, config); +}; diff --git a/tests/cypress/setup/index.html b/cypress/setup/index.html similarity index 100% rename from tests/cypress/setup/index.html rename to cypress/setup/index.html diff --git a/cypress/snapshots/actual/tour/dont-show-again.cy.js/Don't show again checkbox -- should not display the tour if checkbox is clicked (failed).png b/cypress/snapshots/actual/tour/dont-show-again.cy.js/Don't show again checkbox -- should not display the tour if checkbox is clicked (failed).png new file mode 100644 index 000000000..843b0342b Binary files /dev/null and b/cypress/snapshots/actual/tour/dont-show-again.cy.js/Don't show again checkbox -- should not display the tour if checkbox is clicked (failed).png differ diff --git a/cypress/snapshots/actual/tour/dont-show-again.cy.js/Don't show again checkbox -- should render the 'Dont show Again' checkbox (failed).png b/cypress/snapshots/actual/tour/dont-show-again.cy.js/Don't show again checkbox -- should render the 'Dont show Again' checkbox (failed).png new file mode 100644 index 000000000..6f6f22d9f Binary files /dev/null and b/cypress/snapshots/actual/tour/dont-show-again.cy.js/Don't show again checkbox -- should render the 'Dont show Again' checkbox (failed).png differ diff --git a/cypress/snapshots/actual/tour/dont-show-again.cy.js/dont-show-again-checkbox-first-step-actual.png b/cypress/snapshots/actual/tour/dont-show-again.cy.js/dont-show-again-checkbox-first-step-actual.png new file mode 100644 index 000000000..2778c6b86 Binary files /dev/null and b/cypress/snapshots/actual/tour/dont-show-again.cy.js/dont-show-again-checkbox-first-step-actual.png differ diff --git a/cypress/snapshots/actual/tour/dont-show-again.cy.js/dont-show-again-clicked-first-step-actual.png b/cypress/snapshots/actual/tour/dont-show-again.cy.js/dont-show-again-clicked-first-step-actual.png new file mode 100644 index 000000000..1630d1df5 Binary files /dev/null and b/cypress/snapshots/actual/tour/dont-show-again.cy.js/dont-show-again-clicked-first-step-actual.png differ diff --git a/tests/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-checkbox-first-step-base.png b/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-checkbox-first-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-checkbox-first-step-base.png rename to cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-checkbox-first-step-base.png diff --git a/tests/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-checkbox-second-step-base.png b/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-checkbox-second-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-checkbox-second-step-base.png rename to cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-checkbox-second-step-base.png diff --git a/tests/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-after-exit-base.png b/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-after-exit-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-after-exit-base.png rename to cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-after-exit-base.png diff --git a/tests/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-after-second-start-base.png b/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-after-second-start-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-after-second-start-base.png rename to cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-after-second-start-base.png diff --git a/tests/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-first-step-base.png b/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-first-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-first-step-base.png rename to cypress/snapshots/base/tour/dont-show-again.cy.js/dont-show-again-clicked-first-step-base.png diff --git a/tests/cypress/snapshots/base/tour/highlight.cy.js/highlight-element-first-step-base.png b/cypress/snapshots/base/tour/highlight.cy.js/highlight-element-first-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/highlight.cy.js/highlight-element-first-step-base.png rename to cypress/snapshots/base/tour/highlight.cy.js/highlight-element-first-step-base.png diff --git a/tests/cypress/snapshots/base/tour/highlight.cy.js/highlight-element-second-step-base.png b/cypress/snapshots/base/tour/highlight.cy.js/highlight-element-second-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/highlight.cy.js/highlight-element-second-step-base.png rename to cypress/snapshots/base/tour/highlight.cy.js/highlight-element-second-step-base.png diff --git a/tests/cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-element-base.png b/cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-element-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-element-base.png rename to cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-element-base.png diff --git a/tests/cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-element-scroll-base.png b/cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-element-scroll-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-element-scroll-base.png rename to cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-element-scroll-base.png diff --git a/tests/cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-parent-element-scroll-base.png b/cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-parent-element-scroll-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-parent-element-scroll-base.png rename to cypress/snapshots/base/tour/highlight.cy.js/highlight-fixed-parent-element-scroll-base.png diff --git a/tests/cypress/snapshots/base/tour/modal.cy.js/exit-base.png b/cypress/snapshots/base/tour/modal.cy.js/exit-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/modal.cy.js/exit-base.png rename to cypress/snapshots/base/tour/modal.cy.js/exit-base.png diff --git a/tests/cypress/snapshots/base/tour/modal.cy.js/first-step-base.png b/cypress/snapshots/base/tour/modal.cy.js/first-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/modal.cy.js/first-step-base.png rename to cypress/snapshots/base/tour/modal.cy.js/first-step-base.png diff --git a/tests/cypress/snapshots/base/tour/modal.cy.js/position-bottom-base.png b/cypress/snapshots/base/tour/modal.cy.js/position-bottom-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/modal.cy.js/position-bottom-base.png rename to cypress/snapshots/base/tour/modal.cy.js/position-bottom-base.png diff --git a/tests/cypress/snapshots/base/tour/modal.cy.js/position-left-base.png b/cypress/snapshots/base/tour/modal.cy.js/position-left-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/modal.cy.js/position-left-base.png rename to cypress/snapshots/base/tour/modal.cy.js/position-left-base.png diff --git a/tests/cypress/snapshots/base/tour/modal.cy.js/position-right-base.png b/cypress/snapshots/base/tour/modal.cy.js/position-right-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/modal.cy.js/position-right-base.png rename to cypress/snapshots/base/tour/modal.cy.js/position-right-base.png diff --git a/tests/cypress/snapshots/base/tour/modal.cy.js/refresh-first-step-base.png b/cypress/snapshots/base/tour/modal.cy.js/refresh-first-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/modal.cy.js/refresh-first-step-base.png rename to cypress/snapshots/base/tour/modal.cy.js/refresh-first-step-base.png diff --git a/tests/cypress/snapshots/base/tour/modal.cy.js/refresh-second-step-base.png b/cypress/snapshots/base/tour/modal.cy.js/refresh-second-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/modal.cy.js/refresh-second-step-base.png rename to cypress/snapshots/base/tour/modal.cy.js/refresh-second-step-base.png diff --git a/tests/cypress/snapshots/base/tour/modal.cy.js/refresh-third-step-base.png b/cypress/snapshots/base/tour/modal.cy.js/refresh-third-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/modal.cy.js/refresh-third-step-base.png rename to cypress/snapshots/base/tour/modal.cy.js/refresh-third-step-base.png diff --git a/tests/cypress/snapshots/base/tour/modal.cy.js/second-step-base.png b/cypress/snapshots/base/tour/modal.cy.js/second-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/modal.cy.js/second-step-base.png rename to cypress/snapshots/base/tour/modal.cy.js/second-step-base.png diff --git a/tests/cypress/snapshots/base/tour/progressbar.cy.js/exit-base.png b/cypress/snapshots/base/tour/progressbar.cy.js/exit-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/progressbar.cy.js/exit-base.png rename to cypress/snapshots/base/tour/progressbar.cy.js/exit-base.png diff --git a/tests/cypress/snapshots/base/tour/progressbar.cy.js/first-step-base.png b/cypress/snapshots/base/tour/progressbar.cy.js/first-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/progressbar.cy.js/first-step-base.png rename to cypress/snapshots/base/tour/progressbar.cy.js/first-step-base.png diff --git a/tests/cypress/snapshots/base/tour/progressbar.cy.js/second-step-base.png b/cypress/snapshots/base/tour/progressbar.cy.js/second-step-base.png similarity index 100% rename from tests/cypress/snapshots/base/tour/progressbar.cy.js/second-step-base.png rename to cypress/snapshots/base/tour/progressbar.cy.js/second-step-base.png diff --git a/cypress/snapshots/diff/tour/dont-show-again.cy.js/dont-show-again-checkbox-first-step-diff.png b/cypress/snapshots/diff/tour/dont-show-again.cy.js/dont-show-again-checkbox-first-step-diff.png new file mode 100644 index 000000000..a3dcc6eb5 Binary files /dev/null and b/cypress/snapshots/diff/tour/dont-show-again.cy.js/dont-show-again-checkbox-first-step-diff.png differ diff --git a/cypress/snapshots/diff/tour/dont-show-again.cy.js/dont-show-again-clicked-first-step-diff.png b/cypress/snapshots/diff/tour/dont-show-again.cy.js/dont-show-again-clicked-first-step-diff.png new file mode 100644 index 000000000..0a315441c Binary files /dev/null and b/cypress/snapshots/diff/tour/dont-show-again.cy.js/dont-show-again-clicked-first-step-diff.png differ diff --git a/cypress/snapshots/diff/tour/highlight.cy.js/highlight-element-first-step-diff.png b/cypress/snapshots/diff/tour/highlight.cy.js/highlight-element-first-step-diff.png new file mode 100644 index 000000000..e44670a66 Binary files /dev/null and b/cypress/snapshots/diff/tour/highlight.cy.js/highlight-element-first-step-diff.png differ diff --git a/cypress/snapshots/diff/tour/highlight.cy.js/highlight-fixed-element-diff.png b/cypress/snapshots/diff/tour/highlight.cy.js/highlight-fixed-element-diff.png new file mode 100644 index 000000000..e786f1dad Binary files /dev/null and b/cypress/snapshots/diff/tour/highlight.cy.js/highlight-fixed-element-diff.png differ diff --git a/cypress/snapshots/diff/tour/highlight.cy.js/highlight-fixed-element-scroll-diff.png b/cypress/snapshots/diff/tour/highlight.cy.js/highlight-fixed-element-scroll-diff.png new file mode 100644 index 000000000..45dea2c54 Binary files /dev/null and b/cypress/snapshots/diff/tour/highlight.cy.js/highlight-fixed-element-scroll-diff.png differ diff --git a/cypress/snapshots/diff/tour/highlight.cy.js/highlight-fixed-parent-element-scroll-diff.png b/cypress/snapshots/diff/tour/highlight.cy.js/highlight-fixed-parent-element-scroll-diff.png new file mode 100644 index 000000000..361d263ce Binary files /dev/null and b/cypress/snapshots/diff/tour/highlight.cy.js/highlight-fixed-parent-element-scroll-diff.png differ diff --git a/cypress/snapshots/diff/tour/modal.cy.js/first-step-diff.png b/cypress/snapshots/diff/tour/modal.cy.js/first-step-diff.png new file mode 100644 index 000000000..e44670a66 Binary files /dev/null and b/cypress/snapshots/diff/tour/modal.cy.js/first-step-diff.png differ diff --git a/cypress/snapshots/diff/tour/modal.cy.js/position-bottom-diff.png b/cypress/snapshots/diff/tour/modal.cy.js/position-bottom-diff.png new file mode 100644 index 000000000..164cb4ea8 Binary files /dev/null and b/cypress/snapshots/diff/tour/modal.cy.js/position-bottom-diff.png differ diff --git a/cypress/snapshots/diff/tour/modal.cy.js/refresh-first-step-diff.png b/cypress/snapshots/diff/tour/modal.cy.js/refresh-first-step-diff.png new file mode 100644 index 000000000..74dd5ce46 Binary files /dev/null and b/cypress/snapshots/diff/tour/modal.cy.js/refresh-first-step-diff.png differ diff --git a/cypress/snapshots/diff/tour/progressbar.cy.js/first-step-diff.png b/cypress/snapshots/diff/tour/progressbar.cy.js/first-step-diff.png new file mode 100644 index 000000000..90cfc96f7 Binary files /dev/null and b/cypress/snapshots/diff/tour/progressbar.cy.js/first-step-diff.png differ diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts new file mode 100644 index 000000000..769cb0de5 --- /dev/null +++ b/cypress/support/index.d.ts @@ -0,0 +1,10 @@ + +declare namespace Cypress { + interface Chainable{ + nextStep(): Chainable; + prevStep(): Chainable; + } + interface Window { + introJs: any; + } +} diff --git a/cypress/support/index.ts b/cypress/support/index.ts new file mode 100644 index 000000000..4882ab918 --- /dev/null +++ b/cypress/support/index.ts @@ -0,0 +1,24 @@ +/// + +import compareSnapshotCommand from "cypress-visual-regression/dist/command"; + +compareSnapshotCommand({ + capture: "fullPage", +}); + +Cypress.Commands.add("nextStep", () => { + cy.get(".introjs-nextbutton").click(); +}); + +Cypress.Commands.add("prevStep", () => { + cy.get(".introjs-prevbutton").click(); +}); + +Cypress.on("window:before:load", (win) => { + const htmlNode = win.document.querySelector("html"); + const node = win.document.createElement("style"); + node.innerHTML = "html { scroll-behavior: inherit !important; }"; + htmlNode?.appendChild(node); +}); + +import "cypress-real-events/support"; diff --git a/cypress/videos/hint/hideHints.cy.js.mp4 b/cypress/videos/hint/hideHints.cy.js.mp4 new file mode 100644 index 000000000..a685e014a Binary files /dev/null and b/cypress/videos/hint/hideHints.cy.js.mp4 differ diff --git a/cypress/videos/hint/modal.cy.js.mp4 b/cypress/videos/hint/modal.cy.js.mp4 new file mode 100644 index 000000000..44a5aaf6e Binary files /dev/null and b/cypress/videos/hint/modal.cy.js.mp4 differ diff --git a/cypress/videos/hint/removeHints.cy.js.mp4 b/cypress/videos/hint/removeHints.cy.js.mp4 new file mode 100644 index 000000000..b4661d11e Binary files /dev/null and b/cypress/videos/hint/removeHints.cy.js.mp4 differ diff --git a/cypress/videos/hint/showHints.cy.js.mp4 b/cypress/videos/hint/showHints.cy.js.mp4 new file mode 100644 index 000000000..eb27c14b2 Binary files /dev/null and b/cypress/videos/hint/showHints.cy.js.mp4 differ diff --git a/cypress/videos/tour/dont-show-again.cy.js.mp4 b/cypress/videos/tour/dont-show-again.cy.js.mp4 new file mode 100644 index 000000000..08da2a85c Binary files /dev/null and b/cypress/videos/tour/dont-show-again.cy.js.mp4 differ diff --git a/cypress/videos/tour/exit.cy.js.mp4 b/cypress/videos/tour/exit.cy.js.mp4 new file mode 100644 index 000000000..ba19d40f0 Binary files /dev/null and b/cypress/videos/tour/exit.cy.js.mp4 differ diff --git a/package-lock.json b/package-lock.json index 29b0d45ab..89a9b2146 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,9 +21,9 @@ "autoprefixer": "^9.0.0", "babel-jest": "^29.2.2", "core-js": "^3.6.5", - "cypress": "^12.8.1", - "cypress-real-events": "^1.7.6", - "cypress-visual-regression": "^2.1.1", + "cypress": "^13.12.0", + "cypress-real-events": "^1.13.0", + "cypress-visual-regression": "^5.0.2", "eslint": "^8.0.1", "jest": "^29.5.0", "jest-extended": "^3.2.4", @@ -1857,9 +1857,9 @@ "dev": true }, "node_modules/@cypress/request": { - "version": "2.88.12", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.12.tgz", - "integrity": "sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", + "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", "dev": true, "dependencies": { "aws-sign2": "~0.7.0", @@ -1875,7 +1875,7 @@ "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.19", "performance-now": "^2.1.0", - "qs": "~6.10.3", + "qs": "6.10.4", "safe-buffer": "^5.1.2", "tough-cookie": "^4.1.3", "tunnel-agent": "^0.6.0", @@ -4149,9 +4149,9 @@ } }, "node_modules/aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.0.tgz", + "integrity": "sha512-3AungXC4I8kKsS9PuS4JH2nc+0bVY/mjgrephHTIi8fpEeGsTHBUJeosp0Wc1myYMElmD0B3Oc4XL/HVJ4PV2g==", "dev": true }, "node_modules/babel-jest": { @@ -5521,21 +5521,20 @@ } }, "node_modules/cypress": { - "version": "12.17.4", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.17.4.tgz", - "integrity": "sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ==", + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.12.0.tgz", + "integrity": "sha512-udzS2JilmI9ApO/UuqurEwOvThclin5ntz7K0BtnHBs+tg2Bl9QShLISXpSEMDv/u8b6mqdoAdyKeZiSqKWL8g==", "dev": true, "hasInstallScript": true, "dependencies": { - "@cypress/request": "2.88.12", + "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^16.18.39", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", "blob-util": "^2.0.2", "bluebird": "^3.7.2", - "buffer": "^5.6.0", + "buffer": "^5.7.1", "cachedir": "^2.3.0", "chalk": "^4.1.0", "check-more-types": "^2.24.0", @@ -5553,7 +5552,7 @@ "figures": "^3.2.0", "fs-extra": "^9.1.0", "getos": "^3.2.1", - "is-ci": "^3.0.0", + "is-ci": "^3.0.1", "is-installed-globally": "~0.4.0", "lazy-ass": "^1.6.0", "listr2": "^3.8.3", @@ -5575,38 +5574,106 @@ "cypress": "bin/cypress" }, "engines": { - "node": "^14.0.0 || ^16.0.0 || >=18.0.0" + "node": "^16.0.0 || ^18.0.0 || >=20.0.0" } }, "node_modules/cypress-real-events": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/cypress-real-events/-/cypress-real-events-1.7.6.tgz", - "integrity": "sha512-yP6GnRrbm6HK5q4DH6Nnupz37nOfZu/xn1xFYqsE2o4G73giPWQOdu6375QYpwfU1cvHNCgyD2bQ2hPH9D7NMw==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/cypress-real-events/-/cypress-real-events-1.13.0.tgz", + "integrity": "sha512-LoejtK+dyZ1jaT8wGT5oASTPfsNV8/ClRp99ruN60oPj8cBJYod80iJDyNwfPAu4GCxTXOhhAv9FO65Hpwt6Hg==", "dev": true, "peerDependencies": { - "cypress": "^4.x || ^5.x || ^6.x || ^7.x || ^8.x || ^9.x || ^10.x || ^11.x || ^12.x" + "cypress": "^4.x || ^5.x || ^6.x || ^7.x || ^8.x || ^9.x || ^10.x || ^11.x || ^12.x || ^13.x" } }, "node_modules/cypress-visual-regression": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/cypress-visual-regression/-/cypress-visual-regression-2.1.1.tgz", - "integrity": "sha512-oVDBL3hEMd6luj7eYLXzaNbqKPT8e1ZDGg/mptCRlIgw/uo09zv5TRHe6eqptPuZH8qFpfG3Eijk656zP2PcZg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/cypress-visual-regression/-/cypress-visual-regression-5.0.2.tgz", + "integrity": "sha512-Rr/W2uSw1KxG5AE9q6MT8yZfT81GaLVO0z/QyKg9pCZ7XvObUklyh9j5gWe7yUzDnY/2g9XpczZKNKL2zZ2PAg==", "dev": true, "dependencies": { + "chalk": "^4.1.2", "pixelmatch": "^5.2.1", "pngjs": "^6.0.0", "sanitize-filename": "^1.6.3" }, + "engines": { + "node": ">=18" + }, "peerDependencies": { - "cypress": ">=9.7.0" + "cypress": ">=12" } }, - "node_modules/cypress/node_modules/@types/node": { - "version": "16.18.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.39.tgz", - "integrity": "sha512-8q9ZexmdYYyc5/cfujaXb4YOucpQxAV4RMG0himLyDUOEr8Mr79VrqsFI+cQ2M2h89YIuy95lbxuYjxT4Hk4kQ==", + "node_modules/cypress-visual-regression/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cypress-visual-regression/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cypress-visual-regression/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cypress-visual-regression/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/cypress-visual-regression/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cypress-visual-regression/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cypress/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -16026,9 +16093,9 @@ "dev": true }, "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, "dependencies": { "asn1": "~0.2.3", @@ -18898,9 +18965,9 @@ "dev": true }, "@cypress/request": { - "version": "2.88.12", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.12.tgz", - "integrity": "sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", + "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", "dev": true, "requires": { "aws-sign2": "~0.7.0", @@ -18916,7 +18983,7 @@ "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.19", "performance-now": "^2.1.0", - "qs": "~6.10.3", + "qs": "6.10.4", "safe-buffer": "^5.1.2", "tough-cookie": "^4.1.3", "tunnel-agent": "^0.6.0", @@ -20654,9 +20721,9 @@ "dev": true }, "aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.0.tgz", + "integrity": "sha512-3AungXC4I8kKsS9PuS4JH2nc+0bVY/mjgrephHTIi8fpEeGsTHBUJeosp0Wc1myYMElmD0B3Oc4XL/HVJ4PV2g==", "dev": true }, "babel-jest": { @@ -21655,20 +21722,19 @@ } }, "cypress": { - "version": "12.17.4", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.17.4.tgz", - "integrity": "sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ==", + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.12.0.tgz", + "integrity": "sha512-udzS2JilmI9ApO/UuqurEwOvThclin5ntz7K0BtnHBs+tg2Bl9QShLISXpSEMDv/u8b6mqdoAdyKeZiSqKWL8g==", "dev": true, "requires": { - "@cypress/request": "2.88.12", + "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^16.18.39", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", "blob-util": "^2.0.2", "bluebird": "^3.7.2", - "buffer": "^5.6.0", + "buffer": "^5.7.1", "cachedir": "^2.3.0", "chalk": "^4.1.0", "check-more-types": "^2.24.0", @@ -21686,7 +21752,7 @@ "figures": "^3.2.0", "fs-extra": "^9.1.0", "getos": "^3.2.1", - "is-ci": "^3.0.0", + "is-ci": "^3.0.1", "is-installed-globally": "~0.4.0", "lazy-ass": "^1.6.0", "listr2": "^3.8.3", @@ -21705,12 +21771,6 @@ "yauzl": "^2.10.0" }, "dependencies": { - "@types/node": { - "version": "16.18.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.39.tgz", - "integrity": "sha512-8q9ZexmdYYyc5/cfujaXb4YOucpQxAV4RMG0himLyDUOEr8Mr79VrqsFI+cQ2M2h89YIuy95lbxuYjxT4Hk4kQ==", - "dev": true - }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -21783,21 +21843,73 @@ } }, "cypress-real-events": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/cypress-real-events/-/cypress-real-events-1.7.6.tgz", - "integrity": "sha512-yP6GnRrbm6HK5q4DH6Nnupz37nOfZu/xn1xFYqsE2o4G73giPWQOdu6375QYpwfU1cvHNCgyD2bQ2hPH9D7NMw==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/cypress-real-events/-/cypress-real-events-1.13.0.tgz", + "integrity": "sha512-LoejtK+dyZ1jaT8wGT5oASTPfsNV8/ClRp99ruN60oPj8cBJYod80iJDyNwfPAu4GCxTXOhhAv9FO65Hpwt6Hg==", "dev": true, "requires": {} }, "cypress-visual-regression": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/cypress-visual-regression/-/cypress-visual-regression-2.1.1.tgz", - "integrity": "sha512-oVDBL3hEMd6luj7eYLXzaNbqKPT8e1ZDGg/mptCRlIgw/uo09zv5TRHe6eqptPuZH8qFpfG3Eijk656zP2PcZg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/cypress-visual-regression/-/cypress-visual-regression-5.0.2.tgz", + "integrity": "sha512-Rr/W2uSw1KxG5AE9q6MT8yZfT81GaLVO0z/QyKg9pCZ7XvObUklyh9j5gWe7yUzDnY/2g9XpczZKNKL2zZ2PAg==", "dev": true, "requires": { + "chalk": "^4.1.2", "pixelmatch": "^5.2.1", "pngjs": "^6.0.0", "sanitize-filename": "^1.6.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "dashdash": { @@ -29496,9 +29608,9 @@ "dev": true }, "sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, "requires": { "asn1": "~0.2.3", diff --git a/package.json b/package.json index c281d77dc..dbea9a4fc 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,9 @@ "autoprefixer": "^9.0.0", "babel-jest": "^29.2.2", "core-js": "^3.6.5", - "cypress": "^12.8.1", - "cypress-real-events": "^1.7.6", - "cypress-visual-regression": "^2.1.1", + "cypress": "^13.12.0", + "cypress-real-events": "^1.13.0", + "cypress-visual-regression": "^5.0.2", "eslint": "^8.0.1", "jest": "^29.5.0", "jest-extended": "^3.2.4", diff --git a/tests/cypress/e2e/hint/hideHints.cy.js b/src/packages/hint/hideHints.cy.ts similarity index 100% rename from tests/cypress/e2e/hint/hideHints.cy.js rename to src/packages/hint/hideHints.cy.ts diff --git a/tests/cypress/e2e/hint/modal.cy.js b/src/packages/hint/modal.cy.ts similarity index 100% rename from tests/cypress/e2e/hint/modal.cy.js rename to src/packages/hint/modal.cy.ts diff --git a/tests/cypress/e2e/hint/removeHints.cy.js b/src/packages/hint/removeHints.cy.ts similarity index 100% rename from tests/cypress/e2e/hint/removeHints.cy.js rename to src/packages/hint/removeHints.cy.ts diff --git a/tests/cypress/e2e/hint/showHints.cy.js b/src/packages/hint/showHints.cy.ts similarity index 100% rename from tests/cypress/e2e/hint/showHints.cy.js rename to src/packages/hint/showHints.cy.ts diff --git a/tests/cypress/e2e/tour/dont-show-again.cy.js b/src/packages/tour/dont-show-again.cy.ts similarity index 100% rename from tests/cypress/e2e/tour/dont-show-again.cy.js rename to src/packages/tour/dont-show-again.cy.ts diff --git a/tests/cypress/e2e/tour/exit.cy.js b/src/packages/tour/exit.cy.ts similarity index 100% rename from tests/cypress/e2e/tour/exit.cy.js rename to src/packages/tour/exit.cy.ts diff --git a/tests/cypress/e2e/tour/highlight.cy.js b/src/packages/tour/highlight.cy.ts similarity index 100% rename from tests/cypress/e2e/tour/highlight.cy.js rename to src/packages/tour/highlight.cy.ts diff --git a/tests/cypress/e2e/tour/modal.cy.js b/src/packages/tour/modal.cy.ts similarity index 100% rename from tests/cypress/e2e/tour/modal.cy.js rename to src/packages/tour/modal.cy.ts diff --git a/tests/cypress/e2e/tour/navigation.cy.js b/src/packages/tour/navigation.cy.ts similarity index 100% rename from tests/cypress/e2e/tour/navigation.cy.js rename to src/packages/tour/navigation.cy.ts diff --git a/tests/cypress/e2e/tour/progressbar.cy.js b/src/packages/tour/progressbar.cy.ts similarity index 100% rename from tests/cypress/e2e/tour/progressbar.cy.js rename to src/packages/tour/progressbar.cy.ts diff --git a/tests/cypress/e2e/tour/start.cy.js b/src/packages/tour/start.cy.ts similarity index 100% rename from tests/cypress/e2e/tour/start.cy.js rename to src/packages/tour/start.cy.ts diff --git a/src/util/setPositionRelativeTo.test.ts b/src/util/setPositionRelativeTo.test.ts index 2392f6fab..f13af3d6f 100644 --- a/src/util/setPositionRelativeTo.test.ts +++ b/src/util/setPositionRelativeTo.test.ts @@ -1,6 +1,6 @@ import { setPositionRelativeTo } from "./setPositionRelativeTo"; import createElement from "./createElement"; -import { getBoundingClientRectSpy } from "../../tests/jest/helper"; +import { getBoundingClientRectSpy } from "../../cypress/helper"; describe("setPositionRelativeTo", () => { it("should return if helperLayer or currentStep is null", () => { diff --git a/tests/cypress/fixtures/example.json b/tests/cypress/fixtures/example.json deleted file mode 100644 index 02e425437..000000000 --- a/tests/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} diff --git a/tests/cypress/plugins/index.js b/tests/cypress/plugins/index.js deleted file mode 100644 index 21b138cc4..000000000 --- a/tests/cypress/plugins/index.js +++ /dev/null @@ -1,5 +0,0 @@ -const getCompareSnapshotsPlugin = require("cypress-visual-regression/dist/plugin"); - -module.exports = (on, config) => { - getCompareSnapshotsPlugin(on, config); -}; diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js deleted file mode 100644 index 9c5400c21..000000000 --- a/tests/cypress/support/commands.js +++ /dev/null @@ -1,13 +0,0 @@ -const compareSnapshotCommand = require("cypress-visual-regression/dist/command"); - -compareSnapshotCommand({ - capture: "fullPage", -}); - -Cypress.Commands.add("nextStep", () => { - cy.get(".introjs-nextbutton").click(); -}); - -Cypress.Commands.add("prevStep", () => { - cy.get(".introjs-prevbutton").click(); -}); diff --git a/tests/cypress/support/e2e.js b/tests/cypress/support/e2e.js deleted file mode 100644 index 08a80aeb1..000000000 --- a/tests/cypress/support/e2e.js +++ /dev/null @@ -1,10 +0,0 @@ -import "./commands"; - -Cypress.on("window:before:load", (win) => { - const htmlNode = win.document.querySelector("html"); - const node = win.document.createElement("style"); - node.innerHTML = "html { scroll-behavior: inherit !important; }"; - htmlNode.appendChild(node); -}); - -import "cypress-real-events/support"; diff --git a/tests/jest/index.test.ts b/tests/jest/index.test.ts index 3bffb5539..04966c5ae 100644 --- a/tests/jest/index.test.ts +++ b/tests/jest/index.test.ts @@ -9,7 +9,7 @@ import { doneButton, tooltipText, appendDummyElement, -} from "./helper"; +} from "../../cypress/helper"; jest.mock("../../src/core/dontShowAgain"); diff --git a/tsconfig.json b/tsconfig.json index 6e4a2a6f6..7588f6b1f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,9 +21,12 @@ "baseUrl": "./", "outDir": "dist" }, - "include": [ - "src/**/*", - "src/index.ts", - "tests/jest/**/*" + "include": ["src/**/*", "src/index.ts", "tests/jest/**/*"], + "exclude": [ + "./cypress.config.ts", + "cypress", + "dist", + "node_modules", + "**/*.cy.ts" ] }