diff --git a/.eslintrc.js b/.eslintrc.js index 86d3c4194..f45104836 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,7 +26,11 @@ module.exports = { eqeqeq: "error", "max-len": ["error", { code: 140, ignoreUrls: true }], "comma-dangle": ["error", "never"], - quotes: ["error", "double", { allowTemplateLiterals: true }], + quotes: [ + "error", + "double", + { avoidEscape: true, allowTemplateLiterals: true } + ], "import/no-extraneous-dependencies": "warn", "consistent-return": "warn", "no-plusplus": 0, @@ -41,10 +45,18 @@ module.exports = { overrides: [ { - files: [ - "**/__tests__/*.{j,t}s?(x)", - "**/tests/unit/**/*.spec.{j,t}s?(x)" - ], + files: ["**/tests/**/*.{j,t}s?(x)", "**/tests/e2e/**/*.spec.{j,t}s?(x)"], + plugins: ["cypress"], + env: { + mocha: true, + "cypress/globals": true + }, + rules: { + strict: "off" + } + }, + { + files: ["**/tests/unit/**/*.spec.{j,t}s?(x)"], env: { jest: true } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55fb8a4c3..e42c72054 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,21 +33,26 @@ jobs: # run: npm run test - name: Cypress run - uses: cypress-io/github-action@v5 + uses: cypress-io/github-action@v6 with: + browser: chrome install: false - start: npm run dev -- --host - wait-on: http://localhost:5173/ - config-file: cypress.json + start: npm run dev + wait-on: 'http://localhost:5173/' + config-file: cypress.config.js spec: "tests/e2e/**/*" record: true parallel: true + group: 'CI - Chrome' env: # For recording and parallelization to work you must set your CYPRESS_RECORD_KEY # in GitHub repo → Settings → Secrets → Actions CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} # Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} + COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} + # re-enable PR comment bot + COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}} - name: Upload Cypress Screenshots uses: actions/upload-artifact@v3 # Only capture images on failure diff --git a/.gitignore b/.gitignore index 5e5496756..92a559950 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ node_modules .nyc_output/ coverage/ tests/e2e/screenshots/ +tests/e2e/videos/ +tests/e2e/downloads # local env files .env.local diff --git a/babel.config.json b/babel.config.json index db7ff87f9..d008dac47 100644 --- a/babel.config.json +++ b/babel.config.json @@ -9,9 +9,5 @@ } ] ], - "env": { - "test": { - "plugins": ["istanbul"] - } - } + "plugins": ["istanbul"] } diff --git a/cypress.config.js b/cypress.config.js new file mode 100644 index 000000000..801173b38 --- /dev/null +++ b/cypress.config.js @@ -0,0 +1,60 @@ +const { defineConfig } = require("cypress"); +const { prepareAudit, lighthouse } = require("@cypress-audit/lighthouse"); +const { pa11y } = require("@cypress-audit/pa11y"); +const globby = require("globby"); + +module.exports = defineConfig({ + projectId: "c4pb2f", + viewportWidth: 1140, + viewportHeight: 668, + video: false, + fixturesFolder: "tests/e2e/fixtures", + screenshotsFolder: "tests/e2e/screenshots", + videosFolder: "tests/e2e/videos", + downloadsFolder: "tests/e2e/downloads", + experimentalMemoryManagement: true, + numTestsKeptInMemory: 20, + e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + setupNodeEvents(on, config) { + require("@cypress/code-coverage/task")(on, config); + // include any other plugin code... + on("before:browser:launch", (browser = {}, launchOptions) => { + prepareAudit(launchOptions); + }); + on("task", { + lighthouse: lighthouse(), + pa11y: pa11y(), + // a task to find one file matching the given mask + // returns just the first matching file + async findFiles(mask) { + if (!mask) { + throw new Error("Missing a file mask to search"); + } + + console.log("searching for files %s", mask); + const list = await globby(mask); + + if (!list.length) { + console.log("found no files"); + + return null; + } + + console.log("found %d files, first one %s", list.length, list[0]); + + return list[0]; + } + }); + // It's IMPORTANT to return the config object + // with any changed environment variables + return config; + }, + testIsolation: false, + baseUrl: "http://localhost:5173", + specPattern: "tests/e2e/specs/**/*.{js,jsx,ts,tsx}", + supportFile: "tests/e2e/support/index.js", + waitForAnimations: true + } +}); diff --git a/cypress.json b/cypress.json deleted file mode 100644 index 0a20818de..000000000 --- a/cypress.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "projectId": "c4pb2f", - "viewportWidth": 1140, - "viewportHeight": 668, - "pluginsFile": "tests/e2e/plugins/index.js", - "baseUrl": "http://localhost:5173", - "video": false -} diff --git a/package-lock.json b/package-lock.json index 987ef5a07..3c92cf982 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,10 +23,12 @@ "vuelidate": "^0.7.5" }, "devDependencies": { - "@4tw/cypress-drag-drop": "~1.3.1", + "@4tw/cypress-drag-drop": "^2.2.5", "@babel/core": "^7.12.16", "@babel/eslint-parser": "^7.12.16", - "@cypress/code-coverage": "^3.8.1", + "@cypress-audit/lighthouse": "^1.4.2", + "@cypress-audit/pa11y": "^1.4.2", + "@cypress/code-coverage": "^3.12.19", "@fortawesome/fontawesome-free": "^5.6.1", "@originjs/vite-plugin-commonjs": "^1.0.3", "@panter/vue-i18next": "^0.15.2", @@ -41,17 +43,18 @@ "bootstrap-vue": "^2.19.0", "css-loader": "^5.2.7", "css-tree": "^1.0.0-alpha.29", - "cypress": "^3.8.0", - "cypress-audit": "^1.1.0", - "cypress-wait-until": "^1.7.1", + "cypress": "^13.6.3", + "cypress-wait-until": "^3.0.1", "eslint": "^8.21.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-prettier": "^8.5.0", + "eslint-plugin-cypress": "^2.15.1", "eslint-plugin-import": "^2.26.0", "eslint-plugin-jest": "^22.4.1", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-vue": "^9.3.0", "expr-eval": "^2.0.2", + "globby": "^11.1.0", "i18next": "^15.0.8", "identity-obj-proxy": "^3.0.0", "inputmask": "^5.0.7", @@ -62,6 +65,7 @@ "v-calendar": "^0.9.7", "validatorjs": "^3.14.2", "vite": "^4.0.4", + "vite-plugin-istanbul": "^5.0.0", "vite-plugin-monaco-editor": "^1.1.0", "vue": "^2.6.12", "vue-deepset": "^0.6.3", @@ -86,12 +90,12 @@ } }, "node_modules/@4tw/cypress-drag-drop": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@4tw/cypress-drag-drop/-/cypress-drag-drop-1.3.1.tgz", - "integrity": "sha512-3MdfK3Ccc0gJiBfYZm1DN5PjHoghDtdca3KgjwqO174TClnwUU226zLvSCf7C3q+0MGJdRRCRSB85msNbUPZnQ==", + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@4tw/cypress-drag-drop/-/cypress-drag-drop-2.2.5.tgz", + "integrity": "sha512-3ghTmzhOmUqeN6U3QmUnKRUxI7OMLbJA4hHUY/eS/FhWJgxbiGgcaELbolWnBAOpajPXcsNQGYEj9brd59WH6A==", "dev": true, "peerDependencies": { - "cypress": "^3.1.0" + "cypress": "2 - 13" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1891,10 +1895,38 @@ "node": "^12.20.0 || >=14.13.0" } }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@cypress-audit/lighthouse": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@cypress-audit/lighthouse/-/lighthouse-1.4.2.tgz", + "integrity": "sha512-xiYeCnZYav89vsIWNtyXdU1mORyp/OGK3qQ8tDYN3HacYjTtcsp+avcoi4X2vXZWC7yu4dcu17SbTg4H64ymSQ==", + "dev": true, + "dependencies": { + "lighthouse": "^10.0.2" + } + }, + "node_modules/@cypress-audit/pa11y": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@cypress-audit/pa11y/-/pa11y-1.4.2.tgz", + "integrity": "sha512-XTHMR8MnUGtyEajeSRkrzw0rikDX/0iSW0o4Ft18WGZ4EcfQi+rzXncEPfMrLEiU91HI9WT2ojE4Q2Xh6AuQ6Q==", + "dev": true, + "dependencies": { + "pa11y": "^6.2.3" + } + }, "node_modules/@cypress/code-coverage": { - "version": "3.12.17", - "resolved": "https://registry.npmjs.org/@cypress/code-coverage/-/code-coverage-3.12.17.tgz", - "integrity": "sha512-HtGUZ50f/QxJxMq2kjsHzmMxB3TreAzt8NAidz+ht2mrFQEJ0+Kz+AhhGa47Smb2eywcygWgoKXhe7DFCsk1FQ==", + "version": "3.12.19", + "resolved": "https://registry.npmjs.org/@cypress/code-coverage/-/code-coverage-3.12.19.tgz", + "integrity": "sha512-RNpgESArIwX2PG7k0KEb941eSYSBEGF1WB5NPeWrVJMX6KeAxj3Ki5aeYlFeV+wxoAJ+7gcF4s5xV18BQLCpjQ==", "dev": true, "dependencies": { "@cypress/webpack-preprocessor": "^6.0.0", @@ -1985,74 +2017,33 @@ "node": ">=8" } }, - "node_modules/@cypress/listr-verbose-renderer": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@cypress/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz", - "integrity": "sha512-EDiBsVPWC27DDLEJCo+dpl9ODHhdrwU57ccr9tspwCdG2ni0QVkf6LF0FGbhfujcjPxnXLIwsaks4sOrwrA4Qw==", - "dev": true, - "dependencies": { - "chalk": "^1.1.3", - "cli-cursor": "^1.0.2", - "date-fns": "^1.27.2", - "figures": "^1.7.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@cypress/listr-verbose-renderer/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@cypress/listr-verbose-renderer/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@cypress/listr-verbose-renderer/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@cypress/listr-verbose-renderer/node_modules/strip-ansi": { + "node_modules/@cypress/request": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", + "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", "dev": true, "dependencies": { - "ansi-regex": "^2.0.0" + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "http-signature": "~1.3.6", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "performance-now": "^2.1.0", + "qs": "6.10.4", + "safe-buffer": "^5.1.2", + "tough-cookie": "^4.1.3", + "tunnel-agent": "^0.6.0", + "uuid": "^8.3.2" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@cypress/listr-verbose-renderer/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, - "engines": { - "node": ">=0.8.0" + "node": ">= 6" } }, "node_modules/@cypress/webpack-preprocessor": { @@ -2651,27 +2642,168 @@ "npm": ">= 3.0.0" } }, - "node_modules/@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "node_modules/@puppeteer/browsers": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.4.6.tgz", + "integrity": "sha512-x4BEjr2SjOPowNeiguzjozQbsc6h437ovD/wu+JpaenxVLm3jkgzHY2xOslMTp50HoTvQreMjiexiGQw1sqZlQ==", + "dev": true, + "dependencies": { + "debug": "4.3.4", + "extract-zip": "2.0.1", + "progress": "2.0.3", + "proxy-agent": "6.3.0", + "tar-fs": "3.0.4", + "unbzip2-stream": "1.4.3", + "yargs": "17.7.1" + }, + "bin": { + "browsers": "lib/cjs/main-cli.js" + }, + "engines": { + "node": ">=16.3.0" + }, + "peerDependencies": { + "typescript": ">= 4.7.4" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@puppeteer/browsers/node_modules/yargs": { + "version": "17.7.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz", + "integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@sentry/core": { + "version": "6.19.7", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.19.7.tgz", + "integrity": "sha512-tOfZ/umqB2AcHPGbIrsFLcvApdTm9ggpi/kQZFkej7kMphjT+SGBiQfYtjyg9jcRW+ilAR4JXC9BGKsdEQ+8Vw==", + "dev": true, + "dependencies": { + "@sentry/hub": "6.19.7", + "@sentry/minimal": "6.19.7", + "@sentry/types": "6.19.7", + "@sentry/utils": "6.19.7", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/core/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@sentry/hub": { + "version": "6.19.7", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.19.7.tgz", + "integrity": "sha512-y3OtbYFAqKHCWezF0EGGr5lcyI2KbaXW2Ik7Xp8Mu9TxbSTuwTe4rTntwg8ngPjUQU3SUHzgjqVB8qjiGqFXCA==", "dev": true, + "dependencies": { + "@sentry/types": "6.19.7", + "@sentry/utils": "6.19.7", + "tslib": "^1.9.3" + }, "engines": { "node": ">=6" } }, - "node_modules/@szmarczak/http-timer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "node_modules/@sentry/hub/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@sentry/minimal": { + "version": "6.19.7", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.19.7.tgz", + "integrity": "sha512-wcYmSJOdvk6VAPx8IcmZgN08XTXRwRtB1aOLZm+MVHjIZIhHoBGZJYTVQS/BWjldsamj2cX3YGbGXNunaCfYJQ==", + "dev": true, + "dependencies": { + "@sentry/hub": "6.19.7", + "@sentry/types": "6.19.7", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/minimal/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@sentry/node": { + "version": "6.19.7", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-6.19.7.tgz", + "integrity": "sha512-gtmRC4dAXKODMpHXKfrkfvyBL3cI8y64vEi3fDD046uqYcrWdgoQsffuBbxMAizc6Ez1ia+f0Flue6p15Qaltg==", + "dev": true, + "dependencies": { + "@sentry/core": "6.19.7", + "@sentry/hub": "6.19.7", + "@sentry/types": "6.19.7", + "@sentry/utils": "6.19.7", + "cookie": "^0.4.1", + "https-proxy-agent": "^5.0.0", + "lru_map": "^0.3.3", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/node/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@sentry/types": { + "version": "6.19.7", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.19.7.tgz", + "integrity": "sha512-jH84pDYE+hHIbVnab3Hr+ZXr1v8QABfhx39KknxqKWr2l0oEItzepV0URvbEhB446lk/S/59230dlUUIBGsXbg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/utils": { + "version": "6.19.7", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.19.7.tgz", + "integrity": "sha512-z95ECmE3i9pbWoXQrD/7PgkBAzJYR+iXtPuTkpBjDKs86O3mT+PXOT3BAn79w2wkn7/i3vOGD2xVr1uiMl26dA==", "dev": true, "dependencies": { - "defer-to-connect": "^1.0.1" + "@sentry/types": "6.19.7", + "tslib": "^1.9.3" }, "engines": { "node": ">=6" } }, + "node_modules/@sentry/utils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/@tinymce/tinymce-vue": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tinymce/tinymce-vue/-/tinymce-vue-2.0.0.tgz", @@ -2681,6 +2813,12 @@ "vue": "^2.5.17" } }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "dev": true + }, "node_modules/@types/eslint": { "version": "8.56.1", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.1.tgz", @@ -2726,6 +2864,12 @@ "undici-types": "~5.26.4" } }, + "node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz", + "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", + "dev": true + }, "node_modules/@types/sizzle": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz", @@ -3189,54 +3333,40 @@ "ajv": "^6.9.1" } }, - "node_modules/ansi-align": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", - "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", - "dev": true, - "dependencies": { - "string-width": "^4.1.0" - } - }, - "node_modules/ansi-align/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/ansi-align/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "type-fest": "^0.21.3" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-escapes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha512-wiXutNjDUlNEDWHcYH3jtZUhd3c4/VojassD8zHdHCY13xbZy2XbW+NKQwA0tWGBVzDA9qEzYwfoSsWmviidhw==", + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-regex": { @@ -3286,10 +3416,24 @@ } }, "node_modules/arch": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/arch/-/arch-2.1.1.tgz", - "integrity": "sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg==", - "dev": true + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", + "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/archy": { "version": "1.0.0", @@ -3438,20 +3582,47 @@ "node": ">=0.8" } }, - "node_modules/async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", "dev": true, "dependencies": { - "lodash": "^4.17.10" + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" } }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/async": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", + "dev": true + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -3479,9 +3650,9 @@ "dev": true }, "node_modules/axe-core": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.2.3.tgz", - "integrity": "sha512-pXnVMfJKSIWU2Ml4JHP7pZEPIrgBO1Fd3WGx+fPBsS+KRGhE4vxooD8XBGWbQOIVSZsVK7pUDBBkCicNu80yzQ==", + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.2.tgz", + "integrity": "sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g==", "dev": true, "engines": { "node": ">=4" @@ -3531,6 +3702,12 @@ "node": ">= 6" } }, + "node_modules/b4a": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", + "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==", + "dev": true + }, "node_modules/babel-core": { "version": "7.0.0-bridge.0", "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz", @@ -3642,6 +3819,15 @@ } ] }, + "node_modules/basic-ftp": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.4.tgz", + "integrity": "sha512-8PzkB0arJFV4jJWSGOYR+OEic6aeKMu/osRhBULN6RY0ykby6LKhbmuQ5ublvaas5BOwboah5D87nrHyuh8PPA==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -3694,19 +3880,11 @@ "readable-stream": "^3.4.0" } }, - "node_modules/bl/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } + "node_modules/blob-util": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", + "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", + "dev": true }, "node_modules/bluebird": { "version": "3.7.1", @@ -3753,122 +3931,10 @@ "vue-functional-data-merge": "^3.1.0" } }, - "node_modules/boxen": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", - "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", - "dev": true, - "dependencies": { - "ansi-align": "^3.0.0", - "camelcase": "^5.3.1", - "chalk": "^3.0.0", - "cli-boxes": "^2.2.0", - "string-width": "^4.1.0", - "term-size": "^2.1.0", - "type-fest": "^0.8.1", - "widest-line": "^3.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/boxen/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/boxen/node_modules/chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/boxen/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/boxen/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/boxen/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/boxen/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/boxen/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/boxen/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/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { "balanced-match": "^1.0.0", @@ -3954,57 +4020,16 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" - }, - "node_modules/cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", - "dev": true, - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cacheable-request/node_modules/json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==", - "dev": true - }, - "node_modules/cacheable-request/node_modules/keyv": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", - "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", - "dev": true, - "dependencies": { - "json-buffer": "3.0.0" - } - }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true, - "engines": { - "node": ">=8" - } + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "peer": true }, "node_modules/cachedir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-1.3.0.tgz", - "integrity": "sha512-O1ji32oyON9laVPJL1IZ5bmwd2cB46VfpxkDequezH+15FDzzVddEyrGEeX4WusDSqKxdyFdDQDEG1yo1GoWkg==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", + "integrity": "sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==", "dev": true, - "dependencies": { - "os-homedir": "^1.0.1" + "engines": { + "node": ">=6" } }, "node_modules/caching-transform": { @@ -4092,15 +4117,6 @@ "node": ">=4" } }, - "node_modules/charenc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/check-more-types": { "version": "2.24.0", "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", @@ -4162,9 +4178,9 @@ "dev": true }, "node_modules/chrome-launcher": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/chrome-launcher/-/chrome-launcher-0.14.2.tgz", - "integrity": "sha512-Nk8DUCIfPR6p9WClPPFeP2ztpAdkT8xueoiDS03csea1uoJjm4w0p5Oy1hjykyjT1EQ0MMrEshLD3C8gHXyiZw==", + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/chrome-launcher/-/chrome-launcher-0.15.2.tgz", + "integrity": "sha512-zdLEwNo3aUVzIhKhTtXfxhdvZhUghrnmkvcAq2NoDd+LeOHKf03H5jwZ8T/STsAlzyALkBVK552iaG1fGf1xVQ==", "dev": true, "dependencies": { "@types/node": "*", @@ -4172,6 +4188,9 @@ "is-wsl": "^2.2.0", "lighthouse-logger": "^1.0.0" }, + "bin": { + "print-chrome-path": "bin/print-chrome-path.js" + }, "engines": { "node": ">=12.13.0" } @@ -4197,11 +4216,32 @@ "node": ">=6.0" } }, + "node_modules/chromium-bidi": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.16.tgz", + "integrity": "sha512-7ZbXdWERxRxSwo3txsBjjmc/NLxqb1Bk30mRb0BMS4YIaiV6zvKZqL/UAH+DdqcDYayDWk2n/y8klkBDODrPvA==", + "dev": true, + "dependencies": { + "mitt": "3.0.0" + }, + "peerDependencies": { + "devtools-protocol": "*" + } + }, "node_modules/ci-info": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", - "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", - "dev": true + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } }, "node_modules/clean-stack": { "version": "2.2.0", @@ -4212,105 +4252,61 @@ "node": ">=6" } }, - "node_modules/cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/cli-cursor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "integrity": "sha512-25tABq090YNKkF6JH7lcwO0zFJTRke4Jcq9iX2nr/Sz0Cjjv4gckmwlW6Ty/aoyFd6z3ysR2hMGC2GFugmBo6A==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "dependencies": { - "restore-cursor": "^1.0.1" + "restore-cursor": "^3.1.0" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/cli-spinners": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-0.1.2.tgz", - "integrity": "sha512-t22oC6e068eEBQ86SO3arUtd1ojcA3/lz3Fp2g/oL/lmDlFz/2yD8JHiebeCGYmoAovYpwKq4T64Uq5j+28Q9w==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/cli-truncate": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz", - "integrity": "sha512-f4r4yJnbT++qUPI9NR4XLDLq41gQ+uqnPItWG0F5ZkehuNiTTa3EY0S4AqTSUOeJ7/zU41oWPQSNkW5BqPL9bg==", + "node_modules/cli-table3": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", + "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", "dev": true, "dependencies": { - "slice-ansi": "0.0.4", - "string-width": "^1.0.1" + "string-width": "^4.2.0" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/cliui/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" } }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" }, "engines": { "node": ">=8" - } - }, - "node_modules/clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, "node_modules/color-convert": { @@ -4328,6 +4324,12 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -4340,10 +4342,13 @@ } }, "node_modules/commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "engines": { + "node": ">= 6" + } }, "node_modules/common-path-prefix": { "version": "3.0.0", @@ -4373,21 +4378,6 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "engines": [ - "node >= 0.8" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, "node_modules/condense-newlines": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/condense-newlines/-/condense-newlines-0.2.1.tgz", @@ -4460,9 +4450,9 @@ "dev": true }, "node_modules/cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha512-+IJOX0OqlHCszo2mBUq+SrEbCj6w7Kpffqx60zYbPTFaO4+yYgRjHwcZNpWvaTylDHaV7PPmBHzSecZiMhtPgw==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "dev": true, "engines": { "node": ">= 0.6" @@ -4494,11 +4484,20 @@ } }, "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", "dev": true }, + "node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dev": true, + "dependencies": { + "node-fetch": "^2.6.12" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -4513,15 +4512,6 @@ "node": ">= 8" } }, - "node_modules/crypt": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -4532,9 +4522,9 @@ } }, "node_modules/csp_evaluator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/csp_evaluator/-/csp_evaluator-1.1.0.tgz", - "integrity": "sha512-TcB+ZH9wZBG314jAUpKHPl1oYbRJV+nAT2YwZ9y4fmUN0FkEJa8e/hKZoOgzLYp1Z/CJdFhbhhGIGh0XG8W54Q==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/csp_evaluator/-/csp_evaluator-1.1.1.tgz", + "integrity": "sha512-N3ASg0C4kNPUaNxt1XAvzHIVuzdtr8KLgfk1O8WDyimp1GisPAHESupArO2ieHk9QWbrJ/WkQODyh21Ps/xhxw==", "dev": true }, "node_modules/css-loader": { @@ -4635,236 +4625,204 @@ "node": ">=4" } }, - "node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - }, - "node_modules/cssstyle": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.1.tgz", - "integrity": "sha512-7DYm8qe+gPx/h77QlCyFmX80+fGaE/6A/Ekl0zaszYOubvySO2saYFdQ78P29D0UsULxFKCetDGNaNRUdSF+2A==", - "dev": true, - "dependencies": { - "cssom": "0.3.x" - } - }, "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/cypress": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.8.3.tgz", - "integrity": "sha512-I9L/d+ilTPPA4vq3NC1OPKmw7jJIpMKNdyfR8t1EXYzYCjyqbc59migOm1YSse/VRbISLJ+QGb5k4Y3bz2lkYw==", + "version": "13.6.3", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.3.tgz", + "integrity": "sha512-d/pZvgwjAyZsoyJ3FOsJT5lDsqnxQ/clMqnNc++rkHjbkkiF2h9s0JsZSyyH4QXhVFW3zPFg82jD25roFLOdZA==", "dev": true, "hasInstallScript": true, "dependencies": { - "@cypress/listr-verbose-renderer": "0.4.1", - "@cypress/xvfb": "1.2.4", - "@types/sizzle": "2.3.2", - "arch": "2.1.1", - "bluebird": "3.5.0", - "cachedir": "1.3.0", - "chalk": "2.4.2", - "check-more-types": "2.24.0", - "commander": "2.15.1", - "common-tags": "1.8.0", - "debug": "3.2.6", - "eventemitter2": "4.1.2", - "execa": "0.10.0", - "executable": "4.1.1", - "extract-zip": "1.6.7", - "fs-extra": "5.0.0", - "getos": "3.1.1", - "is-ci": "1.2.1", - "is-installed-globally": "0.1.0", - "lazy-ass": "1.6.0", - "listr": "0.12.0", - "lodash": "4.17.15", - "log-symbols": "2.2.0", - "minimist": "1.2.0", - "moment": "2.24.0", - "ramda": "0.24.1", - "request": "2.88.0", - "request-progress": "3.0.0", - "supports-color": "5.5.0", - "tmp": "0.1.0", - "untildify": "3.0.3", - "url": "0.11.0", - "yauzl": "2.10.0" + "@cypress/request": "^3.0.0", + "@cypress/xvfb": "^1.2.4", + "@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", + "cachedir": "^2.3.0", + "chalk": "^4.1.0", + "check-more-types": "^2.24.0", + "cli-cursor": "^3.1.0", + "cli-table3": "~0.6.1", + "commander": "^6.2.1", + "common-tags": "^1.8.0", + "dayjs": "^1.10.4", + "debug": "^4.3.4", + "enquirer": "^2.3.6", + "eventemitter2": "6.4.7", + "execa": "4.1.0", + "executable": "^4.1.1", + "extract-zip": "2.0.1", + "figures": "^3.2.0", + "fs-extra": "^9.1.0", + "getos": "^3.2.1", + "is-ci": "^3.0.0", + "is-installed-globally": "~0.4.0", + "lazy-ass": "^1.6.0", + "listr2": "^3.8.3", + "lodash": "^4.17.21", + "log-symbols": "^4.0.0", + "minimist": "^1.2.8", + "ospath": "^1.2.2", + "pretty-bytes": "^5.6.0", + "process": "^0.11.10", + "proxy-from-env": "1.0.0", + "request-progress": "^3.0.0", + "semver": "^7.5.3", + "supports-color": "^8.1.1", + "tmp": "~0.2.1", + "untildify": "^4.0.0", + "yauzl": "^2.10.0" }, "bin": { "cypress": "bin/cypress" }, "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/cypress-audit": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cypress-audit/-/cypress-audit-1.1.0.tgz", - "integrity": "sha512-W/GvSOOYfI1zq+pyO3T9Juo4xCPBPbMkUZWApxsuD9r/g/fy9aonK1K7NiOYG0aMsL0PILl6Na5VAGS1CYOGlg==", - "dev": true, - "dependencies": { - "lighthouse": "^8.5.1", - "pa11y": "^6.0.1" + "node": "^16.0.0 || ^18.0.0 || >=20.0.0" } }, "node_modules/cypress-wait-until": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/cypress-wait-until/-/cypress-wait-until-1.7.2.tgz", - "integrity": "sha512-uZ+M8/MqRcpf+FII/UZrU7g1qYZ4aVlHcgyVopnladyoBrpoaMJ4PKZDrdOJ05H5RHbr7s9Tid635X3E+ZLU/Q==", - "dev": true - }, - "node_modules/cypress/node_modules/bluebird": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", - "integrity": "sha512-3LE8m8bqjGdoxfvf71yhFNrUcwy3NLy00SAo+b6MfJ8l+Bc2DzQ7mUHwX6pjK2AxfgV+YfsjCeVW3T5HLQTBsQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/cypress-wait-until/-/cypress-wait-until-3.0.1.tgz", + "integrity": "sha512-kpoa8yL6Bi/JNsThGBbrrm7g4SNzYyBUv9M5pF6/NTVm/ClY0HnJzeuWnHiAUZKIZ5l86Oedb12wQyjx7/CWPg==", "dev": true }, - "node_modules/cypress/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "node_modules/cypress/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": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4.8" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/cypress/node_modules/debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } + "node_modules/cypress/node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true }, - "node_modules/cypress/node_modules/execa": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", - "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "node_modules/cypress/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": { - "cross-spawn": "^6.0.0", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/cypress/node_modules/get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==", + "node_modules/cypress/node_modules/chalk/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": ">=4" + "node": ">=8" } }, - "node_modules/cypress/node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "node_modules/cypress/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": ">=0.10.0" + "node": ">=7.0.0" } }, - "node_modules/cypress/node_modules/lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "node_modules/cypress/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/node_modules/moment": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", - "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==", + "node_modules/cypress/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": "*" + "node": ">=8" } }, - "node_modules/cypress/node_modules/npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", + "node_modules/cypress/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "path-key": "^2.0.0" + "yallist": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" } }, - "node_modules/cypress/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", - "dev": true, - "engines": { - "node": ">=4" - } + "node_modules/cypress/node_modules/proxy-from-env": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", + "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", + "dev": true }, "node_modules/cypress/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/cypress/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { - "shebang-regex": "^1.0.0" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/cypress/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, - "node_modules/cypress/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "node_modules/cypress/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { - "isexe": "^2.0.0" + "has-flag": "^4.0.0" }, - "bin": { - "which": "bin/which" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/cypress/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -4877,11 +4835,14 @@ "node": ">=0.10" } }, - "node_modules/date-fns": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz", - "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==", - "dev": true + "node_modules/data-uri-to-buffer": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.1.tgz", + "integrity": "sha512-MZd3VlchQkp8rdend6vrx7MmVDJzSNTBvghvKjirLkD+WTChA3KUf0jkE68Q4UyctNqI11zZO9/x2Yx+ub5Cvg==", + "dev": true, + "engines": { + "node": ">= 14" + } }, "node_modules/dayjs": { "version": "1.11.10", @@ -4921,27 +4882,6 @@ "node": ">=0.10.0" } }, - "node_modules/decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==", - "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -4972,12 +4912,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/defer-to-connect": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", - "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", - "dev": true - }, "node_modules/define-data-property": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", @@ -4991,6 +4925,15 @@ "node": ">= 0.4" } }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/define-properties": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", @@ -5008,6 +4951,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "dev": true, + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -5017,9 +4974,9 @@ } }, "node_modules/devtools-protocol": { - "version": "0.0.869402", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.869402.tgz", - "integrity": "sha512-VvlVYY+VDJe639yHs5PHISzdWTLL3Aw8rO4cvUtwvoxFd6FHbE4OpHHcde52M6096uYYazAmd4l0o5VuFRO2WA==", + "version": "0.0.1155343", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1155343.tgz", + "integrity": "sha512-oD9vGBV2wTc7fAzAM6KC0chSgs234V8+qDEeK+mcbRj2UvcuA7lgBztGi/opj/iahcXD3BSj8Ymvib628yy9FA==", "dev": true }, "node_modules/dir-glob": { @@ -5034,6 +4991,15 @@ "node": ">=8" } }, + "node_modules/dir-glob/node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -5064,12 +5030,6 @@ "node": ">=8" } }, - "node_modules/duplexer3": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz", - "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==", - "dev": true - }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -5175,15 +5135,6 @@ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.625.tgz", "integrity": "sha512-DENMhh3MFgaPDoXWrVIqSPInQoLImywfCwrSmVl3cf9QHzoZSiutHwGaB/Ql3VkqcQV30rzgdM+BjKqBAJxo5Q==" }, - "node_modules/elegant-spinner": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz", - "integrity": "sha512-B+ZM+RXvRqQaAmkMlO/oSe5nMUOaUnyfGYCEHoR8wrXsZR2mA0XVibsxV1bvTwxdRWah1PkQqso2EzhILGHtEQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -5410,15 +5361,6 @@ "node": ">=6" } }, - "node_modules/escape-goat": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", - "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -5428,6 +5370,36 @@ "node": ">=0.8.0" } }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/escodegen/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/eslint": { "version": "8.56.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", @@ -5560,6 +5532,45 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-plugin-cypress": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.15.1.tgz", + "integrity": "sha512-eLHLWP5Q+I4j2AWepYq0PgFEei9/s5LvjuSqWrxurkg1YZ8ltxdvMNmdSf0drnsNo57CTgYY/NIHHLRSWejR7w==", + "dev": true, + "dependencies": { + "globals": "^13.20.0" + }, + "peerDependencies": { + "eslint": ">= 3.2.1" + } + }, + "node_modules/eslint-plugin-cypress/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-cypress/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-plugin-import": { "version": "2.29.1", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", @@ -6030,9 +6041,9 @@ } }, "node_modules/eventemitter2": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-4.1.2.tgz", - "integrity": "sha512-erx0niBaTi8B7ywjGAcg8ilGNRl/xs/o4MO2ZMpRlpZ62mYzjGTBlOpxxRIrPQqBs9mbXkEux6aR+Sc5vQ/wUw==", + "version": "6.4.7", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", + "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", "dev": true }, "node_modules/events": { @@ -6079,15 +6090,6 @@ "node": ">=4" } }, - "node_modules/exit-hook": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "integrity": "sha512-MsG3prOVw1WtLXAZbM3KiYtooKR1LvxHh3VHsVtIy0uiUu8usxgB/94DP2HxtD/661lLdB6yzQ09lGJSQr6nkg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/expr-eval": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/expr-eval/-/expr-eval-2.0.2.tgz", @@ -6113,57 +6115,29 @@ } }, "node_modules/extract-zip": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", - "integrity": "sha512-NWFb/0zxv3qh7f6hEy+F+Y+jPAqt1bfT52GR8Vi7sEFg2fBZlG/aM6ZrSGPUscP0I4JRhtgVG6I17HOuD7GESw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, "dependencies": { - "concat-stream": "1.6.2", - "debug": "2.6.9", - "mkdirp": "0.5.1", - "yauzl": "2.4.1" + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" }, "bin": { "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" } }, - "node_modules/extract-zip/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/extract-zip/node_modules/fd-slicer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", - "integrity": "sha512-MX1ZLPIuKED51hrI4++K+1B0VX87Cs4EkybD2q12Ysuf5p4vkmHqMvQJRlDwROqFr4D2Pzyit5wGQxf30grIcw==", - "dev": true, - "dependencies": { - "pend": "~1.2.0" - } - }, - "node_modules/extract-zip/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/extract-zip/node_modules/yauzl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", - "integrity": "sha512-TXNR2Feu/p/8k5YRy4z45wCUhoncIrZywmRd+xW0IvB3lWTAM7F6wVbeJvRjO0dplQ8oqmJEj/TpJuULBV/hbw==", - "dev": true, - "dependencies": { - "fd-slicer": "~1.0.1" - } - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", "dev": true, "engines": [ "node >=0.6.0" @@ -6180,6 +6154,12 @@ "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "dev": true + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -6238,16 +6218,18 @@ } }, "node_modules/figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "dependencies": { - "escape-string-regexp": "^1.0.5", - "object-assign": "^4.1.0" + "escape-string-regexp": "^1.0.5" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/file-entry-cache": { @@ -6449,14 +6431,18 @@ "dev": true }, "node_modules/fs-extra": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", - "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" } }, "node_modules/fs.realpath": { @@ -6586,13 +6572,60 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-uri": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.2.tgz", + "integrity": "sha512-5KLucCJobh8vBY1K07EFV4+cPZH3mrV9YeAruUseCQKHB58SGjjT2l9/eA9LD082IiuMjSlFJEcdJ27TXvbZNw==", + "dev": true, + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.0", + "debug": "^4.3.4", + "fs-extra": "^8.1.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/get-uri/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/get-uri/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/get-uri/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/getos": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/getos/-/getos-3.1.1.tgz", - "integrity": "sha512-oUP1rnEhAr97rkitiszGP9EgDVYnmchgFzfqRzSkgtfv7ai6tEi7Ko8GgjNXts7VLWEqrTWyhsOKLe5C5b/Zkg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", + "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", "dev": true, "dependencies": { - "async": "2.6.1" + "async": "^3.2.0" } }, "node_modules/getpass": { @@ -6643,15 +6676,27 @@ "peer": true }, "node_modules/global-dirs": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", - "integrity": "sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", "dev": true, "dependencies": { - "ini": "^1.3.4" + "ini": "2.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/global-dirs/node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true, + "engines": { + "node": ">=10" } }, "node_modules/globals": { @@ -6709,40 +6754,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/got": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", - "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/got/node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -6754,56 +6765,12 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "dev": true, - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/harmony-reflect": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/harmony-reflect/-/harmony-reflect-1.6.2.tgz", "integrity": "sha512-HIp/n38R9kQjDEziXyDTuW3vvoxxyxjxFzXLrBr18uB47GnSt+G9D29fqrpM5ZkspMcPICud3XsBJQ4Y2URg8g==", "dev": true }, - "node_modules/has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-ansi/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -6869,15 +6836,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-yarn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", - "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/hash-sum": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz", @@ -6943,31 +6901,52 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "dev": true - }, "node_modules/http-link-header": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/http-link-header/-/http-link-header-0.8.0.tgz", - "integrity": "sha512-qsh/wKe1Mk1vtYEFr+LpQBFWTO1gxZQBdii2D0Umj+IUQ23r5sT088Rhpq4XzpSyIpaX7vwjB8Rrtx8u9JTg+Q==", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-link-header/-/http-link-header-1.1.1.tgz", + "integrity": "sha512-mW3N/rTYpCn99s1do0zx6nzFZSwLH9HGfUM4ZqLWJ16ylmYaC2v5eYGqrNTQlByx8AzUgGI+V/32gXPugs1+Sw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", + "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", + "dev": true, + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } }, "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.3.6.tgz", + "integrity": "sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==", "dev": true, "dependencies": { "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" + "jsprim": "^2.0.2", + "sshpk": "^1.14.1" }, "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" + "node": ">=0.10" } }, "node_modules/https-proxy-agent": { @@ -7090,15 +7069,6 @@ "node": ">=4" } }, - "node_modules/import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -7108,18 +7078,6 @@ "node": ">=0.8.19" } }, - "node_modules/indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha512-aqwDFWSgSgfRaEwao5lg5KEcVd/2a+D1rvoG7NdilmYz0NwRk6StWpWdz/Hpk34MKPpx7s8XxUqimfcQK6gGlg==", - "dev": true, - "dependencies": { - "repeating": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -7177,6 +7135,12 @@ "deprecated": "We've written a new parser that's 6x faster and is backwards compatible. Please use @formatjs/icu-messageformat-parser", "dev": true }, + "node_modules/ip": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", + "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", + "dev": true + }, "node_modules/is": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", @@ -7273,12 +7237,12 @@ } }, "node_modules/is-ci": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", - "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", + "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", "dev": true, "dependencies": { - "ci-info": "^1.5.0" + "ci-info": "^3.2.0" }, "bin": { "is-ci": "bin.js" @@ -7344,28 +7308,13 @@ "node": ">=0.10.0" } }, - "node_modules/is-finite": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", - "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", - "dev": true, - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "dependencies": { - "number-is-nan": "^1.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/is-generator-function": { @@ -7395,28 +7344,19 @@ } }, "node_modules/is-installed-globally": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", - "integrity": "sha512-ERNhMg+i/XgDwPIPF3u24qpajVreaiSuvpb1Uu0jugw7KKcxGyCX8cgp8P5fwTmAuXku6beDHHECdKArjlg7tw==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", "dev": true, "dependencies": { - "global-dirs": "^0.1.0", - "is-path-inside": "^1.0.0" + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" }, "engines": { - "node": ">=4" - } - }, - "node_modules/is-installed-globally/node_modules/is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha512-qhsCR/Esx4U4hg/9I19OVUAJkGWtjRYHMRgUMZE2TDdj+Ag+kttZanLupfddNyglzz50cUlmWzUaI37GDfNx/g==", - "dev": true, - "dependencies": { - "path-is-inside": "^1.0.1" + "node": ">=10" }, - "engines": { - "node": ">=0.10.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-negative-zero": { @@ -7431,15 +7371,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-npm": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", - "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -7482,12 +7413,6 @@ "node": ">=8" } }, - "node_modules/is-promise": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", - "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", - "dev": true - }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -7578,6 +7503,18 @@ "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", @@ -7620,18 +7557,6 @@ "node": ">=8" } }, - "node_modules/is-yarn-global": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", - "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", - "dev": true - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -8074,27 +7999,30 @@ } }, "node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz", + "integrity": "sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==", "dev": true, + "engines": [ + "node >=0.6.0" + ], "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", "json-schema": "0.4.0", "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" } }, "node_modules/keyv": { @@ -8127,18 +8055,6 @@ "node": ">=6" } }, - "node_modules/latest-version": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", - "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", - "dev": true, - "dependencies": { - "package-json": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/lazy-ass": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", @@ -8162,49 +8078,46 @@ } }, "node_modules/lighthouse": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/lighthouse/-/lighthouse-8.6.0.tgz", - "integrity": "sha512-/H7aDL3//Gr0M1v8GGq6k0OTNty7nDVuU/o1cg6opYkfHRz1V3Nhydqz6aBzfXhUQx6iJRnxgRCPya+ZLA2vbg==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/lighthouse/-/lighthouse-10.4.0.tgz", + "integrity": "sha512-XQWHEWkJ8YxSPsxttBJORy5+hQrzbvGkYfeP3fJjyYKioWkF2MXfFqNK4ZuV4jL8pBu7Z91qnQP6In0bq1yXww==", "dev": true, "dependencies": { - "axe-core": "4.2.3", - "chrome-launcher": "^0.14.0", + "@sentry/node": "^6.17.4", + "axe-core": "4.7.2", + "chrome-launcher": "^0.15.2", "configstore": "^5.0.1", - "csp_evaluator": "1.1.0", - "cssstyle": "1.2.1", + "csp_evaluator": "1.1.1", + "devtools-protocol": "0.0.1155343", "enquirer": "^2.3.6", - "http-link-header": "^0.8.0", + "http-link-header": "^1.1.1", "intl-messageformat": "^4.4.0", - "jpeg-js": "^0.4.1", - "js-library-detector": "^6.4.0", - "lighthouse-logger": "^1.3.0", - "lighthouse-stack-packs": "^1.5.0", - "lodash.clonedeep": "^4.5.0", - "lodash.get": "^4.4.2", - "lodash.isequal": "^4.5.0", - "lodash.set": "^4.3.2", - "lookup-closest-locale": "6.0.4", - "metaviewport-parser": "0.2.0", - "open": "^6.4.0", + "jpeg-js": "^0.4.4", + "js-library-detector": "^6.6.0", + "lighthouse-logger": "^1.4.1", + "lighthouse-stack-packs": "1.11.0", + "lodash": "^4.17.21", + "lookup-closest-locale": "6.2.0", + "metaviewport-parser": "0.3.0", + "open": "^8.4.0", "parse-cache-control": "1.0.1", - "ps-list": "^7.2.0", - "raven": "^2.2.1", - "robots-parser": "^2.0.1", + "ps-list": "^8.0.0", + "puppeteer-core": "^20.8.0", + "robots-parser": "^3.0.0", "semver": "^5.3.0", "speedline-core": "^1.4.3", - "third-party-web": "^0.12.4", - "update-notifier": "^4.1.0", + "third-party-web": "^0.23.3", "ws": "^7.0.0", - "yargs": "^16.1.1", - "yargs-parser": "^20.2.4" + "yargs": "^17.3.1", + "yargs-parser": "^21.0.0" }, "bin": { - "chrome-debug": "lighthouse-core/scripts/manual-chrome-launcher.js", - "lighthouse": "lighthouse-cli/index.js", - "smokehouse": "lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js" + "chrome-debug": "core/scripts/manual-chrome-launcher.js", + "lighthouse": "cli/index.js", + "smokehouse": "cli/test/smokehouse/frontends/smokehouse-bin.js" }, "engines": { - "node": ">=12.20.0 12 || >=14.13 14 || >=15" + "node": ">=16.16" } }, "node_modules/lighthouse-logger": { @@ -8233,9 +8146,9 @@ "dev": true }, "node_modules/lighthouse-stack-packs": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/lighthouse-stack-packs/-/lighthouse-stack-packs-1.12.1.tgz", - "integrity": "sha512-i4jTmg7tvZQFwNFiwB+nCK6a7ICR68Xcwo+VIVd6Spi71vBNFUlds5HiDrSbClZdkQDON2Bhqv+KKJIo5zkPeA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/lighthouse-stack-packs/-/lighthouse-stack-packs-1.11.0.tgz", + "integrity": "sha512-sRr0z1S/I26VffRLq9KJsKtLk856YrJlNGmcJmbLX8dFn3MuzVPUbstuChEhqnSxZb8TZmVfthuXuwhG9vRoSw==", "dev": true }, "node_modules/lighthouse/node_modules/semver": { @@ -8247,281 +8160,31 @@ "semver": "bin/semver" } }, - "node_modules/listr": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/listr/-/listr-0.12.0.tgz", - "integrity": "sha512-5GlrcOoGOBd/hFSI7hMvVXb+5jFMVc17e1VQzpa7VJna1SDTYSCrCpqBQUkuWW18xibTR+PQndjVtuEBKtOWVw==", - "dev": true, - "dependencies": { - "chalk": "^1.1.3", - "cli-truncate": "^0.2.1", - "figures": "^1.7.0", - "indent-string": "^2.1.0", - "is-promise": "^2.1.0", - "is-stream": "^1.1.0", - "listr-silent-renderer": "^1.1.1", - "listr-update-renderer": "^0.2.0", - "listr-verbose-renderer": "^0.4.0", - "log-symbols": "^1.0.2", - "log-update": "^1.0.2", - "ora": "^0.2.3", - "p-map": "^1.1.1", - "rxjs": "^5.0.0-beta.11", - "stream-to-observable": "^0.1.0", - "strip-ansi": "^3.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr-silent-renderer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz", - "integrity": "sha512-L26cIFm7/oZeSNVhWB6faeorXhMg4HNlb/dS/7jHhr708jxlXrtrBWo4YUxZQkc6dGoxEAe6J/D3juTRBUzjtA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr-update-renderer": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.2.0.tgz", - "integrity": "sha512-0G/CLBomVga7gpCMHw5Adg9kafRz0HDAOxa1GrWywXr1oNYRW/n4pPy7xF/hniRCLRCorZMCxaMGSmgsp1QHsA==", - "dev": true, - "dependencies": { - "chalk": "^1.1.3", - "cli-truncate": "^0.2.1", - "elegant-spinner": "^1.0.1", - "figures": "^1.7.0", - "indent-string": "^3.0.0", - "log-symbols": "^1.0.2", - "log-update": "^1.0.2", - "strip-ansi": "^3.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr-update-renderer/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-update-renderer/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-update-renderer/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-update-renderer/node_modules/indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr-update-renderer/node_modules/log-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", - "integrity": "sha512-mmPrW0Fh2fxOzdBbFv4g1m6pR72haFLPJ2G5SJEELf1y+iaQrDG6cWCPjy54RHYbZAt7X+ls690Kw62AdWXBzQ==", - "dev": true, - "dependencies": { - "chalk": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-update-renderer/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-update-renderer/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/listr-verbose-renderer": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz", - "integrity": "sha512-tWEhvyB9UUq+4fkEwQ2NQK2JfYhsc3slSeYRkuc9CiJ3GFMRa5CRUcmqo+IIF+L95uZqv5dzZDC6vCggC28C0g==", + "node_modules/listr2": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", + "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", "dev": true, "dependencies": { - "chalk": "^1.1.3", - "cli-cursor": "^1.0.2", - "date-fns": "^1.27.2", - "figures": "^1.7.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr-verbose-renderer/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-verbose-renderer/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-verbose-renderer/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-verbose-renderer/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" + "cli-truncate": "^2.1.0", + "colorette": "^2.0.16", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rfdc": "^1.3.0", + "rxjs": "^7.5.1", + "through": "^2.3.8", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-verbose-renderer/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/listr/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "node": ">=10.0.0" }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr/node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr/node_modules/log-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", - "integrity": "sha512-mmPrW0Fh2fxOzdBbFv4g1m6pR72haFLPJ2G5SJEELf1y+iaQrDG6cWCPjy54RHYbZAt7X+ls690Kw62AdWXBzQ==", - "dev": true, - "dependencies": { - "chalk": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" + "peerDependencies": { + "enquirer": ">= 2.3.0 < 3" }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, - "engines": { - "node": ">=0.8.0" + "peerDependenciesMeta": { + "enquirer": { + "optional": true + } } }, "node_modules/loader-runner": { @@ -8563,12 +8226,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", - "dev": true - }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -8582,18 +8239,6 @@ "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", "dev": true }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", - "dev": true - }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", - "dev": true - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -8606,57 +8251,191 @@ "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", "dev": true }, - "node_modules/lodash.set": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", - "integrity": "sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg==", - "dev": true + "node_modules/lodash.unescape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", + "integrity": "sha512-DhhGRshNS1aX6s5YdBE3njCCouPgnG29ebyHvImlZzXZf2SHgt+J08DHgytTPnpywNbO1Y8mNUFyQuIDBq2JZg==", + "dev": true + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/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/log-symbols/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/log-symbols/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/log-symbols/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/log-symbols/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/log-symbols/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/log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/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/log-update/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/lodash.unescape": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", - "integrity": "sha512-DhhGRshNS1aX6s5YdBE3njCCouPgnG29ebyHvImlZzXZf2SHgt+J08DHgytTPnpywNbO1Y8mNUFyQuIDBq2JZg==", + "node_modules/log-update/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/log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "node_modules/log-update/node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "dependencies": { - "chalk": "^2.0.1" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/log-update": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-1.0.2.tgz", - "integrity": "sha512-4vSow8gbiGnwdDNrpy1dyNaXWKSCIPop0EHdE8GrnngHoJujM3QhvHUN/igsYCgPoHo7pFOezlJ61Hlln0KHyA==", + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "dependencies": { - "ansi-escapes": "^1.0.0", - "cli-cursor": "^1.0.2" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/lookup-closest-locale": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/lookup-closest-locale/-/lookup-closest-locale-6.0.4.tgz", - "integrity": "sha512-bWoFbSGe6f1GvMGzj17LrwMX4FhDXDwZyH04ySVCPbtOJADcSRguZNKewoJ3Ful/MOxD/wRHvFPadk/kYZUbuQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/lookup-closest-locale/-/lookup-closest-locale-6.2.0.tgz", + "integrity": "sha512-/c2kL+Vnp1jnV6K6RpDTHK3dgg0Tu2VVp+elEiJpjfS1UyY7AjOYHohRug6wT0OpoX2qFgNORndE9RqesfVxWQ==", "dev": true }, - "node_modules/lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "node_modules/lru_map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==", + "dev": true }, "node_modules/lru-cache": { "version": "10.1.0", @@ -8687,17 +8466,6 @@ "integrity": "sha512-q9JtQJKjpsVxCRVgQ+WapguSbKC3SQ5HEzFGPAJMStgh3QjCawp00UKv3MTTAArTmGmmPUvllHZoNbZ3gs0I+Q==", "dev": true }, - "node_modules/md5": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", - "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", - "dev": true, - "dependencies": { - "charenc": "0.0.2", - "crypt": "0.0.2", - "is-buffer": "~1.1.6" - } - }, "node_modules/mdn-data": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", @@ -8727,9 +8495,9 @@ } }, "node_modules/metaviewport-parser": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/metaviewport-parser/-/metaviewport-parser-0.2.0.tgz", - "integrity": "sha512-qL5NtY18LGs7lvZCkj3ep2H4Pes9rIiSLZRUyfDdvVw7pWFA0eLwmqaIxApD74RGvUrNEtk9e5Wt1rT+VlCvGw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/metaviewport-parser/-/metaviewport-parser-0.3.0.tgz", + "integrity": "sha512-EoYJ8xfjQ6kpe9VbVHvZTZHiOl4HL1Z18CrZ+qahvLXT7ZO4YTC2JMyt5FaUp9JJp6J4Ybb/z7IsCXZt86/QkQ==", "dev": true }, "node_modules/micromatch": { @@ -8773,15 +8541,6 @@ "node": ">=6" } }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -8795,9 +8554,12 @@ } }, "node_modules/minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha512-7Wl+Jz+IGWuSdgsQEJ4JunV0si/iMhg42MnQQG6h1R6TNeVenp4U9x5CC5v/gYqz/fENLQITAWXidNtVL0NNbw==" + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/minipass": { "version": "7.0.4", @@ -8808,18 +8570,11 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==", - "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", - "dev": true, - "dependencies": { - "minimist": "0.0.8" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } + "node_modules/mitt": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.0.tgz", + "integrity": "sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==", + "dev": true }, "node_modules/mkdirp-classic": { "version": "0.5.3", @@ -8827,12 +8582,6 @@ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", "dev": true }, - "node_modules/mkdirp/node_modules/minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==", - "dev": true - }, "node_modules/moment": { "version": "2.30.1", "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", @@ -8909,11 +8658,14 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "peer": true }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } }, "node_modules/node-fetch": { "version": "2.7.0", @@ -8989,15 +8741,6 @@ "node": ">=0.10.0" } }, - "node_modules/normalize-url": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", - "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -9022,15 +8765,6 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, - "node_modules/number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/nyc": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", @@ -9139,15 +8873,6 @@ "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, - "node_modules/nyc/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/nyc/node_modules/istanbul-lib-instrument": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", @@ -9187,20 +8912,6 @@ "node": ">=8" } }, - "node_modules/nyc/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/nyc/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -9256,24 +8967,6 @@ "node": ">=6" } }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -9395,24 +9088,20 @@ } }, "node_modules/open": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-6.4.0.tgz", - "integrity": "sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==", + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", "dev": true, "dependencies": { - "is-wsl": "^1.1.0" + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/open/node_modules/is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==", - "dev": true, - "engines": { - "node": ">=4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/optionator": { @@ -9432,102 +9121,11 @@ "node": ">= 0.8.0" } }, - "node_modules/ora": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/ora/-/ora-0.2.3.tgz", - "integrity": "sha512-MYGyg17e2GcoDlFrAP39zu4nrAQ+STzl4fosWjR8vAlT0a2wKuuAGZTecffdVLPsnEfxXVlrUcDZ1DU5skr+QQ==", - "dev": true, - "dependencies": { - "chalk": "^1.1.1", - "cli-cursor": "^1.0.2", - "cli-spinners": "^0.1.2", - "object-assign": "^4.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ora/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ora/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ora/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ora/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ora/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", - "dev": true, - "engines": { - "node": ">=4" - } + "node_modules/ospath": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", + "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", + "dev": true }, "node_modules/p-limit": { "version": "2.3.0", @@ -9557,12 +9155,18 @@ } }, "node_modules/p-map": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz", - "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-timeout": { @@ -9608,6 +9212,15 @@ "node": ">=12" } }, + "node_modules/pa11y/node_modules/axe-core": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.2.4.tgz", + "integrity": "sha512-9AiDKFKUCWEQm1Kj4lcq7KFavLqSXdf2m/zJo+NVh4VXlW5iwXRJ6alkKmipCyYorsRnqsICH9XLubP1jBF+Og==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/pa11y/node_modules/commander": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.0.0.tgz", @@ -9644,21 +9257,79 @@ "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/pa11y/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/pac-proxy-agent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.1.tgz", + "integrity": "sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==", + "dev": true, + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "pac-resolver": "^7.0.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", + "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.0.tgz", + "integrity": "sha512-Fd9lT9vJbHYRACT8OhCbZBbxr6KRSawSovFpy8nDGshaK99S/EBhVIHp9+crhxrsZOuvLpgL1n23iyPg6Rl2hg==", + "dev": true, + "dependencies": { + "degenerator": "^5.0.0", + "ip": "^1.1.8", + "netmask": "^2.0.2" }, "engines": { - "node": ">=10" + "node": ">= 14" } }, - "node_modules/pa11y/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/package-hash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", @@ -9674,21 +9345,6 @@ "node": ">=8" } }, - "node_modules/package-json": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", - "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", - "dev": true, - "dependencies": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -9725,12 +9381,6 @@ "node": ">=0.10.0" } }, - "node_modules/path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", - "dev": true - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -9762,15 +9412,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -10041,15 +9682,6 @@ "node": ">= 0.8.0" } }, - "node_modules/prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/prettier": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", @@ -10091,11 +9723,26 @@ "node": ">=0.10.0" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true + "node_modules/pretty-bytes": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", + "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } }, "node_modules/process-on-spawn": { "version": "1.0.0", @@ -10124,18 +9771,71 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, + "node_modules/proxy-agent": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.3.0.tgz", + "integrity": "sha512-0LdR757eTj/JfuU7TL2YCuAZnxWXu3tkJbg4Oq3geW/qFNT/32T0sp2HnZ9O0lMR4q3vwAt0+xCA8SR0WAD0og==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.0.0", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", + "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "node_modules/ps-list": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/ps-list/-/ps-list-7.2.0.tgz", - "integrity": "sha512-v4Bl6I3f2kJfr5o80ShABNHAokIgY+wFDTQfE+X3zWYgSGQOCBeYptLZUpoOALBqO5EawmDN/tjTldJesd0ujQ==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/ps-list/-/ps-list-8.1.1.tgz", + "integrity": "sha512-OPS9kEJYVmiO48u/B9qneqhkMvgCxT+Tm28VCEJpheTpl8cJ0ffZRRNgS5mrQRTrX5yRTpaJ+hRDeefXYmmorQ==", "dev": true, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -10163,28 +9863,18 @@ } }, "node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", - "dev": true - }, - "node_modules/pupa": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", - "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", - "dev": true, - "dependencies": { - "escape-goat": "^2.0.0" - }, + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "engines": { - "node": ">=8" + "node": ">=6" } }, "node_modules/puppeteer": { "version": "9.1.1", "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-9.1.1.tgz", "integrity": "sha512-W+nOulP2tYd/ZG99WuZC/I5ljjQQ7EUw/jQGcIb9eu8mDlZxNY2SgcJXTLG9h5gRvqA3uJOe4hZXYsd3EqioMw==", - "deprecated": "< 21.3.7 is no longer supported", + "deprecated": "< 21.5.0 is no longer supported", "dev": true, "hasInstallScript": true, "dependencies": { @@ -10205,26 +9895,64 @@ "node": ">=10.18.1" } }, - "node_modules/puppeteer/node_modules/extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "node_modules/puppeteer-core": { + "version": "20.9.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-20.9.0.tgz", + "integrity": "sha512-H9fYZQzMTRrkboEfPmf7m3CLDN6JvbxXA3qTtS+dFt27tR+CsFHzPsT6pzp6lYL6bJbAPaR0HaPO6uSi+F94Pg==", "dev": true, "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" + "@puppeteer/browsers": "1.4.6", + "chromium-bidi": "0.4.16", + "cross-fetch": "4.0.0", + "debug": "4.3.4", + "devtools-protocol": "0.0.1147663", + "ws": "8.13.0" }, - "bin": { - "extract-zip": "cli.js" + "engines": { + "node": ">=16.3.0" + }, + "peerDependencies": { + "typescript": ">= 4.7.4" }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/puppeteer-core/node_modules/devtools-protocol": { + "version": "0.0.1147663", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1147663.tgz", + "integrity": "sha512-hyWmRrexdhbZ1tcJUGpO95ivbRhWXz++F4Ko+n21AY5PNln2ovoJw+8ZMNDTtip+CNFQfrtLVh/w4009dXO/eQ==", + "dev": true + }, + "node_modules/puppeteer-core/node_modules/ws": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "dev": true, "engines": { - "node": ">= 10.17.0" + "node": ">=10.0.0" }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, + "node_modules/puppeteer/node_modules/devtools-protocol": { + "version": "0.0.869402", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.869402.tgz", + "integrity": "sha512-VvlVYY+VDJe639yHs5PHISzdWTLL3Aw8rO4cvUtwvoxFd6FHbE4OpHHcde52M6096uYYazAmd4l0o5VuFRO2WA==", + "dev": true + }, "node_modules/puppeteer/node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -10237,6 +9965,34 @@ "node": ">=8" } }, + "node_modules/puppeteer/node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dev": true, + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/puppeteer/node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/qinu": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/qinu/-/qinu-1.2.0.tgz", @@ -10244,23 +10000,25 @@ "dev": true }, "node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "version": "6.10.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.4.tgz", + "integrity": "sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==", "dev": true, + "dependencies": { + "side-channel": "^1.0.4" + }, "engines": { "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", - "dev": true, - "engines": { - "node": ">=0.4.x" - } + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true }, "node_modules/queue-microtask": { "version": "1.2.3", @@ -10282,10 +10040,10 @@ } ] }, - "node_modules/ramda": { - "version": "0.24.1", - "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.24.1.tgz", - "integrity": "sha512-HEm619G8PaZMfkqCa23qiOe7r3R0brPu7ZgOsgKUsnvLhd0qhc/vTjkUovomgPWa5ECBa08fJZixth9LaoBo5w==", + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", "dev": true }, "node_modules/randombytes": { @@ -10297,73 +10055,18 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/raven": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/raven/-/raven-2.6.4.tgz", - "integrity": "sha512-6PQdfC4+DQSFncowthLf+B6Hr0JpPsFBgTVYTAOq7tCmx/kR4SXbeawtPch20+3QfUcQDoJBLjWW1ybvZ4kXTw==", - "deprecated": "Please upgrade to @sentry/node. See the migration guide https://bit.ly/3ybOlo7", - "dev": true, - "dependencies": { - "cookie": "0.3.1", - "md5": "^2.2.1", - "stack-trace": "0.0.10", - "timed-out": "4.0.1", - "uuid": "3.3.2" - }, - "bin": { - "raven": "bin/raven" - }, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/raven/node_modules/uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/rc/node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "node": ">= 6" } }, "node_modules/readdirp": { @@ -10449,30 +10152,6 @@ "node": ">=4" } }, - "node_modules/registry-auth-token": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.2.tgz", - "integrity": "sha512-PC5ZysNb42zpFME6D/XlIgtNGdTl8bBOCw90xQLVMpzuuubJKYDWFAEuUNc+Cn8Z8724tg2SDhDRrkVEsqfDMg==", - "dev": true, - "dependencies": { - "rc": "1.2.8" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/registry-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", - "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", - "dev": true, - "dependencies": { - "rc": "^1.2.8" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/regjsparser": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", @@ -10508,50 +10187,6 @@ "node": ">=4" } }, - "node_modules/repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A==", - "dev": true, - "dependencies": { - "is-finite": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dev": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 4" - } - }, "node_modules/request-progress": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", @@ -10561,16 +10196,6 @@ "throttleit": "^1.0.0" } }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -10596,6 +10221,12 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", @@ -10622,35 +10253,17 @@ "node": ">=8" } }, - "node_modules/responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==", - "dev": true, - "dependencies": { - "lowercase-keys": "^1.0.0" - } - }, "node_modules/restore-cursor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "integrity": "sha512-reSjH4HuiFlxlaBaFCiS6O76ZGG2ygKoSlCsipKdaZuKSPx/+bt9mULkn4l0asVzbEfQQmXRg6Wp6gv6m0wElw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "dependencies": { - "exit-hook": "^1.0.0", - "onetime": "^1.0.0" + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/restore-cursor/node_modules/onetime": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha512-GZ+g4jayMqzCRMgB2sol7GiCLjKfS1PINkjmx8spcKce1LiVqcbQreXwqs2YAFXC6R03VIG28ZS31t8M866v6A==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/reusify": { @@ -10663,6 +10276,12 @@ "node": ">=0.10.0" } }, + "node_modules/rfdc": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", + "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", + "dev": true + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -10679,10 +10298,13 @@ } }, "node_modules/robots-parser": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/robots-parser/-/robots-parser-2.4.0.tgz", - "integrity": "sha512-oO8f2SI04dJk3pbj2KOMJ4G6QfPAgqcGmrYGmansIcpRewIPT2ljWEt5I+ip6EgiyaLo+RXkkUWw74M25HDkMA==", - "dev": true + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/robots-parser/-/robots-parser-3.0.1.tgz", + "integrity": "sha512-s+pyvQeIKIZ0dx5iJiQk1tPLJAWln39+MI5jtM8wnyws+G5azk+dMnMX0qfbqNetKKNgcWWOdi0sfm+FbQbgdQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } }, "node_modules/rollup": { "version": "3.29.4", @@ -10724,15 +10346,12 @@ } }, "node_modules/rxjs": { - "version": "5.5.12", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", - "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dev": true, "dependencies": { - "symbol-observable": "1.0.1" - }, - "engines": { - "npm": ">=2.0.0" + "tslib": "^2.1.0" } }, "node_modules/safe-array-concat": { @@ -10760,9 +10379,23 @@ "dev": true }, "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/safe-regex-test": { "version": "1.0.0", @@ -10872,18 +10505,6 @@ "semver": "bin/semver.js" } }, - "node_modules/semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", - "dev": true, - "dependencies": { - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/serialize-javascript": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", @@ -10983,14 +10604,108 @@ } }, "node_modules/slice-ansi": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha512-up04hB2hR92PgjpyU3y/eg91yIBILyjVY26NvvciY3EVVPjybkMszMpXQ9QAkcS3I5rtJBDLoTxxg+qvW8c7rw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi/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": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/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/slice-ansi/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/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "dev": true, + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" } }, + "node_modules/socks-proxy-agent": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", + "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks-proxy-agent/node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks/node_modules/ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "dev": true + }, "node_modules/sortablejs": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.2.tgz", @@ -11085,45 +10800,37 @@ "node": ">=0.10.0" } }, - "node_modules/stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/stream-to-observable": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/stream-to-observable/-/stream-to-observable-0.1.0.tgz", - "integrity": "sha512-h3mR71JoHxXrKApehgQk1CFbdi2nW9BAVqjPhpPD127H8iz0N61YsCLhJutm+JV0ajNAwPef0kMQsF0Jaz/A6Q==", + "node_modules/streamx": { + "version": "2.15.6", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.6.tgz", + "integrity": "sha512-q+vQL4AAz+FdfT137VF69Cc/APqUbxy+MDOImRrMvchJpigHj9GksgDU2LYbO9rx7RX6osWgxJB2WxhYv4SZAw==", "dev": true, - "engines": { - "node": ">=0.12.0" + "dependencies": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" } }, "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "dependencies": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" } }, "node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/string-width-cjs": { @@ -11141,36 +10848,6 @@ "node": ">=8" } }, - "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/string.prototype.trim": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", @@ -11250,15 +10927,6 @@ "node": ">=8" } }, - "node_modules/strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -11304,15 +10972,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -11323,57 +10982,25 @@ } }, "node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", + "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", "dev": true, "dependencies": { - "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", - "tar-stream": "^2.1.4" + "tar-stream": "^3.1.5" } }, "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dev": true, - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tar-stream/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", "dev": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/term-size": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", - "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" } }, "node_modules/terser": { @@ -11473,9 +11100,9 @@ "dev": true }, "node_modules/third-party-web": { - "version": "0.12.7", - "resolved": "https://registry.npmjs.org/third-party-web/-/third-party-web-0.12.7.tgz", - "integrity": "sha512-9d/OfjEOjyeOpnm4F9o0KSK6BI6ytvi9DINSB5h1+jdlCvQlhKpViMSxWpBN9WstdfDQ61BS6NxWqcPCuQCAJg==", + "version": "0.23.4", + "resolved": "https://registry.npmjs.org/third-party-web/-/third-party-web-0.23.4.tgz", + "integrity": "sha512-kwYnSZRhEvv0SBW2fp8SBBKRglMoBjV8xz6C31m0ewqOtknB5UL+Ihg+M81hyFY5ldkZuGWPb+e4GVDkzf/gYg==", "dev": true }, "node_modules/throttleit": { @@ -11493,15 +11120,6 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, - "node_modules/timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/tinymce": { "version": "5.10.0", "resolved": "https://registry.npmjs.org/tinymce/-/tinymce-5.10.0.tgz", @@ -11509,27 +11127,15 @@ "dev": true }, "node_modules/tmp": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", - "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", "dev": true, "dependencies": { - "rimraf": "^2.6.3" + "rimraf": "^3.0.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/tmp/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "node": ">=8.17.0" } }, "node_modules/to-fast-properties": { @@ -11541,15 +11147,6 @@ "node": ">=4" } }, - "node_modules/to-readable-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", - "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -11563,16 +11160,27 @@ } }, "node_modules/tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "dependencies": { - "psl": "^1.1.24", - "punycode": "^1.4.1" + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" }, "engines": { - "node": ">=0.8" + "node": ">=6" + } + }, + "node_modules/tough-cookie/node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" } }, "node_modules/tr46": { @@ -11611,15 +11219,6 @@ "json5": "lib/cli.js" } }, - "node_modules/tsconfig-paths/node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/tsconfig-paths/node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -11738,12 +11337,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "dev": true - }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -11840,21 +11433,21 @@ } }, "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "engines": { - "node": ">= 4.0.0" + "node": ">= 10.0.0" } }, "node_modules/untildify": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", - "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/update-browserslist-db": { @@ -11886,155 +11479,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/update-notifier": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", - "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", - "dev": true, - "dependencies": { - "boxen": "^4.2.0", - "chalk": "^3.0.0", - "configstore": "^5.0.1", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.3.1", - "is-npm": "^4.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.0.0", - "pupa": "^2.0.1", - "semver-diff": "^3.1.1", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/yeoman/update-notifier?sponsor=1" - } - }, - "node_modules/update-notifier/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/update-notifier/node_modules/chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/update-notifier/node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "node_modules/update-notifier/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/update-notifier/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/update-notifier/node_modules/global-dirs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz", - "integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==", - "dev": true, - "dependencies": { - "ini": "1.3.7" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/update-notifier/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/update-notifier/node_modules/ini": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", - "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", - "dev": true - }, - "node_modules/update-notifier/node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "dependencies": { - "ci-info": "^2.0.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/update-notifier/node_modules/is-installed-globally": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", - "integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", - "dev": true, - "dependencies": { - "global-dirs": "^2.0.1", - "is-path-inside": "^3.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/update-notifier/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/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -12043,42 +11487,16 @@ "punycode": "^2.1.0" } }, - "node_modules/uri-js/node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==", - "dev": true, - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, - "node_modules/url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==", + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "dev": true, "dependencies": { - "prepend-http": "^2.0.0" - }, - "engines": { - "node": ">=4" + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" } }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", - "dev": true - }, "node_modules/util": { "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", @@ -12138,16 +11556,10 @@ "extsprintf": "^1.2.0" } }, - "node_modules/verror/node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - }, "node_modules/vite": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.1.tgz", - "integrity": "sha512-AXXFaAJ8yebyqzoNB9fu2pHoo/nWX+xZlaRwoeYUxEqBO+Zj4msE5G+BhGBll9lYEKv9Hfks52PAF2X7qDYXQA==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", + "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", "dev": true, "dependencies": { "esbuild": "^0.18.10", @@ -12199,6 +11611,22 @@ } } }, + "node_modules/vite-plugin-istanbul": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/vite-plugin-istanbul/-/vite-plugin-istanbul-5.0.0.tgz", + "integrity": "sha512-Tg9zDmm/u4SdEDFbEWHBz7mmFe7jhLRmArA2XCmw5yydEFCARU9r4TxqFFnBFWCL63D9A7XA7VELulOO5T5o/g==", + "dev": true, + "dependencies": { + "@istanbuljs/load-nyc-config": "^1.1.0", + "espree": "^9.6.1", + "istanbul-lib-instrument": "^5.1.0", + "picocolors": "^1.0.0", + "test-exclude": "^6.0.0" + }, + "peerDependencies": { + "vite": ">=2.9.1 <= 5" + } + }, "node_modules/vite-plugin-monaco-editor": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/vite-plugin-monaco-editor/-/vite-plugin-monaco-editor-1.1.0.tgz", @@ -12775,41 +12203,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, - "dependencies": { - "string-width": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/widest-line/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/widest-line/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -12878,29 +12271,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/wrap-ansi-cjs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -12934,29 +12304,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -13030,53 +12377,30 @@ "dev": true }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/yauzl": { diff --git a/package.json b/package.json index 0c939bd3e..03eb9d66f 100644 --- a/package.json +++ b/package.json @@ -2,17 +2,13 @@ "name": "@processmaker/screen-builder", "version": "2.83.2", "scripts": { - "dev": "vite", - "serve": "vue-cli-service serve", + "dev": "VITE_COVERAGE=true vite", "build": "vite build", "preview": "vite preview", - "test:unit": "vue-cli-service test:unit", "lint": "vue-cli-service lint", "build-bundle": "npm run build", - "lint-fix": "vue-cli-service lint", - "open-cypress": "NODE_ENV=test TZ=UTC nyc cypress open", - "run-cypress": "NODE_ENV=test TZ=UTC nyc cypress run", - "test": "vue-cli-service test:unit" + "open-cypress": "nyc cypress open", + "run-cypress": "TZ=UTC nyc cypress run" }, "main": "./dist/vue-form-builder.umd.js", "module": "./dist/vue-form-builder.es.js", @@ -46,10 +42,12 @@ "vuelidate": "^0.7.5" }, "devDependencies": { - "@4tw/cypress-drag-drop": "~1.3.1", + "@4tw/cypress-drag-drop": "^2.2.5", "@babel/core": "^7.12.16", "@babel/eslint-parser": "^7.12.16", - "@cypress/code-coverage": "^3.8.1", + "@cypress-audit/lighthouse": "^1.4.2", + "@cypress-audit/pa11y": "^1.4.2", + "@cypress/code-coverage": "^3.12.19", "@fortawesome/fontawesome-free": "^5.6.1", "@originjs/vite-plugin-commonjs": "^1.0.3", "@panter/vue-i18next": "^0.15.2", @@ -64,17 +62,18 @@ "bootstrap-vue": "^2.19.0", "css-loader": "^5.2.7", "css-tree": "^1.0.0-alpha.29", - "cypress": "^3.8.0", - "cypress-audit": "^1.1.0", - "cypress-wait-until": "^1.7.1", + "cypress": "^13.6.3", + "cypress-wait-until": "^3.0.1", "eslint": "^8.21.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-prettier": "^8.5.0", + "eslint-plugin-cypress": "^2.15.1", "eslint-plugin-import": "^2.26.0", "eslint-plugin-jest": "^22.4.1", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-vue": "^9.3.0", "expr-eval": "^2.0.2", + "globby": "^11.1.0", "i18next": "^15.0.8", "identity-obj-proxy": "^3.0.0", "inputmask": "^5.0.7", @@ -85,6 +84,7 @@ "v-calendar": "^0.9.7", "validatorjs": "^3.14.2", "vite": "^4.0.4", + "vite-plugin-istanbul": "^5.0.0", "vite-plugin-monaco-editor": "^1.1.0", "vue": "^2.6.12", "vue-deepset": "^0.6.3", diff --git a/sonar-project.properties b/sonar-project.properties index 839b21635..3605a782f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1 +1,2 @@ -sonar.projectKey=ProcessMaker_screen-builder_AYlHjxBBxYvY_isvKt7h \ No newline at end of file +sonar.projectKey=ProcessMaker_screen-builder_AYlHjxBBxYvY_isvKt7h +sonar.javascript.lcov.reportPaths=./coverage/lcov.info diff --git a/src/main.js b/src/main.js index c51a98955..b601ea2c1 100644 --- a/src/main.js +++ b/src/main.js @@ -269,7 +269,7 @@ window.Echo = { window.axios = axios.create({ baseURL: "/api/1.0/", - adapter: cacheAdapterEnhancer(axios.defaults.adapter, { + adapter: cacheAdapterEnhancer(axios.getAdapter(axios.defaults.adapter), { enabledByDefault: window.ProcessMaker.screen.cacheEnabled, cacheFlag: "useCache", defaultCache: new LRUCache({ @@ -279,7 +279,9 @@ window.axios = axios.create({ }) }); -const scenario = (window.location.search.substr(1).match(/\w+=(\w+)/) || [])[1]; +const searchParams = new URLSearchParams(window.location.search); + +const scenario = searchParams?.get("scenario"); if (scenario) { if (!TestComponents[scenario]) { // eslint-disable-next-line no-console diff --git a/tests/components/TaskAssigned.vue b/tests/components/TaskAssigned.vue index a3be86258..9e1784c81 100644 --- a/tests/components/TaskAssigned.vue +++ b/tests/components/TaskAssigned.vue @@ -4,8 +4,9 @@ @@ -14,10 +15,10 @@ class="data-editor" language="json" :value="JSON.stringify(data, null, 4)" - :options="{automaticLayout: true, minimap: {enabled: false}}" + :options="{ automaticLayout: true, minimap: { enabled: false } }" />
- {{ __('Save') }} + {{ __("Save") }}
@@ -31,28 +32,28 @@ > - + - {{ __('Due') }} + {{ __("Due") }} {{ moment(task.due_at).fromNow() }}
{{ formatDate(task.due_at) }}
-
{{ __('Assigned To') }}
- +
{{ __("Assigned To") }}
+ {{ task.user.fullname }}
- + - {{ __('Assigned') }} + {{ __("Assigned") }} {{ moment(task.created_at).fromNow() }}
{{ formatDate(task.created_at) }}
-
{{ __('Request') }}
+
{{ __("Request") }}
-
{{ __('Requested by') }}
- +
{{ __("Requested by") }}
+ {{ task.process_request.user.fullname }}
@@ -71,41 +72,41 @@ @@ -143,4 +144,4 @@ export default { border: 1px solid gray; min-height: 400px; } - \ No newline at end of file + diff --git a/tests/components/TaskRedirect.vue b/tests/components/TaskRedirect.vue index 328a782eb..a1e045adb 100644 --- a/tests/components/TaskRedirect.vue +++ b/tests/components/TaskRedirect.vue @@ -4,11 +4,11 @@
- {{ __('Save') }} + {{ __("Save") }}
@@ -36,28 +36,28 @@ > - + - {{ __('Due') }} + {{ __("Due") }} {{ moment(task.due_at).fromNow() }}
{{ formatDate(task.due_at) }}
-
{{ __('Assigned To') }}
- +
{{ __("Assigned To") }}
+ {{ task.user.fullname }}
- + - {{ __('Assigned') }} + {{ __("Assigned") }} {{ moment(task.created_at).fromNow() }}
{{ formatDate(task.created_at) }}
-
{{ __('Request') }}
+
{{ __("Request") }}
-
{{ __('Requested by') }}
- +
{{ __("Requested by") }}
+ {{ task.process_request.user.fullname }}
@@ -76,52 +76,52 @@ @@ -157,4 +157,4 @@ export default { border: 1px solid gray; min-height: 400px; } - \ No newline at end of file + diff --git a/tests/components/WebEntry.vue b/tests/components/WebEntry.vue index ae57a85c4..168b3b664 100644 --- a/tests/components/WebEntry.vue +++ b/tests/components/WebEntry.vue @@ -5,10 +5,10 @@ @@ -18,12 +18,12 @@ @@ -85,4 +90,4 @@ export default { border: 1px solid gray; min-height: 400px; } - \ No newline at end of file + diff --git a/tests/components/index.js b/tests/components/index.js index dd7c44ef4..4b331bec0 100644 --- a/tests/components/index.js +++ b/tests/components/index.js @@ -1,18 +1,7 @@ -import { camelCase, upperFirst } from "lodash"; - -const components = []; -const modules = import.meta.globEager("./*.vue"); +const components = {}; +const modules = import.meta.glob("./*.vue"); Object.entries(modules).forEach(([path, m]) => { - const componentFiles = upperFirst( - camelCase( - path - .split("/") - .pop() - .replace(/\.\w+$/, "") - ) - ); - - components.push(m.default); + components[path.substr(2, path.length - 6)] = m; }); export default components; diff --git a/tests/e2e/.eslintrc.js b/tests/e2e/.eslintrc.js deleted file mode 100644 index 25e20e8c6..000000000 --- a/tests/e2e/.eslintrc.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - plugins: [ - 'cypress', - ], - env: { - mocha: true, - 'cypress/globals': true, - }, - rules: { - strict: 'off', - }, -}; diff --git a/tests/e2e/plugins/index.js b/tests/e2e/plugins/index.js deleted file mode 100644 index 34474a61e..000000000 --- a/tests/e2e/plugins/index.js +++ /dev/null @@ -1,20 +0,0 @@ -const { lighthouse, prepareAudit } = require('cypress-audit'); - -module.exports = (on, config) => { - require('@cypress/code-coverage/task')(on, config); - on('file:preprocessor', require('@cypress/code-coverage/use-babelrc')); - // cypress-audit: Setup the lighthouse plugin - on("before:browser:launch", (_browser, launchOptions) => { - prepareAudit({ args: Array.isArray(launchOptions) ? launchOptions : [] }); - }); - on("task", { - lighthouse: lighthouse() - }); - return Object.assign({}, config, { - fixturesFolder: 'tests/e2e/fixtures', - integrationFolder: 'tests/e2e/specs', - screenshotsFolder: 'tests/e2e/screenshots', - videosFolder: 'tests/e2e/videos', - supportFile: 'tests/e2e/support/index.js', - }); -}; diff --git a/tests/e2e/specs/Builder.spec.js b/tests/e2e/specs/Builder.spec.js index 0e83722c3..005bd65c3 100644 --- a/tests/e2e/specs/Builder.spec.js +++ b/tests/e2e/specs/Builder.spec.js @@ -1,76 +1,80 @@ -describe('Screen Builder', () => { +describe("Screen Builder", () => { beforeEach(() => { - cy.visit('/'); + cy.visit("/"); cy.openAllAcordeon(); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); }); - it('Validation in inspector properties', () => { + it("Validation in inspector properties", () => { // Add a second input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').eq(0).click(); - cy.get('[data-cy=inspector-name]').clear(); - cy.get('[data-cy=screen-element-container]').eq(1).click(); - cy.get('[data-cy=open-console]').click(); - cy.get('[data-cy=focus-inspector]').click(); - cy.get('[data-cy=inspector-name]').should('have.class', 'is-invalid'); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").eq(0).click(); + cy.get("[data-cy=inspector-name]").clear(); + cy.get("[data-cy=screen-element-container]").eq(1).click(); + cy.get("[data-cy=open-console]").click(); + cy.get("[data-cy=focus-inspector]").click(); + cy.get("[data-cy=inspector-name]").should("have.class", "is-invalid"); }); - it('Test switch between design and preview', () => { - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').type('Bob'); - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=mode-preview]').click(); + it("Test switch between design and preview", () => { + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").type("Bob"); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=mode-preview]").click(); cy.assertPreviewData({ - form_input_1: '', + form_input_1: "" }); }); - it('Test invalid preview input data', () => { - cy.setPreviewDataInput('INVALID'); - cy.get('[data-cy=mode-preview]').click(); + it("Test invalid preview input data", () => { + cy.setPreviewDataInput("INVALID"); + cy.get("[data-cy=mode-preview]").click(); // Assertion: The input data text editor has value "INVALID" - cy.assertComponentValue('[data-cy=preview-data-input]', 'INVALID'); + cy.assertComponentValue("[data-cy=preview-data-input]", "INVALID"); // Assertion: Screen is still rendered with only default data - cy.assertComponentValue('[data-cy=screen-renderer]', { - form_input_1: '', + cy.assertComponentValue("[data-cy=screen-renderer]", { + form_input_1: "" }); }); - it('Validates variable names', () => { - cy.get('[data-cy=screen-element-container]').eq(0).click(); - + it("Validates variable names", () => { + cy.get("[data-cy=screen-element-container]").eq(0).click(); + // Valid variable names [ - 'A', - 'aaa', - 'aaa.bbb', - 'aaa.BBB.ccc', - 'aaa1', - 'aaa_abc.abc_1', - 'aaa1.bbb1', - ].forEach(name => { - cy.get('[data-cy=inspector-name]').clear().type(name); - cy.get('[data-cy=inspector-name]').should('not.have.class', 'is-invalid'); + "A", + "aaa", + "aaa.bbb", + "aaa.BBB.ccc", + "aaa1", + "aaa_abc.abc_1", + "aaa1.bbb1" + ].forEach((name) => { + cy.get("[data-cy=inspector-name]").clear().type(name); + cy.get("[data-cy=inspector-name]").should("not.have.class", "is-invalid"); }); - + // Invalid variable names [ - '1', - '1.aaa', - 'aaa.0', - 'aaa.', - 'aaa.bbb.', - 'aaa._', - 'aaa._.ccc', - 'aaa..ccc', - 'aaa.123.ccc', - 'aaa.1.ccc', - ].forEach(name => { - cy.get('[data-cy=inspector-name]').clear().type(name); - cy.get('[data-cy=inspector-name]').should('have.class', 'is-invalid'); + "1", + "1.aaa", + "aaa.0", + "aaa.", + "aaa.bbb.", + "aaa._", + "aaa._.ccc", + "aaa..ccc", + "aaa.123.ccc", + "aaa.1.ccc" + ].forEach((name) => { + cy.get("[data-cy=inspector-name]").clear().type(name); + cy.get("[data-cy=inspector-name]").should("have.class", "is-invalid"); }); - }); }); diff --git a/tests/e2e/specs/ComplexScreen.spec.js b/tests/e2e/specs/ComplexScreen.spec.js index 81c25e2a7..f7c50f7ee 100644 --- a/tests/e2e/specs/ComplexScreen.spec.js +++ b/tests/e2e/specs/ComplexScreen.spec.js @@ -1,12 +1,12 @@ -import moment from 'moment'; +import moment from "moment"; -describe('Complex screen', () => { +describe("Complex screen", () => { const today = new Date(); today.setUTCHours(0); today.setUTCMinutes(0); today.setUTCSeconds(0); today.setUTCMilliseconds(0); - const today_date = moment(today).format('YYYY-MM-DD'); + const today_date = moment(today).format("YYYY-MM-DD"); const now = new Date(); now.setUTCHours(8); @@ -14,572 +14,938 @@ describe('Complex screen', () => { now.setUTCSeconds(0); now.setUTCMilliseconds(0); - const files= { + const files = { page1: [], - page2: [], + page2: [] }; before(() => { - cy.visit('/'); - cy.server(); - cy.window().then(win => { + cy.visit("/"); + + cy.window().then((win) => { // Add request-id header - const requestIdMeta = window.document.createElement('meta'); - requestIdMeta.setAttribute('name', 'request-id'); - requestIdMeta.setAttribute('content', '1'); + const requestIdMeta = window.document.createElement("meta"); + requestIdMeta.setAttribute("name", "request-id"); + requestIdMeta.setAttribute("content", "1"); win.document.head.appendChild(requestIdMeta); }); - cy.mockComponent('SavedSearchChart').then(() => { - cy.loadFromJson('complex_screen.json', 1); + cy.mockComponent("SavedSearchChart").then(() => { + cy.loadFromJson("complex_screen.json", 1); }); }); beforeEach(() => { - cy.server(); - cy.loadFromJson('complex_screen.json'); - cy.route('GET', '/api/1.0/requests/1/files?name=page1', JSON.stringify({data: files.page1})); - cy.route('GET', '/api/1.0/requests/1/files?name=page2', JSON.stringify({data: files.page2})); + cy.loadFromJson("complex_screen.json"); + cy.intercept( + "GET", + "/api/1.0/requests/1/files?id=1", + JSON.stringify({ data: files.page1 }) + ); + cy.intercept( + "GET", + "/api/1.0/requests/1/files?id=2", + JSON.stringify({ data: files.page2 }) + ); }); - it('Fill page 1', () => { - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').type('12345678'); - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.value', '12345678'); - - cy.get('[data-cy=preview-content] [name=form_text_area_1]').type('Hello!'); - cy.get('[data-cy=preview-content] [name=form_text_area_1]').should('have.value', 'Hello!'); - - cy.setMultiselect('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]', 'a'); - - cy.get('[data-cy=preview-content] [name=form_checkbox_1]').click(); - - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"]').pickToday(); + it("Fill page 1", () => { + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").type("12345678"); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.value", + "12345678" + ); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]').pickTodayWithTime('8', '15', 'AM'); + cy.get("[data-cy=preview-content] [name=form_text_area_1]").type("Hello!"); + cy.get("[data-cy=preview-content] [name=form_text_area_1]").should( + "have.value", + "Hello!" + ); - cy.get('[data-cy=preview-content] [name=form_input_2]').eq(0).clear().type('input in loop 1'); - cy.get('[data-cy=preview-content] [name=form_input_2]').eq(1).clear().type('input in loop 2'); - cy.get('[data-cy=preview-content] [name=form_input_2]').eq(2).clear().type('input in loop 3'); + cy.setMultiselect( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]', + "a" + ); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=first_name]').clear().type('Thomas'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=last_name]').clear().type('Anderson'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').eq(0).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=first_name]').type(' A.'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)').click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_1]").click(); + + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"]' + ).pickToday(); + + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]' + ).pickTodayWithTime("8", "15", "AM"); + + cy.get("[data-cy=preview-content] [name=form_input_2]") + .eq(0) + .clear() + .type("input in loop 1"); + cy.get("[data-cy=preview-content] [name=form_input_2]") + .eq(1) + .clear() + .type("input in loop 2"); + cy.get("[data-cy=preview-content] [name=form_input_2]") + .eq(2) + .clear() + .type("input in loop 3"); + + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=first_name]" + ) + .clear() + .type("Thomas"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=last_name]" + ) + .clear() + .type("Anderson"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ) + .eq(0) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=first_name]" + ).type(" A."); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)" + ).click(); // Upload file - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy="screen-field-page1"] input[type=file]', 'avatar.jpeg', 'image/jpg'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy="screen-field-page1"] input[type=file]', + "avatar.jpeg", + "image/jpg" + ); // Mock uploaded file files.page1.push({ - file_name: 'avatar.jpeg', + file_name: "avatar.jpeg" }); cy.assertPreviewData( { - 'form_input_1': '12345678', - 'form_text_area_1': 'Hello!', - 'form_select_list_1': 'a', - 'form_checkbox_1': true, - 'form_date_picker_1': today_date, - 'form_date_picker_2': now.toISOString(), - 'loop': [ + form_input_1: "12345678", + form_text_area_1: "Hello!", + form_select_list_1: "a", + form_checkbox_1: true, + form_date_picker_1: today_date, + form_date_picker_2: now.toISOString(), + loop: [ { - 'form_input_2': 'input in loop 1', + form_input_2: "input in loop 1" }, { - 'form_input_2': 'input in loop 2', + form_input_2: "input in loop 2" }, { - 'form_input_2': 'input in loop 3', - }, + form_input_2: "input in loop 3" + } ], - 'form_record_list_1': [ + form_record_list_1: [ { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - }, + first_name: "Thomas A.", + last_name: "Anderson" + } ], - 'page1': 1, - 'form_input_5': '', - 'form_select_list_4': null, - 'form_date_picker_7': null, - 'form_record_list_3': null, - 'page2': null, - 'form_text_area_4': '', - 'form_checkbox_4': false, - 'form_date_picker_8': null, - 'form_input_4': '', - 'form_date_picker_5': null, - 'form_text_area_3': '', - 'form_date_picker_6': null, - 'form_select_list_3': null, - 'form_checkbox_3': false, + page1: 1, + form_input_5: "", + form_select_list_4: null, + form_date_picker_7: null, + form_record_list_3: null, + page2: null, + form_text_area_4: "", + form_checkbox_4: false, + form_date_picker_8: null, + form_input_4: "", + form_date_picker_5: null, + form_text_area_3: "", + form_date_picker_6: null, + form_select_list_3: null, + form_checkbox_3: false }, true ); }); - it('Fill page 2', () => { + it("Fill page 2", () => { // Next Page - cy.get('[data-cy=preview-content] button:contains(Page Navigation >>)').click(); - - cy.get('[data-cy=preview-content] [name=form_input_5]').type('form input 5'); - - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_4"]').selectOption('foo'); + cy.get( + "[data-cy=preview-content] button:contains(Page Navigation >>)" + ).click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_7"]').pickTodayWithTime('8', '15', 'AM'); - - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_3] [data-cy=add-row]').click(); - cy.get('[data-cy=modal-not-assigned] button.btn-primary').click(); + cy.get("[data-cy=preview-content] [name=form_input_5]").type( + "form input 5" + ); - cy.get('[data-cy=preview-content] [name=form_text_area_4]').type('form text area 4'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_4"]' + ).selectOption("foo"); - cy.get('[data-cy=preview-content] [name=form_checkbox_4]').click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_7"]' + ).pickTodayWithTime("8", "15", "AM"); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_8"]').pickTodayWithTime('8', '15', 'AM'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_3] [data-cy=add-row]" + ).click(); + cy.get("[data-cy=modal-not-assigned] button.btn-primary").click(); - cy.get('[data-cy=preview-content] [name=form_input_6]').eq(0).clear().type('input 6 in loop 1'); - cy.get('[data-cy=preview-content] [name=form_input_6]').eq(1).clear().type('input 6 in loop 2'); - cy.get('[data-cy=preview-content] [name=form_input_6]').eq(2).clear().type('input 6 in loop 3'); + cy.get("[data-cy=preview-content] [name=form_text_area_4]").type( + "form text area 4" + ); - cy.get('[data-cy=preview-content] [name=form_input_4]').type('form input 4'); + cy.get("[data-cy=preview-content] [name=form_checkbox_4]").click(); + + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_8"]' + ).pickTodayWithTime("8", "15", "AM"); + + cy.get("[data-cy=preview-content] [name=form_input_6]") + .eq(0) + .clear() + .type("input 6 in loop 1"); + cy.get("[data-cy=preview-content] [name=form_input_6]") + .eq(1) + .clear() + .type("input 6 in loop 2"); + cy.get("[data-cy=preview-content] [name=form_input_6]") + .eq(2) + .clear() + .type("input 6 in loop 3"); + + cy.get("[data-cy=preview-content] [name=form_input_4]").type( + "form input 4" + ); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_5"]').pickToday(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_5"]' + ).pickToday(); - cy.get('[data-cy=preview-content] [name=form_text_area_3]').type('form text area 3'); + cy.get("[data-cy=preview-content] [name=form_text_area_3]").type( + "form text area 3" + ); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_6"]').pickTodayWithTime('8', '15', 'AM'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_6"]' + ).pickTodayWithTime("8", "15", "AM"); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_3"]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_3"]').should('contain.text', 'No Data Available'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_3"]' + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_3"]' + ).should("contain.text", "No Data Available"); - cy.get('[data-cy=preview-content] [name=form_checkbox_3]').click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_3]").click(); // Upload file - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy="screen-field-page2"] input[type=file]', 'avatar.jpeg', 'image/jpg'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy="screen-field-page2"] input[type=file]', + "avatar.jpeg", + "image/jpg" + ); // Mock uploaded file files.page2.push({ - file_name: 'avatar.jpeg', + file_name: "avatar.jpeg" }); cy.assertPreviewData( { - 'form_input_1': '12345678', - 'form_text_area_1': 'Hello!', - 'form_select_list_1': 'a', - 'form_checkbox_1': true, - 'form_date_picker_1': today_date, - 'form_date_picker_2': now.toISOString(), - 'loop': [ + form_input_1: "12345678", + form_text_area_1: "Hello!", + form_select_list_1: "a", + form_checkbox_1: true, + form_date_picker_1: today_date, + form_date_picker_2: now.toISOString(), + loop: [ { - 'form_input_2': 'input in loop 1', - 'form_input_6': 'input 6 in loop 1', + form_input_2: "input in loop 1", + form_input_6: "input 6 in loop 1" }, { - 'form_input_2': 'input in loop 2', - 'form_input_6': 'input 6 in loop 2', + form_input_2: "input in loop 2", + form_input_6: "input 6 in loop 2" }, { - 'form_input_2': 'input in loop 3', - 'form_input_6': 'input 6 in loop 3', - }, + form_input_2: "input in loop 3", + form_input_6: "input 6 in loop 3" + } ], - 'form_record_list_1': [ + form_record_list_1: [ { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - }, + first_name: "Thomas A.", + last_name: "Anderson" + } ], - 'page1': 1, - 'form_input_5': 'form input 5', - 'form_select_list_4': 'foo', - 'form_date_picker_7': now.toISOString(), - 'form_record_list_3': null, - 'page2': 1, - 'form_text_area_4': 'form text area 4', - 'form_checkbox_4': true, - 'form_date_picker_8': now.toISOString(), - 'form_input_4': 'form input 4', - 'form_date_picker_5': today_date, - 'form_text_area_3': 'form text area 3', - 'form_date_picker_6': now.toISOString(), - 'form_select_list_3': null, - 'form_checkbox_3': true, + page1: 1, + form_input_5: "form input 5", + form_select_list_4: "foo", + form_date_picker_7: now.toISOString(), + form_record_list_3: null, + page2: 1, + form_text_area_4: "form text area 4", + form_checkbox_4: true, + form_date_picker_8: now.toISOString(), + form_input_4: "form input 4", + form_date_picker_5: today_date, + form_text_area_3: "form text area 3", + form_date_picker_6: now.toISOString(), + form_select_list_3: null, + form_checkbox_3: true }, true ); }); - it('Fill page 3', () => { + it("Fill page 3", () => { let loop; // Next Page - cy.get('[data-cy=preview-content] button:contains(Page Navigation >>)').click(); + cy.get( + "[data-cy=preview-content] button:contains(Page Navigation >>)" + ).click(); // FILL LOOP 1 loop = 0; - cy.get('[data-cy=preview-content] [name=form_input_3]').eq(loop).type('info@processmaker.com'); - cy.get('[data-cy=preview-content] [name=form_text_area_2]').eq(loop).type('form text area 2'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]').eq(loop).selectOption('2'); - cy.get('[data-cy=preview-content] [name=form_checkbox_2]').eq(loop).click(); - cy.get('[data-cy=preview-content] [name=form_checkbox_2]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_3"]').eq(loop).pickToday(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_4"]').eq(loop).pickTodayWithTime('8', '15', 'AM'); + cy.get("[data-cy=preview-content] [name=form_input_3]") + .eq(loop) + .type("info@processmaker.com"); + cy.get("[data-cy=preview-content] [name=form_text_area_2]") + .eq(loop) + .type("form text area 2"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]' + ) + .eq(loop) + .selectOption("2"); + cy.get("[data-cy=preview-content] [name=form_checkbox_2]").eq(loop).click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_2]").eq(loop).click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_3"]' + ) + .eq(loop) + .pickToday(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_4"]' + ) + .eq(loop) + .pickTodayWithTime("8", "15", "AM"); // fill grid - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=add-row]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=first_name]').eq(loop).clear().type('Thomas'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=last_name]').eq(loop).clear().type('Anderson'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] button.btn-primary').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=edit-row]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] [name=first_name]').eq(loop).type(' A.'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] button:contains(Save)').eq(loop).click(); - - cy.get('[data-cy=preview-content] [name=season]').eq(loop).clear().type('1999'); - cy.get('[data-cy=preview-content] [name=season]').eq(loop).clear().type('2000'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=add-row]" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=first_name]" + ) + .eq(loop) + .clear() + .type("Thomas"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=last_name]" + ) + .eq(loop) + .clear() + .type("Anderson"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] button.btn-primary" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=edit-row]" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] [name=first_name]" + ) + .eq(loop) + .type(" A."); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] button:contains(Save)" + ) + .eq(loop) + .click(); + + cy.get("[data-cy=preview-content] [name=season]") + .eq(loop) + .clear() + .type("1999"); + cy.get("[data-cy=preview-content] [name=season]") + .eq(loop) + .clear() + .type("2000"); // FILL LOOP 2 loop = 1; - cy.get('[data-cy=preview-content] [name=form_input_3]').eq(loop).type('info@processmaker.com'); - cy.get('[data-cy=preview-content] [name=form_text_area_2]').eq(loop).type('form text area 2'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]').eq(loop).selectOption('2'); - cy.get('[data-cy=preview-content] [name=form_checkbox_2]').eq(loop).click(); - cy.get('[data-cy=preview-content] [name=form_checkbox_2]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_3"]').eq(loop).pickToday(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_4"]').eq(loop).pickTodayWithTime('8', '15', 'AM'); + cy.get("[data-cy=preview-content] [name=form_input_3]") + .eq(loop) + .type("info@processmaker.com"); + cy.get("[data-cy=preview-content] [name=form_text_area_2]") + .eq(loop) + .type("form text area 2"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]' + ) + .eq(loop) + .selectOption("2"); + cy.get("[data-cy=preview-content] [name=form_checkbox_2]").eq(loop).click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_2]").eq(loop).click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_3"]' + ) + .eq(loop) + .pickToday(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_4"]' + ) + .eq(loop) + .pickTodayWithTime("8", "15", "AM"); // fill grid - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=add-row]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=first_name]').eq(loop).clear().type('Thomas'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=last_name]').eq(loop).clear().type('Anderson'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] button.btn-primary').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=edit-row]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] [name=first_name]').eq(loop).type(' A.'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] button:contains(Save)').eq(loop).click(); - - cy.get('[data-cy=preview-content] [name=season]').eq(loop).clear().type('1999'); - cy.get('[data-cy=preview-content] [name=season]').eq(loop).clear().type('2000'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=add-row]" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=first_name]" + ) + .eq(loop) + .clear() + .type("Thomas"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=last_name]" + ) + .eq(loop) + .clear() + .type("Anderson"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] button.btn-primary" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=edit-row]" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] [name=first_name]" + ) + .eq(loop) + .type(" A."); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] button:contains(Save)" + ) + .eq(loop) + .click(); + + cy.get("[data-cy=preview-content] [name=season]") + .eq(loop) + .clear() + .type("1999"); + cy.get("[data-cy=preview-content] [name=season]") + .eq(loop) + .clear() + .type("2000"); // FILL LOOP 3 loop = 2; - cy.get('[data-cy=preview-content] [name=form_input_3]').eq(loop).type('info@processmaker.com'); - cy.get('[data-cy=preview-content] [name=form_text_area_2]').eq(loop).type('form text area 2'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]').eq(loop).selectOption('2'); - cy.get('[data-cy=preview-content] [name=form_checkbox_2]').eq(loop).click(); - cy.get('[data-cy=preview-content] [name=form_checkbox_2]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_3"]').eq(loop).pickToday(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_4"]').eq(loop).pickTodayWithTime('8', '15', 'AM'); + cy.get("[data-cy=preview-content] [name=form_input_3]") + .eq(loop) + .type("info@processmaker.com"); + cy.get("[data-cy=preview-content] [name=form_text_area_2]") + .eq(loop) + .type("form text area 2"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]' + ) + .eq(loop) + .selectOption("2"); + cy.get("[data-cy=preview-content] [name=form_checkbox_2]").eq(loop).click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_2]").eq(loop).click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_3"]' + ) + .eq(loop) + .pickToday(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_4"]' + ) + .eq(loop) + .pickTodayWithTime("8", "15", "AM"); // fill grid - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=add-row]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=first_name]').eq(loop).clear().type('Thomas'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=last_name]').eq(loop).clear().type('Anderson'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] button.btn-primary').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=edit-row]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] [name=first_name]').eq(loop).type(' A.'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] button:contains(Save)').eq(loop).click(); - - cy.get('[data-cy=preview-content] [name=season]').eq(loop).clear().type('1999'); - cy.get('[data-cy=preview-content] [name=season]').eq(loop).clear().type('2000'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=add-row]" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=first_name]" + ) + .eq(loop) + .clear() + .type("Thomas"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=last_name]" + ) + .eq(loop) + .clear() + .type("Anderson"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] button.btn-primary" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=edit-row]" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] [name=first_name]" + ) + .eq(loop) + .type(" A."); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] button:contains(Save)" + ) + .eq(loop) + .click(); + + cy.get("[data-cy=preview-content] [name=season]") + .eq(loop) + .clear() + .type("1999"); + cy.get("[data-cy=preview-content] [name=season]") + .eq(loop) + .clear() + .type("2000"); // add loop row - cy.get('[data-cy=preview-content] [data-cy=loop-loop-add]').click(); + cy.get("[data-cy=preview-content] [data-cy=loop-loop-add]").click(); // FILL LOOP 4 loop = 3; - cy.get('[data-cy=preview-content] [name=form_input_3]').eq(loop).type('info@processmaker.com'); - cy.get('[data-cy=preview-content] [name=form_text_area_2]').eq(loop).type('form text area 2'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]').eq(loop).selectOption('2'); - cy.get('[data-cy=preview-content] [name=form_checkbox_2]').eq(loop).click(); - cy.get('[data-cy=preview-content] [name=form_checkbox_2]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_3"]').eq(loop).pickToday(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_4"]').eq(loop).pickTodayWithTime('8', '15', 'AM'); + cy.get("[data-cy=preview-content] [name=form_input_3]") + .eq(loop) + .type("info@processmaker.com"); + cy.get("[data-cy=preview-content] [name=form_text_area_2]") + .eq(loop) + .type("form text area 2"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]' + ) + .eq(loop) + .selectOption("2"); + cy.get("[data-cy=preview-content] [name=form_checkbox_2]").eq(loop).click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_2]").eq(loop).click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_3"]' + ) + .eq(loop) + .pickToday(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_4"]' + ) + .eq(loop) + .pickTodayWithTime("8", "15", "AM"); // fill grid - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=add-row]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=first_name]').eq(loop).clear().type('Thomas'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=last_name]').eq(loop).clear().type('Anderson'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] button.btn-primary').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=edit-row]').eq(loop).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] [name=first_name]').eq(loop).type(' A.'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] button:contains(Save)').eq(loop).click(); - - cy.get('[data-cy=preview-content] [name=season]').eq(loop).clear().type('1999'); - cy.get('[data-cy=preview-content] [name=season]').eq(loop).clear().type('2000'); - - cy.assertPreviewData({ - 'form_input_1': '12345678', - 'form_text_area_1': 'Hello!', - 'form_select_list_1': 'a', - 'form_checkbox_1': true, - 'form_date_picker_1': today_date, - 'form_date_picker_2': now.toISOString(), - 'loop': [ - { - 'form_input_2': 'input in loop 1', - 'form_input_6': 'input 6 in loop 1', - 'form_input_3': 'info@processmaker.com', - 'form_text_area_2': 'form text area 2', - 'form_select_list_2': '2', - 'form_checkbox_2': false, - 'form_date_picker_3': today_date, - 'form_date_picker_4': now.toISOString(), - 'form_record_list_2': [ - { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - }, - ], - 'season': 2000, - }, - { - 'form_input_2': 'input in loop 2', - 'form_input_6': 'input 6 in loop 2', - 'form_input_3': 'info@processmaker.com', - 'form_text_area_2': 'form text area 2', - 'form_select_list_2': '2', - 'form_checkbox_2': false, - 'form_date_picker_3': today_date, - 'form_date_picker_4': now.toISOString(), - 'form_record_list_2': [ - { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - }, - ], - 'season': 2000, - }, - { - 'form_input_2': 'input in loop 3', - 'form_input_6': 'input 6 in loop 3', - 'form_input_3': 'info@processmaker.com', - 'form_text_area_2': 'form text area 2', - 'form_select_list_2': '2', - 'form_checkbox_2': false, - 'form_date_picker_3': today_date, - 'form_date_picker_4': now.toISOString(), - 'form_record_list_2': [ - { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - }, - ], - 'season': 2000, - }, - { - 'form_input_3': 'info@processmaker.com', - 'form_text_area_2': 'form text area 2', - 'form_select_list_2': '2', - 'form_checkbox_2': false, - 'form_date_picker_3': today_date, - 'form_date_picker_4': now.toISOString(), - 'form_record_list_2': [ - { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - }, - ], - 'season': 2000, - }, - ], - 'form_record_list_1': [ - { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - }, - ], - 'page1': 1, - 'form_input_5': 'form input 5', - 'form_select_list_4': 'foo', - 'form_date_picker_7': now.toISOString(), - 'form_record_list_3': null, - 'page2': 1, - 'form_text_area_4': 'form text area 4', - 'form_checkbox_4': true, - 'form_date_picker_8': now.toISOString(), - 'form_input_4': 'form input 4', - 'form_date_picker_5': today_date, - 'form_text_area_3': 'form text area 3', - 'form_date_picker_6': now.toISOString(), - 'form_select_list_3': null, - 'form_checkbox_3': true, - }, true); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=add-row]" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=first_name]" + ) + .eq(loop) + .clear() + .type("Thomas"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] [name=last_name]" + ) + .eq(loop) + .clear() + .type("Anderson"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-add] button.btn-primary" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=edit-row]" + ) + .eq(loop) + .click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] [name=first_name]" + ) + .eq(loop) + .type(" A."); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_2] [data-cy=modal-edit] button:contains(Save)" + ) + .eq(loop) + .click(); + + cy.get("[data-cy=preview-content] [name=season]") + .eq(loop) + .clear() + .type("1999"); + cy.get("[data-cy=preview-content] [name=season]") + .eq(loop) + .clear() + .type("2000"); + + cy.assertPreviewData( + { + form_input_1: "12345678", + form_text_area_1: "Hello!", + form_select_list_1: "a", + form_checkbox_1: true, + form_date_picker_1: today_date, + form_date_picker_2: now.toISOString(), + loop: [ + { + form_input_2: "input in loop 1", + form_input_6: "input 6 in loop 1", + form_input_3: "info@processmaker.com", + form_text_area_2: "form text area 2", + form_select_list_2: "2", + form_checkbox_2: false, + form_date_picker_3: today_date, + form_date_picker_4: now.toISOString(), + form_record_list_2: [ + { + first_name: "Thomas A.", + last_name: "Anderson" + } + ], + season: 2000 + }, + { + form_input_2: "input in loop 2", + form_input_6: "input 6 in loop 2", + form_input_3: "info@processmaker.com", + form_text_area_2: "form text area 2", + form_select_list_2: "2", + form_checkbox_2: false, + form_date_picker_3: today_date, + form_date_picker_4: now.toISOString(), + form_record_list_2: [ + { + first_name: "Thomas A.", + last_name: "Anderson" + } + ], + season: 2000 + }, + { + form_input_2: "input in loop 3", + form_input_6: "input 6 in loop 3", + form_input_3: "info@processmaker.com", + form_text_area_2: "form text area 2", + form_select_list_2: "2", + form_checkbox_2: false, + form_date_picker_3: today_date, + form_date_picker_4: now.toISOString(), + form_record_list_2: [ + { + first_name: "Thomas A.", + last_name: "Anderson" + } + ], + season: 2000 + }, + { + form_input_3: "info@processmaker.com", + form_text_area_2: "form text area 2", + form_select_list_2: "2", + form_checkbox_2: false, + form_date_picker_3: today_date, + form_date_picker_4: now.toISOString(), + form_record_list_2: [ + { + first_name: "Thomas A.", + last_name: "Anderson" + } + ], + season: 2000 + } + ], + form_record_list_1: [ + { + first_name: "Thomas A.", + last_name: "Anderson" + } + ], + page1: 1, + form_input_5: "form input 5", + form_select_list_4: "foo", + form_date_picker_7: now.toISOString(), + form_record_list_3: null, + page2: 1, + form_text_area_4: "form text area 4", + form_checkbox_4: true, + form_date_picker_8: now.toISOString(), + form_input_4: "form input 4", + form_date_picker_5: today_date, + form_text_area_3: "form text area 3", + form_date_picker_6: now.toISOString(), + form_select_list_3: null, + form_checkbox_3: true + }, + true + ); }); - it('Fill page 4', () => { + it("Fill page 4", () => { // Next Page - cy.get('[data-cy=preview-content] button:contains(Page Navigation >>)').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').clear().type('form input 1'); - cy.get('[data-cy=preview-content] [name=form_input_2]').clear().type('123'); - cy.get('[data-cy=preview-content] [name=form_input_3]').clear().type('123.45'); - cy.get('[data-cy=preview-content] [name=form_input_4]').type('19.21'); - cy.get('[data-cy=preview-content] [name=form_input_5]').clear().type('123.45'); - cy.get('[data-cy=preview-content] [name=form_input_6]').clear().type(moment(now).format('YYYY-MM-DD HH:mm')); - cy.get('[data-cy=preview-content] [name=form_input_7]').clear().type(moment(now).format('YYYY-MM-DD HH:mm')); - cy.get('[data-cy=preview-content] [name=form_input_8]').type('password'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').selectOption('b'); - cy.get('[data-cy=preview-content] [name=form_checkbox_1]').click(); - cy.get('[data-cy=preview-content] [name=form_checkbox_2]').should('be.checked'); - cy.get('[data-cy=preview-content] [name=form_checkbox_5]').parent().click(); - cy.get('[data-cy=preview-content] [name=form_checkbox_6]').should('be.checked'); - cy.get('[data-cy=preview-content] [name=form_select_list_3]').eq(1).click(); - cy.get('[data-cy=preview-content] [name=form_select_list_4]').eq(1).click(); // Select b - cy.get('[data-cy=preview-content] [name=form_select_list_4]').eq(2).click(); // Select c + cy.get( + "[data-cy=preview-content] button:contains(Page Navigation >>)" + ).click(); + cy.get("[data-cy=preview-content] [name=form_input_1]") + .clear() + .type("form input 1"); + cy.get("[data-cy=preview-content] [name=form_input_2]").clear().type("123"); + cy.get("[data-cy=preview-content] [name=form_input_3]") + .clear() + .type("123.45"); + cy.get("[data-cy=preview-content] [name=form_input_4]").type("19.21"); + cy.get("[data-cy=preview-content] [name=form_input_5]") + .clear() + .type("123.45"); + cy.get("[data-cy=preview-content] [name=form_input_6]") + .clear() + .type(moment(now).format("YYYY-MM-DD HH:mm")); + cy.get("[data-cy=preview-content] [name=form_input_7]") + .clear() + .type(moment(now).format("YYYY-MM-DD HH:mm")); + cy.get("[data-cy=preview-content] [name=form_input_8]").type("password"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).selectOption("b"); + cy.get("[data-cy=preview-content] [name=form_checkbox_1]").click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_2]").should( + "be.checked" + ); + cy.get("[data-cy=preview-content] [name=form_checkbox_5]").parent().click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_6]").should( + "be.checked" + ); + cy.get("[data-cy=preview-content] [name=form_select_list_3]").eq(1).click(); + cy.get("[data-cy=preview-content] [name=form_select_list_4]").eq(1).click(); // Select b + cy.get("[data-cy=preview-content] [name=form_select_list_4]").eq(2).click(); // Select c // record list - complete new fields - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=email]').clear().type('thomas@processmaker.com'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=url]').clear().type('https://thomas.processmaker.com'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=email]" + ) + .clear() + .type("thomas@processmaker.com"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=url]" + ) + .clear() + .type("https://thomas.processmaker.com"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)" + ).click(); // checkboxes - cy.get('[data-cy=preview-content] [name=form_checkbox_9]').click(); - cy.get('[data-cy=preview-content] [name=form_checkbox_10]').click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_9]").click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_10]").click(); // inputs in a loop - cy.get('[data-cy=preview-content] [name=form_input_9]').eq(0).clear().type('input in loop 1'); - cy.get('[data-cy=preview-content] [name=form_input_9]').eq(0).clear().type('form input 1'); - cy.get('[data-cy=preview-content] [name=form_input_9]').eq(1).clear().type('form input 1'); - cy.get('[data-cy=preview-content] [name=form_input_9]').eq(2).clear().type('form input 1'); - cy.get('[data-cy=preview-content] [name=form_input_9]').eq(3).clear().type('form input 1'); + cy.get("[data-cy=preview-content] [name=form_input_9]") + .eq(0) + .clear() + .type("input in loop 1"); + cy.get("[data-cy=preview-content] [name=form_input_9]") + .eq(0) + .clear() + .type("form input 1"); + cy.get("[data-cy=preview-content] [name=form_input_9]") + .eq(1) + .clear() + .type("form input 1"); + cy.get("[data-cy=preview-content] [name=form_input_9]") + .eq(2) + .clear() + .type("form input 1"); + cy.get("[data-cy=preview-content] [name=form_input_9]") + .eq(3) + .clear() + .type("form input 1"); // Upload file - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })).as('uploadFile'); - cy.uploadFile('[data-cy=preview-content] [data-cy="screen-field-nested_file"] input[type=file]', 'avatar.jpeg', 'image/jpg'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ).as("uploadFile"); + cy.uploadFile( + '[data-cy=preview-content] [data-cy="screen-field-nested_file"] input[type=file]', + "avatar.jpeg", + "image/jpg" + ); // Mock uploaded file files.page1.push({ - file_name: 'avatar.jpeg', + file_name: "avatar.jpeg" }); - cy.wait('@uploadFile'); - cy.assertPreviewData({ - 'form_input_1': 'form input 1', - 'form_text_area_1': 'Hello!', - 'form_select_list_1': 'b', - 'form_checkbox_1': false, - 'form_date_picker_1': today_date, - 'form_date_picker_2': now.toISOString(), - 'loop': [ - { - 'form_input_2': 'input in loop 1', - 'form_input_6': 'input 6 in loop 1', - 'form_input_3': 'info@processmaker.com', - 'form_text_area_2': 'form text area 2', - 'form_select_list_2': '2', - 'form_checkbox_2': false, - 'form_date_picker_3': today_date, - 'form_date_picker_4': now.toISOString(), - 'form_record_list_2': [ - { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - }, - ], - 'season': 2000, - 'form_input_9': 'form input 1', - }, - { - 'form_input_2': 'input in loop 2', - 'form_input_6': 'input 6 in loop 2', - 'form_input_3': 'info@processmaker.com', - 'form_text_area_2': 'form text area 2', - 'form_select_list_2': '2', - 'form_checkbox_2': false, - 'form_date_picker_3': today_date, - 'form_date_picker_4': now.toISOString(), - 'form_record_list_2': [ - { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - }, - ], - 'season': 2000, - 'form_input_9': 'form input 1', - }, - { - 'form_input_2': 'input in loop 3', - 'form_input_6': 'input 6 in loop 3', - 'form_input_3': 'info@processmaker.com', - 'form_text_area_2': 'form text area 2', - 'form_select_list_2': '2', - 'form_checkbox_2': false, - 'form_date_picker_3': today_date, - 'form_date_picker_4': now.toISOString(), - 'form_record_list_2': [ - { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - }, - ], - 'season': 2000, - 'form_input_9': 'form input 1', - }, - { - 'form_input_3': 'info@processmaker.com', - 'form_text_area_2': 'form text area 2', - 'form_select_list_2': '2', - 'form_checkbox_2': false, - 'form_date_picker_3': today_date, - 'form_date_picker_4': now.toISOString(), - 'form_record_list_2': [ - { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - }, - ], - 'season': 2000, - 'form_input_9': 'form input 1', - }, - ], - 'form_record_list_1': [ - { - 'first_name': 'Thomas A.', - 'last_name': 'Anderson', - 'email': 'thomas@processmaker.com', - 'url': 'https://thomas.processmaker.com', - }, - ], - 'page1': 1, - 'form_input_5': 123.45, - 'form_select_list_4': [ - 'b', - 'c', - ], - 'form_date_picker_7': now.toISOString(), - 'form_record_list_3': null, - 'page2': 1, - 'form_text_area_4': 'form text area 4', - 'form_checkbox_4': true, - 'form_date_picker_8': now.toISOString(), - 'form_input_4': 4.21, - 'form_date_picker_5': today_date, - 'form_text_area_3': 'form text area 3', - 'form_date_picker_6': now.toISOString(), - 'form_select_list_3': 'b', - 'form_checkbox_3': true, - 'form_input_2': 123, - 'form_input_6': moment(now).format('YYYY-MM-DD HH:mm'), - 'form_text_area_2': '', - 'form_select_list_2': [], // form_select_list_2 is a disabled multi select list, its default value must an empty array - 'form_input_3': 12345, - 'form_input_7': moment(now).format('YYYY-MM-DD'), - 'form_input_8': 'password', - 'form_checkbox_5': true, - 'form_checkbox_2': true, - 'form_checkbox_6': true, - 'form_checkbox_7': false, - 'form_date_picker_3': null, - 'form_checkbox_8': true, - 'form_date_picker_4': null, - 'nested_file': 1, - 'form_checkbox_9': true, - 'form_checkbox_10': true, - }, true); + cy.wait("@uploadFile"); + cy.assertPreviewData( + { + form_input_1: "form input 1", + form_text_area_1: "Hello!", + form_select_list_1: "b", + form_checkbox_1: false, + form_date_picker_1: today_date, + form_date_picker_2: now.toISOString(), + loop: [ + { + form_input_2: "input in loop 1", + form_input_6: "input 6 in loop 1", + form_input_3: "info@processmaker.com", + form_text_area_2: "form text area 2", + form_select_list_2: "2", + form_checkbox_2: false, + form_date_picker_3: today_date, + form_date_picker_4: now.toISOString(), + form_record_list_2: [ + { + first_name: "Thomas A.", + last_name: "Anderson" + } + ], + season: 2000, + form_input_9: "form input 1" + }, + { + form_input_2: "input in loop 2", + form_input_6: "input 6 in loop 2", + form_input_3: "info@processmaker.com", + form_text_area_2: "form text area 2", + form_select_list_2: "2", + form_checkbox_2: false, + form_date_picker_3: today_date, + form_date_picker_4: now.toISOString(), + form_record_list_2: [ + { + first_name: "Thomas A.", + last_name: "Anderson" + } + ], + season: 2000, + form_input_9: "form input 1" + }, + { + form_input_2: "input in loop 3", + form_input_6: "input 6 in loop 3", + form_input_3: "info@processmaker.com", + form_text_area_2: "form text area 2", + form_select_list_2: "2", + form_checkbox_2: false, + form_date_picker_3: today_date, + form_date_picker_4: now.toISOString(), + form_record_list_2: [ + { + first_name: "Thomas A.", + last_name: "Anderson" + } + ], + season: 2000, + form_input_9: "form input 1" + }, + { + form_input_3: "info@processmaker.com", + form_text_area_2: "form text area 2", + form_select_list_2: "2", + form_checkbox_2: false, + form_date_picker_3: today_date, + form_date_picker_4: now.toISOString(), + form_record_list_2: [ + { + first_name: "Thomas A.", + last_name: "Anderson" + } + ], + season: 2000, + form_input_9: "form input 1" + } + ], + form_record_list_1: [ + { + first_name: "Thomas A.", + last_name: "Anderson", + email: "thomas@processmaker.com", + url: "https://thomas.processmaker.com" + } + ], + page1: 1, + form_input_5: 123.45, + form_select_list_4: ["b", "c"], + form_date_picker_7: now.toISOString(), + form_record_list_3: null, + page2: 1, + form_text_area_4: "form text area 4", + form_checkbox_4: true, + form_date_picker_8: now.toISOString(), + form_input_4: 4.21, + form_date_picker_5: today_date, + form_text_area_3: "form text area 3", + form_date_picker_6: now.toISOString(), + form_select_list_3: "b", + form_checkbox_3: true, + form_input_2: 123, + form_input_6: moment(now).format("YYYY-MM-DD HH:mm"), + form_text_area_2: "", + form_select_list_2: [], // form_select_list_2 is a disabled multi select list, its default value must an empty array + form_input_3: 12345, + form_input_7: moment(now).format("YYYY-MM-DD"), + form_input_8: "password", + form_checkbox_5: true, + form_checkbox_2: true, + form_checkbox_6: true, + form_checkbox_7: false, + form_date_picker_3: null, + form_checkbox_8: true, + form_date_picker_4: null, + nested_file: 1, + form_checkbox_9: true, + form_checkbox_10: true + }, + true + ); }); }); diff --git a/tests/e2e/specs/ComputedDateTime.spec.js b/tests/e2e/specs/ComputedDateTime.spec.js index a32789c9f..a10289114 100644 --- a/tests/e2e/specs/ComputedDateTime.spec.js +++ b/tests/e2e/specs/ComputedDateTime.spec.js @@ -1,20 +1,18 @@ -describe('Computed datetime', () => { - - it('', () => { - cy.server(); - cy.visit('/', { +describe("Computed datetime", () => { + it("", () => { + cy.visit("/", { onBeforeLoad(win) { - cy.stub(win.console, 'log').as('consoleLog'); - cy.stub(win.console, 'error').as('consoleError'); - }, + cy.stub(win.console, "log").as("consoleLog"); + cy.stub(win.console, "error").as("consoleError"); + } }); - cy.loadFromJson('computed_datetime.json', 0); + cy.loadFromJson("computed_datetime.json", 0); // Enter preview mode - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // verify that no console errors are registerd when using the computed // property - cy.get('@consoleError').should('not.to.be.called'); + cy.get("@consoleError").should("not.to.be.called"); }); }); diff --git a/tests/e2e/specs/ComputedFields.spec.js b/tests/e2e/specs/ComputedFields.spec.js index 3d3fb1217..3c2813033 100644 --- a/tests/e2e/specs/ComputedFields.spec.js +++ b/tests/e2e/specs/ComputedFields.spec.js @@ -1,169 +1,225 @@ -describe('Computed fields', () => { - - it('Make sure new rows can be added to the loop, even with a javascript-driven computed field', () => { - cy.server(); - cy.visit('/'); - cy.loadFromJson('FOUR-5139.json', 0); +describe("Computed fields", () => { + it("Make sure new rows can be added to the loop, even with a javascript-driven computed field", () => { + cy.visit("/"); + cy.loadFromJson("FOUR-5139.json", 0); // Enter preview mode - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Add three inputs input in loop - cy.get('[data-cy=loop-loop_1-add]').click(); - cy.get('[data-cy=loop-loop_1-add]').click(); - cy.get('[data-cy=loop-loop_1-add]').click(); + cy.get("[data-cy=loop-loop_1-add]").click(); + cy.get("[data-cy=loop-loop_1-add]").click(); + cy.get("[data-cy=loop-loop_1-add]").click(); - cy.get('[data-cy=screen-field-form_input_1]') + cy.get("[data-cy=screen-field-form_input_1]") .first() .clear() - .type('First input'); + .type("First input"); cy.assertPreviewData({ - 'loop_1': [ + loop_1: [ { - 'form_input_1': 'First input', + form_input_1: "First input" }, { - 'form_input_1': '', + form_input_1: "" }, { - 'form_input_1': '', - }, - ], + form_input_1: "" + } + ] }); }); - it('CRUD of computed fields', () => { - cy.visit('/'); + it("CRUD of computed fields", () => { + cy.visit("/"); // Create a calculated property cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-add-property"]').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('form_input_1'); - cy.get('[data-cy="calcs-property-description"]').clear().type('form_input_1 = form_input_2 ^ 2'); + cy.get('[data-cy="calcs-property-name"]').clear().type("form_input_1"); + cy.get('[data-cy="calcs-property-description"]') + .clear() + .type("form_input_1 = form_input_2 ^ 2"); cy.get('[data-cy="calcs-switch-formula"]').click(); - cy.get('[data-cy="calcs-property-formula"]').clear().type('pow(form_input_2, 2)'); + cy.get('[data-cy="calcs-property-formula"]') + .clear() + .type("pow(form_input_2, 2)"); cy.get('[data-cy="calcs-button-save"]').click(); - cy.get('[data-cy="calcs-table"]').should('contain.text', 'form_input_1 = form_input_2 ^ 2'); + cy.get('[data-cy="calcs-table"]').should( + "contain.text", + "form_input_1 = form_input_2 ^ 2" + ); cy.get('[data-cy="calcs-modal"] .close').click(); // Edit the created calculated property cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-table-edit"]:first').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('form_input_2'); - cy.get('[data-cy="calcs-property-description"]').clear().type('form_input_2 = form_input_1 * 100'); + cy.get('[data-cy="calcs-property-name"]').clear().type("form_input_2"); + cy.get('[data-cy="calcs-property-description"]') + .clear() + .type("form_input_2 = form_input_1 * 100"); cy.get('[data-cy="calcs-switch-formula"]').click(); - cy.get('[data-cy="calcs-property-formula"]').clear().type('form_input_1 * 100'); + cy.get('[data-cy="calcs-property-formula"]') + .clear() + .type("form_input_1 * 100"); cy.get('[data-cy="calcs-button-save"]').click(); - cy.get('[data-cy="calcs-table"]').should('contain.text', 'form_input_2 = form_input_1 * 100'); + cy.get('[data-cy="calcs-table"]').should( + "contain.text", + "form_input_2 = form_input_1 * 100" + ); cy.get('[data-cy="calcs-modal"] .close').click(); // Delete the created calculated property cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-table-remove"]:first').click(); - cy.get('[data-cy="calcs-table"]').should('not.contain.text', 'form_input_2 = form_input_1 * 100'); + cy.get('[data-cy="calcs-table"]').should( + "not.contain.text", + "form_input_2 = form_input_1 * 100" + ); cy.get('[data-cy="calcs-modal"] .close').click(); }); - it('Create duplicated properties', () => { - cy.visit('/'); + it("Create duplicated properties", () => { + cy.visit("/"); // Create a calculated property cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-add-property"]').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('form_input_1'); - cy.get('[data-cy="calcs-property-description"]').clear().type('form_input_1 = form_input_2 ^ 2'); + cy.get('[data-cy="calcs-property-name"]').clear().type("form_input_1"); + cy.get('[data-cy="calcs-property-description"]') + .clear() + .type("form_input_1 = form_input_2 ^ 2"); cy.get('[data-cy="calcs-switch-formula"]').click(); - cy.get('[data-cy="calcs-property-formula"]').clear().type('pow(form_input_2, 2)'); + cy.get('[data-cy="calcs-property-formula"]') + .clear() + .type("pow(form_input_2, 2)"); cy.get('[data-cy="calcs-button-save"]').click(); - cy.get('[data-cy="calcs-table"]').should('contain.text', 'form_input_1 = form_input_2 ^ 2'); + cy.get('[data-cy="calcs-table"]').should( + "contain.text", + "form_input_1 = form_input_2 ^ 2" + ); cy.get('[data-cy="calcs-modal"] .close').click(); // Create a duplicated calculated property cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-add-property"]').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('form_input_1'); - cy.get('[data-cy="calcs-property-description"]').clear().type('form_input_1 = form_input_2 ^ 2'); + cy.get('[data-cy="calcs-property-name"]').clear().type("form_input_1"); + cy.get('[data-cy="calcs-property-description"]') + .clear() + .type("form_input_1 = form_input_2 ^ 2"); cy.get('[data-cy="calcs-switch-formula"]').click(); - cy.get('[data-cy="calcs-property-formula"]').clear().type('pow(form_input_2, 2)'); + cy.get('[data-cy="calcs-property-formula"]') + .clear() + .type("pow(form_input_2, 2)"); cy.get('[data-cy="calcs-button-save"]').click(); - cy.get('[data-cy="calcs-modal"]').should('contain.text', 'Property already exists'); + cy.get('[data-cy="calcs-modal"]').should( + "contain.text", + "Property already exists" + ); }); - it('Create a javascript computed field', () => { - cy.visit('/'); + it("Create a javascript computed field", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); // Add an input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); // Add a second input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container]', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); - cy.get('[data-cy=screen-element-container]').eq(0).click(); - cy.get('[data-cy=screen-element-container]').eq(1).click(); + cy.get("[data-cy=screen-element-container]").eq(0).click(); + cy.get("[data-cy=screen-element-container]").eq(1).click(); cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-add-property"]').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('form_input_1'); - cy.get('[data-cy="calcs-property-description"]').clear().type('form_input_1 is the upper case of form_input_2'); + cy.get('[data-cy="calcs-property-name"]').clear().type("form_input_1"); + cy.get('[data-cy="calcs-property-description"]') + .clear() + .type("form_input_1 is the upper case of form_input_2"); cy.get('[data-cy="calcs-switch-javascript"]').click(); - cy.setVueComponentValue('[data-cy="calcs-property-javascript"]', 'return String(this.form_input_2).toUpperCase();'); + cy.setVueComponentValue( + '[data-cy="calcs-property-javascript"]', + "return String(this.form_input_2).toUpperCase();" + ); cy.get('[data-cy="calcs-button-save"]').click(); cy.get('[data-cy="calcs-modal"] .close').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy=preview-content] [name=form_input_2]').clear().type('name'); + cy.get("[data-cy=preview-content] [name=form_input_2]") + .clear() + .type("name"); // Assertion: Check the form_input_1 is the upper case of form_input_2 - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.value', 'NAME'); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.value", + "NAME" + ); cy.assertPreviewData({ - form_input_1: 'NAME', - form_input_2: 'name', + form_input_1: "NAME", + form_input_2: "name" }); }); - it('Create a computed field with formula', () => { - cy.visit('/'); + it("Create a computed field with formula", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); // Add an input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); // Add a second input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container]', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); - cy.get('[data-cy=screen-element-container]').eq(0).click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Integer'); - cy.get('[data-cy=screen-element-container]').eq(1).click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Integer'); + cy.get("[data-cy=screen-element-container]").eq(0).click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Integer"); + cy.get("[data-cy=screen-element-container]").eq(1).click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Integer"); cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-add-property"]').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('form_input_1'); - cy.get('[data-cy="calcs-property-description"]').clear().type('form_input_1 = form_input_2 ^ 2'); + cy.get('[data-cy="calcs-property-name"]').clear().type("form_input_1"); + cy.get('[data-cy="calcs-property-description"]') + .clear() + .type("form_input_1 = form_input_2 ^ 2"); cy.get('[data-cy="calcs-switch-formula"]').click(); - cy.get('[data-cy="calcs-property-formula"]').clear().type('pow(form_input_2, 2)'); + cy.get('[data-cy="calcs-property-formula"]') + .clear() + .type("pow(form_input_2, 2)"); cy.get('[data-cy="calcs-button-save"]').click(); cy.get('[data-cy="calcs-modal"] .close').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy=preview-content] [name=form_input_2]').clear().type('4'); + cy.get("[data-cy=preview-content] [name=form_input_2]").clear().type("4"); // Assertion: Check the form_input_1 is the upper case of form_input_2 - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.value', '16'); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.value", + "16" + ); cy.assertPreviewData({ form_input_1: 16, - form_input_2: 4, + form_input_2: 4 }); }); - it('Focuses the first field that has an error', () => { - cy.visit('/'); + it("Focuses the first field that has an error", () => { + cy.visit("/"); cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-add-property"]').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('form_input_1'); + cy.get('[data-cy="calcs-property-name"]').clear().type("form_input_1"); cy.get('[data-cy="calcs-button-save"]').click(); - cy.focused().should('have.attr', 'data-cy', 'calcs-property-description'); + cy.focused().should("have.attr", "data-cy", "calcs-property-description"); - cy.get('[data-cy="calcs-property-description"]').clear().type('something'); + cy.get('[data-cy="calcs-property-description"]').clear().type("something"); cy.get('[data-cy="calcs-button-save"]').click(); cy.get('[data-cy="calcs-switch-javascript"]').click(); cy.get('[data-cy="calcs-button-save"]').click(); - cy.focused().should('have.attr', 'class', 'inputarea'); // Monaco should be focused + cy.focused().should("have.attr", "class", "inputarea"); // Monaco should be focused }); }); diff --git a/tests/e2e/specs/ComputedFieldsReadOnly.spec.js b/tests/e2e/specs/ComputedFieldsReadOnly.spec.js index cee1920a9..66306853f 100644 --- a/tests/e2e/specs/ComputedFieldsReadOnly.spec.js +++ b/tests/e2e/specs/ComputedFieldsReadOnly.spec.js @@ -1,236 +1,308 @@ -import {waitUntilElementIsVisible} from '../support/utils'; +import { waitUntilElementIsVisible } from "../support/utils"; -describe('Computed fields', () => { - - it('The user should not be able to change a FormInput assigned to a computed property', () => { - cy.visit('/'); +describe("Computed fields", () => { + it("The user should not be able to change a FormInput assigned to a computed property", () => { + cy.visit("/"); // Add an input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); - cy.get('[data-cy=screen-element-container]').eq(0).click(); + cy.get("[data-cy=screen-element-container]").eq(0).click(); cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-add-property"]').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('form_input_1'); - cy.get('[data-cy="calcs-property-description"]').clear().type('form_input_1 is always 1'); + cy.get('[data-cy="calcs-property-name"]').clear().type("form_input_1"); + cy.get('[data-cy="calcs-property-description"]') + .clear() + .type("form_input_1 is always 1"); cy.get('[data-cy="calcs-switch-javascript"]').click(); - cy.setVueComponentValue('[data-cy="calcs-property-javascript"]', 'return "1";'); + cy.setVueComponentValue( + '[data-cy="calcs-property-javascript"]', + 'return "1";' + ); cy.get('[data-cy="calcs-button-save"]').click(); cy.get('[data-cy="calcs-modal"] .close').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the form_input_1 is read only - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.attr', 'readonly'); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.attr", + "readonly" + ); // Assertion: Check the form_input_1 is always 1 cy.assertPreviewData({ - form_input_1: '1', + form_input_1: "1" }); // Check Type Integer - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Integer'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Integer"); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the form_input_1 is read only - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.attr', 'readonly'); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.attr", + "readonly" + ); // Assertion: Check the form_input_1 is always 1 cy.assertPreviewData({ - form_input_1: '1', + form_input_1: "1" }); // Check Type Currency - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Currency'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Currency"); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the form_input_1 is read only - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.attr', 'readonly'); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.attr", + "readonly" + ); // Assertion: Check the form_input_1 is always 1 cy.assertPreviewData({ - form_input_1: '1', + form_input_1: "1" }); // Check Type Percentage - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Percentage'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Percentage"); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the form_input_1 is read only - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.attr', 'readonly'); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.attr", + "readonly" + ); // Assertion: Check the form_input_1 is always 1 cy.assertPreviewData({ - form_input_1: '1', + form_input_1: "1" }); // Check Type Decimal - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Decimal'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Decimal"); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the form_input_1 is read only - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.attr', 'readonly'); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.attr", + "readonly" + ); // Assertion: Check the form_input_1 is always 1 cy.assertPreviewData({ - form_input_1: '1', + form_input_1: "1" }); // Check Type Datetime - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Datetime'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Datetime"); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the form_input_1 is read only - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.attr', 'readonly'); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.attr", + "readonly" + ); // Assertion: Check the form_input_1 is always 1 cy.assertPreviewData({ - form_input_1: '1', + form_input_1: "1" }); // Check Type Date - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the form_input_1 is read only - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.attr', 'readonly'); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.attr", + "readonly" + ); // Assertion: Check the form_input_1 is always 1 cy.assertPreviewData({ - form_input_1: '1', + form_input_1: "1" }); // Check Type Password - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Password'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Password"); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the form_input_1 is read only - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.attr', 'readonly'); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.attr", + "readonly" + ); // Assertion: Check the form_input_1 is always 1 cy.assertPreviewData({ - form_input_1: '1', + form_input_1: "1" }); - }); - it('The user should not be able to change a FormTextArea assigned to a computed property', () => { - cy.visit('/'); + it("The user should not be able to change a FormTextArea assigned to a computed property", () => { + cy.visit("/"); // Add an input field - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); - cy.get('[data-cy=screen-element-container]').eq(0).click(); + cy.get("[data-cy=screen-element-container]").eq(0).click(); cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-add-property"]').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('form_text_area_1'); - cy.get('[data-cy="calcs-property-description"]').clear().type('form_text_area_1 is always 1'); + cy.get('[data-cy="calcs-property-name"]').clear().type("form_text_area_1"); + cy.get('[data-cy="calcs-property-description"]') + .clear() + .type("form_text_area_1 is always 1"); cy.get('[data-cy="calcs-switch-javascript"]').click(); - cy.setVueComponentValue('[data-cy="calcs-property-javascript"]', 'return "1";'); + cy.setVueComponentValue( + '[data-cy="calcs-property-javascript"]', + 'return "1";' + ); cy.get('[data-cy="calcs-button-save"]').click(); cy.get('[data-cy="calcs-modal"] .close').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the form_text_area_1 is read only - cy.get('[data-cy=preview-content] [name=form_text_area_1]').should('have.attr', 'readonly'); + cy.get("[data-cy=preview-content] [name=form_text_area_1]").should( + "have.attr", + "readonly" + ); // Assertion: Check the form_text_area_1 is always 1 cy.assertPreviewData({ - form_text_area_1: '1', + form_text_area_1: "1" }); }); - it.only('The user should not be able to change a FormDatePicker assigned to a computed property', () => { - cy.visit('/'); + it.only("The user should not be able to change a FormDatePicker assigned to a computed property", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); // Add an input field - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Datetime'); + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Datetime"); cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-add-property"]').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('form_date_picker_1'); - cy.get('[data-cy="calcs-property-description"]').clear().type('form_date_picker_1 is always 1'); + cy.get('[data-cy="calcs-property-name"]') + .clear() + .type("form_date_picker_1"); + cy.get('[data-cy="calcs-property-description"]') + .clear() + .type("form_date_picker_1 is always 1"); cy.get('[data-cy="calcs-switch-javascript"]').click(); - cy.setVueComponentValue('[data-cy="calcs-property-javascript"]', 'return "1";'); + cy.setVueComponentValue( + '[data-cy="calcs-property-javascript"]', + 'return "1";' + ); cy.get('[data-cy="calcs-button-save"]').click(); cy.get('[data-cy="calcs-modal"] .close').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the form_date_picker_1 is read only - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] input').should('have.attr', 'disabled'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] input' + ).should("have.attr", "disabled"); // Assertion: Check the form_date_picker_1 is always 1 cy.assertPreviewData({ - form_date_picker_1: '1', + form_date_picker_1: "1" }); - }); - it('The user should not be able to change a FormSelectList assigned to a computed property', () => { - cy.visit('/'); + it("The user should not be able to change a FormSelectList assigned to a computed property", () => { + cy.visit("/"); // Add an input field - cy.get('[data-cy=controls-FormSelectList]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Provide Values'); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('1'); - cy.get('[data-cy=inspector-option-content]').type('one'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('2'); - cy.get('[data-cy=inspector-option-content]').type('two'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('3'); - cy.get('[data-cy=inspector-option-content]').type('three'); - cy.get('[data-cy=inspector-option-cancel]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('4'); - cy.get('[data-cy=inspector-option-content]').type('four'); - cy.get('[data-cy=inspector-option-save]').click(); + cy.get("[data-cy=controls-FormSelectList]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Provide Values"); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("1"); + cy.get("[data-cy=inspector-option-content]").type("one"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("2"); + cy.get("[data-cy=inspector-option-content]").type("two"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("3"); + cy.get("[data-cy=inspector-option-content]").type("three"); + cy.get("[data-cy=inspector-option-cancel]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("4"); + cy.get("[data-cy=inspector-option-content]").type("four"); + cy.get("[data-cy=inspector-option-save]").click(); cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-add-property"]').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('form_select_list_1'); - cy.get('[data-cy="calcs-property-description"]').clear().type('form_select_list_1 is always 1'); + cy.get('[data-cy="calcs-property-name"]') + .clear() + .type("form_select_list_1"); + cy.get('[data-cy="calcs-property-description"]') + .clear() + .type("form_select_list_1 is always 1"); cy.get('[data-cy="calcs-switch-javascript"]').click(); - cy.setVueComponentValue('[data-cy="calcs-property-javascript"]', 'return "1";'); + cy.setVueComponentValue( + '[data-cy="calcs-property-javascript"]', + 'return "1";' + ); cy.get('[data-cy="calcs-button-save"]').click(); cy.get('[data-cy="calcs-modal"] .close').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the form_select_list_1 is read only - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"] input').should('have.attr', 'disabled'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"] input' + ).should("have.attr", "disabled"); // Assertion: Check the form_select_list_1 is always 1 cy.assertPreviewData({ - form_select_list_1: '1', + form_select_list_1: "1" }); }); - it('The user should not be able to change an input assigned to a sub property of a computed property', () => { - cy.visit('/'); + it("The user should not be able to change an input assigned to a sub property of a computed property", () => { + cy.visit("/"); // Add an input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').eq(0).click(); - cy.get('[data-cy=inspector-name]').clear().type('object.foo'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").eq(0).click(); + cy.get("[data-cy=inspector-name]").clear().type("object.foo"); cy.get('[data-cy="topbar-calcs"]').click(); cy.get('[data-cy="calcs-add-property"]').click(); - cy.get('[data-cy="calcs-property-name"]').clear().type('object'); - cy.get('[data-cy="calcs-property-description"]').clear().type('returns object'); + cy.get('[data-cy="calcs-property-name"]').clear().type("object"); + cy.get('[data-cy="calcs-property-description"]') + .clear() + .type("returns object"); cy.get('[data-cy="calcs-switch-javascript"]').click(); - cy.setVueComponentValue('[data-cy="calcs-property-javascript"]', 'return { foo: "bar" };'); + cy.setVueComponentValue( + '[data-cy="calcs-property-javascript"]', + 'return { foo: "bar" };' + ); cy.get('[data-cy="calcs-button-save"]').click(); cy.get('[data-cy="calcs-modal"] .close').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Check the input is read only - cy.get('[data-cy=preview-content] [name="object.foo"]').should('have.attr', 'readonly'); + cy.get('[data-cy=preview-content] [name="object.foo"]').should( + "have.attr", + "readonly" + ); // Assertion: Check the input is the computed object cy.assertPreviewData({ - object: { foo: 'bar' }, + object: { foo: "bar" } }); - }); }); diff --git a/tests/e2e/specs/CustomCss.spec.js b/tests/e2e/specs/CustomCss.spec.js index 266c69c44..6d9121ef0 100644 --- a/tests/e2e/specs/CustomCss.spec.js +++ b/tests/e2e/specs/CustomCss.spec.js @@ -1,90 +1,119 @@ -describe('Custom CSS', () => { - it('Shows Modal', () => { - cy.visit('/'); +describe("Custom CSS", () => { + it("Shows Modal", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-customCssSelector]').type('new_input_css'); - cy.get('[data-cy=topbar-css]').click(); - cy.get('#custom-css').should('be.visible'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-customCssSelector]").type("new_input_css"); + cy.get("[data-cy=topbar-css]").click(); + cy.get("#custom-css").should("be.visible"); }); - it('Closes Modal', () => { - cy.visit('/'); + it("Closes Modal", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-customCssSelector]').type('new_input_css'); - cy.get('[data-cy=topbar-css]').click(); - cy.get('#custom-css').should('be.visible'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-customCssSelector]").type("new_input_css"); + cy.get("[data-cy=topbar-css]").click(); + cy.get("#custom-css").should("be.visible"); cy.wait(1000); - cy.get('#custom-css___BV_modal_header_ > .close').click(); - cy.get('#custom-css').should('not.be.visible'); + cy.get("#custom-css___BV_modal_header_ > .close").click(); + cy.get("#custom-css").should("not.exist"); }); - it('Does Not Save Custom CSS', () => { - cy.visit('/'); + it("Does Not Save Custom CSS", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-customCssSelector]').type('new_input_css'); - cy.get('[data-cy=topbar-css]').click(); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-customCssSelector]").type("new_input_css"); + cy.get("[data-cy=topbar-css]").click(); cy.wait(1000); - cy.get('[data-cy=monaco-editor]').type('div[selector=\'new_input_css\'] {background-color:red;padding:10px;}', {parseSpecialCharSequences: false} ); - cy.get('[data-cy=cancel-button]').click(); - cy.get('[data-cy=topbar-css]').click(); + cy.get("[data-cy=monaco-editor]").type( + "div[selector='new_input_css'] {background-color:red;padding:10px;}", + { parseSpecialCharSequences: false } + ); + cy.get("[data-cy=cancel-button]").click(); + cy.get("[data-cy=topbar-css]").click(); cy.wait(1000); - cy.assertComponentValue('[data-cy=monaco-editor]', ''); + cy.assertComponentValue("[data-cy=monaco-editor]", ""); }); - it('Saves Custom CSS', () => { - cy.visit('/'); + it("Saves Custom CSS", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-customCssSelector]').type('new_input_css'); - cy.get('[data-cy=topbar-css]').click(); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-customCssSelector]").type("new_input_css"); + cy.get("[data-cy=topbar-css]").click(); cy.wait(1000); - cy.get('[data-cy=monaco-editor]').type('div[selector=\'new_input_css\'] {background-color:red;padding:10px;}', {parseSpecialCharSequences: false} ); - cy.get('[data-cy=save-button]').click(); + cy.get("[data-cy=monaco-editor]").type( + "div[selector='new_input_css'] {background-color:red;padding:10px;}", + { parseSpecialCharSequences: false } + ); + cy.get("[data-cy=save-button]").click(); cy.wait(1000); - cy.get('[data-cy=topbar-css]').click(); + cy.get("[data-cy=topbar-css]").click(); cy.wait(1000); - cy.assertComponentValue('[data-cy=monaco-editor]', 'div[selector=\'new_input_css\'] {background-color:red;padding:10px;}'); + cy.assertComponentValue( + "[data-cy=monaco-editor]", + "div[selector='new_input_css'] {background-color:red;padding:10px;}" + ); }); - it('Does not add styling to element in design mode', () => { - cy.visit('/'); + it("Does not add styling to element in design mode", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-customCssSelector]').type('new_input_css'); - cy.get('[data-cy=topbar-css]').click(); - cy.get('#custom-css').type('div[selector=\'new_input_css\'] {background-color:red;padding:10px;}', {parseSpecialCharSequences: false} ); - cy.get('[data-cy=save-button]').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('.page').should('contain.html', '
'); - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=editor-content]').should('not.contain.class', 'custom-css-scope'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-customCssSelector]").type("new_input_css"); + cy.get("[data-cy=topbar-css]").click(); + cy.get("#custom-css").type( + "div[selector='new_input_css'] {background-color:red;padding:10px;}", + { parseSpecialCharSequences: false } + ); + cy.get("[data-cy=save-button]").click(); + cy.get("[data-cy=mode-preview]").click(); + cy.get(".page").should("contain.html", '
'); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=editor-content]").should( + "not.contain.class", + "custom-css-scope" + ); }); - it('Adds styling to element in preview mode', () => { - cy.visit('/'); + it("Adds styling to element in preview mode", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-customCssSelector]').type('new_input_css'); - cy.get('[data-cy=topbar-css]').click(); - cy.get('#custom-css').type('div[selector=\'new_input_css\'] {background-color:red;padding:10px;}', {parseSpecialCharSequences: false} ); - cy.get('[data-cy=save-button]').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('.page').should('contain.html', '
'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-customCssSelector]").type("new_input_css"); + cy.get("[data-cy=topbar-css]").click(); + cy.get("#custom-css").type( + "div[selector='new_input_css'] {background-color:red;padding:10px;}", + { parseSpecialCharSequences: false } + ); + cy.get("[data-cy=save-button]").click(); + cy.get("[data-cy=mode-preview]").click(); + cy.get(".page").should("contain.html", '
'); }); }); - \ No newline at end of file diff --git a/tests/e2e/specs/DatePicker.spec.js b/tests/e2e/specs/DatePicker.spec.js index 92487bd61..18f12822c 100644 --- a/tests/e2e/specs/DatePicker.spec.js +++ b/tests/e2e/specs/DatePicker.spec.js @@ -1,385 +1,559 @@ -import moment from 'moment-timezone'; +import moment from "moment-timezone"; -moment.tz.setDefault('UTC'); +moment.tz.setDefault("UTC"); -describe('Date Picker', () => { +describe("Date Picker", () => { beforeEach(() => { - cy.visit('/'); + cy.visit("/"); cy.openAcordeon("collapse-1"); cy.window().then((win) => { - win.ProcessMaker.user.timezone = 'UTC'; + win.ProcessMaker.user.timezone = "UTC"; }); }); - it('Date time picker with maxDate before minDate should show a validation error', () => { + it("Date time picker with maxDate before minDate should show a validation error", () => { const today = moment(new Date()); - const yesterday = moment(new Date()).subtract(1, 'days'); + const yesterday = moment(new Date()).subtract(1, "days"); cy.showValidationOnLoad(); - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-minDate]').clear().type(today.format('YYYY-MM-DD')); - cy.get('[data-cy=inspector-maxDate]').clear().type(yesterday.format('YYYY-MM-DD')); + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-minDate]") + .clear() + .type(today.format("YYYY-MM-DD")); + cy.get("[data-cy=inspector-maxDate]") + .clear() + .type(yesterday.format("YYYY-MM-DD")); // Assert error validation showing - cy.get('.invalid-feedback > div') - .should('be.visible') - .should('contain.text', 'Must be after or equal Minimum Date'); + cy.get(".invalid-feedback > div") + .should("be.visible") + .should("contain.text", "Must be after or equal Minimum Date"); }); - it('Date time picker with maxDate after minDate should not show a validation error', () => { + it("Date time picker with maxDate after minDate should not show a validation error", () => { const today = moment(new Date()); - const tomorrow = moment(new Date()).add(1, 'days'); - + const tomorrow = moment(new Date()).add(1, "days"); cy.showValidationOnLoad(); - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-minDate]').clear().type(today.format('YYYY-MM-DD')); - cy.get('[data-cy=inspector-maxDate]').clear().type(tomorrow.format('YYYY-MM-DD')); + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-minDate]") + .clear() + .type(today.format("YYYY-MM-DD")); + cy.get("[data-cy=inspector-maxDate]") + .clear() + .type(tomorrow.format("YYYY-MM-DD")); // Assert error validation not showing - cy.get('.invalid-feedback > div') - .should('be.not.visible'); + cy.get(".invalid-feedback > div").should("not.exist"); }); - it('Date type', () => { - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] input').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .selectable.today').click(); + it("Date type", () => { + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] input' + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .selectable.today' + ).click(); cy.assertPreviewData({ - form_date_picker_1: moment().format('YYYY-MM-DD'), + form_date_picker_1: moment().format("YYYY-MM-DD") }); }); - it("Date type with readOnly as true shouldn't be able to clear the date" , () => { - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=inspector-disabled]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-defaultValue-js]').click(); - cy.setVueComponentValue('[data-cy=inspector-defaultValue-jsValue]', 'return new Date();'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] vdpClearInput').should('not.exist'); + it("Date type with readOnly as true shouldn't be able to clear the date", () => { + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=inspector-disabled]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-defaultValue-js]").click(); + cy.setVueComponentValue( + "[data-cy=inspector-defaultValue-jsValue]", + "return new Date();" + ); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] vdpClearInput' + ).should("not.exist"); cy.assertPreviewData({ - form_date_picker_1: moment().format('YYYY-MM-DD'), + form_date_picker_1: moment().format("YYYY-MM-DD") }); }); - it('DateTime type', () => { - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Datetime'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] input').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .selectable.today').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpHoursInput').type("8"); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpMinutesInput').type("{moveToEnd}15"); - - const today = moment.utc({hour: 8, minute: 15}); + it("DateTime type", () => { + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Datetime"); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] input' + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .selectable.today' + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpHoursInput' + ).type("8"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpMinutesInput' + ).type("{moveToEnd}15"); + + const today = moment.utc({ hour: 8, minute: 15 }); cy.assertPreviewData({ - form_date_picker_1: today.toISOString(), + form_date_picker_1: today.toISOString() }); }); - it('Date time picker should update the helper text', () => { - const helperTextFirstChange = 'Testing helper text'; - const helperTextSecondChange = 'Testing helper text 2'; - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-helper]').type(helperTextFirstChange); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=screen-field-form_date_picker_1]').should('contain.text', helperTextFirstChange); - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-helper]').clear().type(helperTextSecondChange); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=screen-field-form_date_picker_1]').should('contain.text', helperTextSecondChange); + it("Date time picker should update the helper text", () => { + const helperTextFirstChange = "Testing helper text"; + const helperTextSecondChange = "Testing helper text 2"; + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=screen-element-container]").first().click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-helper]").type(helperTextFirstChange); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=screen-field-form_date_picker_1]").should( + "contain.text", + helperTextFirstChange + ); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").first().click(); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-helper]").clear().type(helperTextSecondChange); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=screen-field-form_date_picker_1]").should( + "contain.text", + helperTextSecondChange + ); }); - it('Date picker with default value should show the default value on input and data', () => { - const date = moment(new Date()).subtract(2, 'days').format('MM/DD/YYYY'); - - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-defaultValue-basicValue]').clear().type(date); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent').should('be', date); + it("Date picker with default value should show the default value on input and data", () => { + const date = moment(new Date()).subtract(2, "days").format("MM/DD/YYYY"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=screen-element-container]").first().click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-defaultValue-basicValue]").clear().type(date); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent input' + ).should("contain.value", date); cy.assertPreviewData({ - form_date_picker_1: moment(date).format('YYYY-MM-DD'), + form_date_picker_1: moment(date).format("YYYY-MM-DD") }); }); - it('Date picker with minDate less than first datepicker should return null data', () => { - const date = moment(new Date()).format('MM/DD/YYYY'); - const dateBefore = moment(new Date()).subtract(1, 'days').format('MM/DD/YYYY'); - - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-minDate]').clear().type('{{}{{}form_date_picker_1{}}{}}'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"]').type(date); - cy.get('[data-cy=preview-content]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]').type(dateBefore); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] input').click(); + it("Date picker with minDate less than first datepicker should return null data", () => { + const date = moment(new Date()).format("MM/DD/YYYY"); + const dateBefore = moment(new Date()) + .subtract(1, "days") + .format("MM/DD/YYYY"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").first().click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-minDate]") + .clear() + .type("{{}{{}form_date_picker_1{}}{}}"); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"]' + ).type(date); + cy.get("[data-cy=preview-content]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]' + ).type(dateBefore); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]' + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] input' + ).click(); cy.assertPreviewData({ - form_date_picker_1: moment(date).format('YYYY-MM-DD'), - form_date_picker_2: null, + form_date_picker_1: moment(date).format("YYYY-MM-DD"), + form_date_picker_2: null }); }); - it('Date picker with maxDate greater than first datepicker should return null data', () => { - const date = moment(new Date()).format('MM/DD/YYYY'); - const dateAfter = moment(new Date()).add(1, 'days').format('MM/DD/YYYY'); - - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-minDate]').clear().type('{{}{{}form_date_picker_1{}}{}}'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"]').type(date); - cy.get('[data-cy=preview-content]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]').type(dateAfter); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] input').click(); + it("Date picker with maxDate greater than first datepicker should return null data", () => { + const date = moment(new Date()).format("MM/DD/YYYY"); + const dateAfter = moment(new Date()).add(1, "days").format("MM/DD/YYYY"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").last().click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-minDate]") + .clear() + .type("{{}{{}form_date_picker_1{}}{}}"); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"]' + ).type(date); + cy.get("[data-cy=preview-content]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]' + ).type(dateAfter); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]' + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] input' + ).click(); cy.assertPreviewData({ - form_date_picker_1: moment(date).format('YYYY-MM-DD'), - form_date_picker_2: null, + form_date_picker_1: moment(date).format("YYYY-MM-DD"), + form_date_picker_2: null }); }); - it('Date picker with minDate equal or less than first datepicker should return the current date', () => { - const date = moment(new Date()).format('MM/DD/YYYY'); - const dateSame = moment(new Date()).format('MM/DD/YYYY'); - - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-minDate]').clear().type('{{}{{}form_date_picker_1{}}{}}'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent').type(date); - cy.get('[data-cy=preview-content]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent').type(dateSame); - cy.get('[data-cy=preview-content]').click(); + it("Date picker with minDate equal or less than first datepicker should return the current date", () => { + const date = moment(new Date()).format("MM/DD/YYYY"); + const dateSame = moment(new Date()).format("MM/DD/YYYY"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").last().click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-minDate]") + .clear() + .type("{{}{{}form_date_picker_1{}}{}}"); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent' + ).type(date); + cy.get("[data-cy=preview-content]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent' + ).type(dateSame); + cy.get("[data-cy=preview-content]").click(); cy.assertPreviewData({ - form_date_picker_1: moment(date).format('YYYY-MM-DD'), - form_date_picker_2: moment(dateSame).format('YYYY-MM-DD'), + form_date_picker_1: moment(date).format("YYYY-MM-DD"), + form_date_picker_2: moment(dateSame).format("YYYY-MM-DD") }); }); - it('Date picker with maxDate equal or greater than first datepicker should return the current date', () => { - const date = moment(new Date()).format('MM/DD/YYYY'); - const dateSame = moment(new Date()).format('MM/DD/YYYY'); - - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-minDate]').clear().type('{{}{{}form_date_picker_1{}}{}}'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent').type(date); - cy.get('[data-cy=preview-content]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent').type(dateSame); - cy.get('[data-cy=preview-content]').click(); + it("Date picker with maxDate equal or greater than first datepicker should return the current date", () => { + const date = moment(new Date()).format("MM/DD/YYYY"); + const dateSame = moment(new Date()).format("MM/DD/YYYY"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").last().click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-minDate]") + .clear() + .type("{{}{{}form_date_picker_1{}}{}}"); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent' + ).type(date); + cy.get("[data-cy=preview-content]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent' + ).type(dateSame); + cy.get("[data-cy=preview-content]").click(); cy.assertPreviewData({ - form_date_picker_1: moment(date).format('YYYY-MM-DD'), - form_date_picker_2: moment(dateSame).format('YYYY-MM-DD'), + form_date_picker_1: moment(date).format("YYYY-MM-DD"), + form_date_picker_2: moment(dateSame).format("YYYY-MM-DD") }); }); - it('Date picker with minDate and maxDate should show the value in Data Preview', () => { - const date = moment(new Date()).format('MM/DD/YYYY'); - const minDate = moment(new Date()).subtract('5', 'days').format('MM/DD/YYYY'); - const maxDate = moment(new Date()).add('5', 'days').format('MM/DD/YYYY'); - - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-minDate]').clear().type(minDate); - cy.get('[data-cy=inspector-maxDate]').clear().type(maxDate); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent').type(date); - cy.get('[data-cy=preview-content]').click(); + it("Date picker with minDate and maxDate should show the value in Data Preview", () => { + const date = moment(new Date()).format("MM/DD/YYYY"); + const minDate = moment(new Date()) + .subtract("5", "days") + .format("MM/DD/YYYY"); + const maxDate = moment(new Date()).add("5", "days").format("MM/DD/YYYY"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=screen-element-container]").last().click(); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-minDate]").clear().type(minDate); + cy.get("[data-cy=inspector-maxDate]").clear().type(maxDate); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent' + ).type(date); + cy.get("[data-cy=preview-content]").click(); cy.assertPreviewData({ - form_date_picker_1: moment(date).format('YYYY-MM-DD') + form_date_picker_1: moment(date).format("YYYY-MM-DD") }); }); - it('Date time picker with minDate less than first datepicker should return null data', () => { - const date = moment(new Date()).format('MM/DD/YYYY'); - const dateBefore = moment(new Date()).subtract(1, 'days').format('MM/DD/YYYY'); - - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Datetime'); - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Datetime'); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-minDate]').clear().type('{{}{{}form_date_picker_1{}}{}}'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent').type(date); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent').type(dateBefore); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] input').click(); - cy.get('[data-cy=preview-content]').click(); + it("Date time picker with minDate less than first datepicker should return null data", () => { + const date = moment(new Date()).format("MM/DD/YYYY"); + const dateBefore = moment(new Date()) + .subtract(1, "days") + .format("MM/DD/YYYY"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Datetime"); + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").last().click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Datetime"); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-minDate]") + .clear() + .type("{{}{{}form_date_picker_1{}}{}}"); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent' + ).type(date); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent' + ).type(dateBefore); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent' + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] input' + ).click(); + cy.get("[data-cy=preview-content]").click(); cy.assertPreviewData({ form_date_picker_1: moment(date).toISOString(), - form_date_picker_2: null, + form_date_picker_2: null }); }); - it('Date time picker with minDate equal than first datepicker should return the current date', () => { - const date = moment(new Date()).format('MM/DD/YYYY'); - const dateSame = moment(new Date()).format('MM/DD/YYYY'); - - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Datetime'); - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Datetime'); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-minDate]').clear().type('{{}{{}form_date_picker_1{}}{}}'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent').type(date); - cy.get('[data-cy=preview-content]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent').type(dateSame); - cy.get('[data-cy=preview-content]').click(); + it("Date time picker with minDate equal than first datepicker should return the current date", () => { + const date = moment(new Date()).format("MM/DD/YYYY"); + const dateSame = moment(new Date()).format("MM/DD/YYYY"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Datetime"); + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").first().click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Datetime"); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-minDate]") + .clear() + .type("{{}{{}form_date_picker_1{}}{}}"); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent' + ).type(date); + cy.get("[data-cy=preview-content]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent' + ).type(dateSame); + cy.get("[data-cy=preview-content]").click(); cy.assertPreviewData({ form_date_picker_1: moment(date).toISOString(), - form_date_picker_2: moment(dateSame).toISOString(), + form_date_picker_2: moment(dateSame).toISOString() }); }); - it('Date time picker validate when the user enter a string instead of a valid date', () => { - const date = moment(new Date()).format('MM/DD/YYYY'); - const dateSame = moment(new Date()).format('MM/DD/YYYY'); - - - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent').type('fooBarr{enter}'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent').click(); + it("Date time picker validate when the user enter a string instead of a valid date", () => { + const date = moment(new Date()).format("MM/DD/YYYY"); + const dateSame = moment(new Date()).format("MM/DD/YYYY"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").first().click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent' + ).type("fooBarr{enter}"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent' + ).click(); cy.assertPreviewData({ form_date_picker_1: null, form_date_picker_2: null }); }); - it('Date time picker validate enter a valid date + string', () => { - const date = moment(new Date()).format('MM/DD/YYYY'); - const dateSame = moment(new Date()).format('MM/DD/YYYY'); - - - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Datetime'); - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Datetime'); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent').type(date+"{enter}"); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent').type(date + "foo{enter}"); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent').click(); + it("Date time picker validate enter a valid date + string", () => { + const date = moment(new Date()).format("MM/DD/YYYY"); + const dateSame = moment(new Date()).format("MM/DD/YYYY"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Datetime"); + + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").first().click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Datetime"); + + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent' + ).type(`${date}{enter}`); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent' + ).type(`${date}foo{enter}`); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"] .vdpComponent' + ).click(); cy.assertPreviewData({ - form_date_picker_1: moment(date).toISOString(), + form_date_picker_1: moment(date).toISOString(), form_date_picker_2: null }); }); it("Date picker with Required validation shouldn't allow the user to submit the date if empty", () => { - const date = moment(new Date()).format('MM/DD/YYYY'); + const date = moment(new Date()).format("MM/DD/YYYY"); cy.showValidationOnLoad(); - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date'); - cy.get('[data-cy=add-rule]').click(); - cy.setMultiselect('[data-cy=select-rule]', 'Required'); - cy.get('[data-cy=save-rule]').click(); - cy.get('[data-cy=controls-FormButton]').first().drag('[data-cy=screen-element-container]', 'bottom'); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('.invalid-feedback').contains('Field is required'); - cy.get('.vdpComponent input').should('have.class', 'is-invalid'); - cy.get('.btn-primary').should('have.class', 'disabled'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent').type(date+"{enter}"); - cy.get('[data-cy=preview-content]').click(); + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date"); + cy.get("[data-cy=add-rule]").click(); + cy.setMultiselect("[data-cy=select-rule]", "Required"); + cy.get("[data-cy=save-rule]").click(); + cy.get("[data-cy=controls-FormButton]") + .first() + .drag("[data-cy=screen-element-container]", { position: "bottom" }); + + cy.get("[data-cy=mode-preview]").click(); + cy.get(".invalid-feedback").contains("Field is required"); + cy.get(".vdpComponent input").should("have.class", "is-invalid"); + cy.get(".btn-primary").should("have.class", "disabled"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent' + ).type(`${date}{enter}`); + cy.get("[data-cy=preview-content]").click(); cy.wait(500); - cy.get('.btn-primary').should('not.have.class', 'disabled'); - cy.get('.vdpClearInput').click(); + cy.get(".btn-primary").should("not.have.class", "disabled"); + cy.get(".vdpClearInput").click(); cy.wait(500); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent').should('not.contain.value', date); - cy.get('.vdpComponent input').should('have.class', 'is-invalid'); - cy.get('.btn-primary').should('have.class', 'disabled'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] .vdpComponent' + ).should("not.contain.value", date); + cy.get(".vdpComponent input").should("have.class", "is-invalid"); + cy.get(".btn-primary").should("have.class", "disabled"); cy.assertPreviewData({ - form_date_picker_1: "", + form_date_picker_1: "" }); - }) - it('Date Time Picker should have the class .datePicker applied in design mode', () => { - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container] .vdpComponent') - .should('have.class', 'datePicker'); + }); + it("Date Time Picker should have the class .datePicker applied in design mode", () => { + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container] .vdpComponent").should( + "have.class", + "datePicker" + ); }); - it('Date Time Picker should have the class .datePicker applied in preview mode', () => { - - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] .vdpComponent') - .should('have.class', 'datePicker'); + it("Date Time Picker should have the class .datePicker applied in preview mode", () => { + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] .vdpComponent").should( + "have.class", + "datePicker" + ); }); }); diff --git a/tests/e2e/specs/DatePickerTimezone.spec.js b/tests/e2e/specs/DatePickerTimezone.spec.js index 53d3e5d10..54317fd17 100644 --- a/tests/e2e/specs/DatePickerTimezone.spec.js +++ b/tests/e2e/specs/DatePickerTimezone.spec.js @@ -1,5 +1,6 @@ /* eslint-disable no-param-reassign */ import moment from "moment-timezone"; + const timezoneTest = "America/Los_Angeles"; moment.tz.setDefault(timezoneTest); @@ -12,7 +13,7 @@ describe("Date Picker", () => { }); }); - it("DateTime type", () => { + it("should convert the date from ther users timezone to UTC", () => { cy.get("[data-cy=controls-FormDatePicker]").drag( "[data-cy=screen-drop-zone]", "bottom" @@ -41,20 +42,15 @@ describe("Date Picker", () => { }); cy.wait(500); + const todaysDate = moment(); + const todayDateChanged = `${moment + .tz(todaysDate, "America/Los_Angeles") + .format("YYYY-MM-DD")}T20:15:00`; + const today = moment(todayDateChanged).utc(); + cy.log("today", today.toISOString()); - let todayDateChanged = `${moment().format("YYYY-MM-DD")}T20:15:00`; - let today = moment.tz(todayDateChanged, timezoneTest); - - cy.get('input[aria-label="New Date Picker"]').invoke('val') - .then(dateVal => { - let today2 = moment.tz(dateVal, timezoneTest); - let todayA = today; - let todayB = today; - todayA = todayA.toISOString().substr(0,7); - todayB = todayB.toISOString().substr(13,(today.toISOString().length-1)); - let datePicker = today2.toISOString(); - expect(datePicker).to.contains(todayA); - expect(datePicker).to.contains(todayB); - }); + cy.assertPreviewData({ + form_date_picker_1: moment(today).toISOString() + }); }); }); diff --git a/tests/e2e/specs/DefaulValueWithNestedAndRecordList.js b/tests/e2e/specs/DefaulValueWithNestedAndRecordList.js index 1e2b984fd..c3fe2401d 100644 --- a/tests/e2e/specs/DefaulValueWithNestedAndRecordList.js +++ b/tests/e2e/specs/DefaulValueWithNestedAndRecordList.js @@ -1,49 +1,44 @@ - -describe('Validation Default value', () => { +describe("Validation Default value", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('Verify with mustache in nested and record list', () => { - cy.loadFromJson('parent_record_list_and_loop.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Verify with mustache in nested and record list", () => { + cy.loadFromJson("parent_record_list_and_loop.json", 0); + cy.get("[data-cy=mode-preview]").click(); - fillInputText('screen-field-parentValue', 0, 130); + fillInputText("screen-field-parentValue", 0, 130); - cy.assertPreviewData( - { - "parentValue": "130", - "loop_1": [ - { - "form_record_list_1": null - } - ], - "loop_2": [ - { - "form_input_1": "130" - } - ] - } - ); + cy.assertPreviewData({ + parentValue: "130", + loop_1: [ + { + form_record_list_1: null + } + ], + loop_2: [ + { + form_input_1: "130" + } + ] + }); - cy.get('[data-cy=add-row]').click() - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_1]').should('have.value', '130'); - + cy.get("[data-cy=add-row]").click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_1]" + ).should("have.value", "130"); }); - }); -function fillInputText(dataCy, index = null, value = 'test') -{ +function fillInputText(dataCy, index = null, value = "test") { if (index === null) { cy.get(`[data-cy=preview-content] [data-cy="${dataCy}"]`) .clear() .type(value); } else { - cy.get(`[data-cy=preview-content] [data-cy="${dataCy}"]`).eq(index) + cy.get(`[data-cy=preview-content] [data-cy="${dataCy}"]`) + .eq(index) .clear() .type(value); } } - diff --git a/tests/e2e/specs/DefaultValueFromCalculatedField.spec.js b/tests/e2e/specs/DefaultValueFromCalculatedField.spec.js index c2530eafa..f756ed265 100644 --- a/tests/e2e/specs/DefaultValueFromCalculatedField.spec.js +++ b/tests/e2e/specs/DefaultValueFromCalculatedField.spec.js @@ -1,19 +1,17 @@ -describe('Computed field and default values', () => { +describe("Computed field and default values", () => { + it("Test default values with computed fields", () => { + cy.visit("/"); - it('Test default values with computed fields', () => { - cy.visit('/'); - cy.server(); - cy.loadFromJson('FOUR-6523.json', 0); + cy.loadFromJson("FOUR-6523.json", 0); // Preview - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); cy.assertPreviewData({ - 'c': null, - 'a': '0', - 'b': 0, - 'total': 0, + c: null, + a: "0", + b: 0, + total: 0 }); - }); }); diff --git a/tests/e2e/specs/DefaultValues.spec.js b/tests/e2e/specs/DefaultValues.spec.js index 3fdfacea0..4fdff56c7 100644 --- a/tests/e2e/specs/DefaultValues.spec.js +++ b/tests/e2e/specs/DefaultValues.spec.js @@ -1,62 +1,79 @@ -describe('Default values', () => { - it('Basic default value', () => { - cy.visit('/'); +describe("Default values", () => { + it("Basic default value", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-defaultValue-basicValue]').clear().type('initial value'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.value', 'initial value'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-defaultValue-basicValue]") + .clear() + .type("initial value"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.value", + "initial value" + ); cy.assertPreviewData({ - form_input_1: 'initial value', + form_input_1: "initial value" }); }); - + it('Text Input Default value if the variable has the next format "people.firstName"', () => { - cy.visit('/'); + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]').clear().type('people.firstName'); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-defaultValue-basicValue]').clear().type('initial value'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name="people.firstName"]').should('have.value', 'initial value'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]").clear().type("people.firstName"); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-defaultValue-basicValue]") + .clear() + .type("initial value"); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy=preview-content] [name="people.firstName"]').should( + "have.value", + "initial value" + ); cy.assertPreviewData({ - people:{ - firstName: 'initial value' + people: { + firstName: "initial value" } }); }); it('Select List- Default if the variable has the next format "numbers.int"', () => { - cy.visit('/'); + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormSelectList]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]').clear().type('number.int'); - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Provide Values'); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('one'); - cy.get('[data-cy=inspector-option-content]').type('one'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('two'); - cy.get('[data-cy=inspector-option-content]').type('two'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('three'); - cy.get('[data-cy=inspector-option-content]').type('three'); - cy.get('[data-cy=inspector-option-cancel]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('four'); - cy.get('[data-cy=inspector-option-content]').type('four'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-defaultValue-basicValue]').clear().type('two'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=controls-FormSelectList]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]").clear().type("number.int"); + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Provide Values"); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("one"); + cy.get("[data-cy=inspector-option-content]").type("one"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("two"); + cy.get("[data-cy=inspector-option-content]").type("two"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("three"); + cy.get("[data-cy=inspector-option-content]").type("three"); + cy.get("[data-cy=inspector-option-cancel]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("four"); + cy.get("[data-cy=inspector-option-content]").type("four"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-defaultValue-basicValue]").clear().type("two"); + cy.get("[data-cy=mode-preview]").click(); cy.assertPreviewData({ number: { int: "two" @@ -64,77 +81,112 @@ describe('Default values', () => { }); }); - it('Javascript default value', () => { - cy.visit('/'); + it("Javascript default value", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.setPreviewDataInput({name: 'world'}); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-defaultValue-js]').click(); - cy.setVueComponentValue('[data-cy=inspector-defaultValue-jsValue]', 'return `hello ${this.name}`;'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.value', 'hello world'); + cy.setPreviewDataInput({ name: "world" }); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-defaultValue-js]").click(); + cy.setVueComponentValue( + "[data-cy=inspector-defaultValue-jsValue]", + "return `hello ${this.name}`;" + ); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.value", + "hello world" + ); cy.assertPreviewData({ - name: 'world', - form_input_1: 'hello world', + name: "world", + form_input_1: "hello world" }); }); - it('Initially checked checkbox', () => { - cy.visit('/'); + it("Initially checked checkbox", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormCheckbox]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-initiallyChecked]').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_checkbox_1]').should('have.prop', 'checked'); + cy.get("[data-cy=controls-FormCheckbox]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-initiallyChecked]").click(); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_1]").should( + "have.prop", + "checked" + ); cy.assertPreviewData({ - form_checkbox_1: true, + form_checkbox_1: true }); }); - it('Dynamic Basic default value', () => { - cy.visit('/'); + it("Dynamic Basic default value", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); // Add an input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); // Add a second input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container]', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); - cy.get('[data-cy=screen-element-container]').eq(1).click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-defaultValue-basicValue]').clear().type('initial value - {{form_input_2}}', {parseSpecialCharSequences: false}); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=screen-element-container]").first().click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-defaultValue-basicValue]") + .clear() + .type("initial value - {{form_input_2}}", { + parseSpecialCharSequences: false + }); + cy.get("[data-cy=mode-preview]").click(); cy.assertPreviewData({ - form_input_2: '', - form_input_1: 'initial value - ', + form_input_2: "", + form_input_1: "initial value - " }); - cy.get('[data-cy=preview-content] [name=form_input_2]').clear().type('next value'); + cy.get("[data-cy=preview-content] [name=form_input_2]") + .clear() + .type("next value"); cy.assertPreviewData({ - form_input_2: 'next value', - form_input_1: 'initial value - next value', + form_input_2: "next value", + form_input_1: "initial value - next value" }); }); - it('Dynamic Javascript default value', () => { - cy.visit('/'); + it("Dynamic Javascript default value", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); // Add an input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); // Add a second input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container]', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); - cy.get('[data-cy=screen-element-container]').eq(1).click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-defaultValue-js]').click(); - cy.setVueComponentValue('[data-cy=inspector-defaultValue-jsValue]', 'return `initial value - ${this.form_input_2 || ""}`;'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=screen-element-container]").first().click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-defaultValue-js]").click(); + cy.setVueComponentValue( + "[data-cy=inspector-defaultValue-jsValue]", + 'return `initial value - ${this.form_input_2 || ""}`;' + ); + cy.get("[data-cy=mode-preview]").click(); cy.assertPreviewData({ - form_input_2: '', - form_input_1: 'initial value - ', + form_input_2: "", + form_input_1: "initial value - " }); - cy.get('[data-cy=preview-content] [name=form_input_2]').clear().type('next value'); + cy.get("[data-cy=preview-content] [name=form_input_2]") + .clear() + .type("next value"); cy.assertPreviewData({ - form_input_2: 'next value', - form_input_1: 'initial value - next value', + form_input_2: "next value", + form_input_1: "initial value - next value" }); }); }); diff --git a/tests/e2e/specs/DefaultValuesWithComputedFields.spec.js b/tests/e2e/specs/DefaultValuesWithComputedFields.spec.js index 7f6a9d3f3..be11da472 100644 --- a/tests/e2e/specs/DefaultValuesWithComputedFields.spec.js +++ b/tests/e2e/specs/DefaultValuesWithComputedFields.spec.js @@ -1,12 +1,11 @@ -describe('Computed field and default values', () => { +describe("Computed field and default values", () => { + it("Test default values with computed fields", () => { + cy.visit("/"); - it('Test default values with computed fields', () => { - cy.visit('/'); - cy.server(); - cy.loadFromJson('default_values_with_computed_fields.json', 0); + cy.loadFromJson("default_values_with_computed_fields.json", 0); // Preview - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Assertion: Calculated properties are correct: // - varA = 1 @@ -14,10 +13,9 @@ describe('Computed field and default values', () => { // Control with default value is correct: // - uno = {{varA}} = "1" cy.assertPreviewData({ - 'uno': '1', - 'varA': 1, - 'res': 'ok', + uno: "1", + varA: 1, + res: "ok" }); - }); }); diff --git a/tests/e2e/specs/DeviceVisivilityInspector.spec.js b/tests/e2e/specs/DeviceVisivilityInspector.spec.js index c6710efb6..7950a50c1 100644 --- a/tests/e2e/specs/DeviceVisivilityInspector.spec.js +++ b/tests/e2e/specs/DeviceVisivilityInspector.spec.js @@ -5,462 +5,572 @@ import { previewScreenWebMobile, addControlInsideTable, goToDesigner -}from '../support/utils.js'; -import {nodeControls} from '../support/constants.js' +} from "../support/utils.js"; +import { nodeControls } from "../support/constants.js"; -describe('Device Visiblility Inspector', () => { - it('Verify if an input has device visiblility settings', () => { - cy.visit('/'); +describe("Device Visiblility Inspector", () => { + it("Verify if an input has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a checkbox has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a checkbox has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormCheckbox]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormCheckbox]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a datePicker has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a datePicker has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormDatePicker]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a FileDownload has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a FileDownload has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-5"); - cy.get('[data-cy=controls-FileDownload]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FileDownload]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a FileUpload has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a FileUpload has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-5"); - cy.get('[data-cy=controls-FileUpload]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FileUpload]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a FormImage has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a FormImage has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormImage]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormImage]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a FormLoop has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a FormLoop has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormLoop]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormLoop]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a FormMultiColumn has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a FormMultiColumn has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormMultiColumn]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormMultiColumn]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a FormNestedScreen has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a FormNestedScreen has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormNestedScreen]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormNestedScreen]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a FormButton has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a FormButton has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormButton]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormButton]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a FormRecordList has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a FormRecordList has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormRecordList]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormRecordList]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a FormHtmlViewer has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a FormHtmlViewer has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormHtmlViewer]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormHtmlViewer]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a FormSelectList has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a FormSelectList has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormSelectList]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormSelectList]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify if a FormTextArea has device visiblility settings', () => { - cy.visit('/'); + it("Verify if a FormTextArea has device visiblility settings", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Enabled device visiblility', () => { - cy.visit('/'); + it("Enabled device visiblility", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - expect(control.children('input')).to.have.length(1); + expect(control.children("input")).to.have.length(1); // get label - expect(control.children('label')).to.have.length(1); + expect(control.children("label")).to.have.length(1); // get Window reference from element - const win = control.children('label')[0].ownerDocument.defaultView; + const win = control.children("label")[0].ownerDocument.defaultView; // use getComputedStyle to read the pseudo selector - const before = win.getComputedStyle(control.children('label')[0], 'before'); + const before = win.getComputedStyle( + control.children("label")[0], + "before" + ); // read the value of the `content` CSS property - const contentValue = before.getPropertyValue('background-color'); + const contentValue = before.getPropertyValue("background-color"); // the returned value will have double quotes around it, but this is correct - expect(contentValue).to.eq('rgb(0, 123, 255)'); + expect(contentValue).to.eq("rgb(0, 123, 255)"); // if have a label - expect(control.children('label')).to.have.length(1); + expect(control.children("label")).to.have.length(1); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it.skip('Disabled device visiblility', () => { - cy.visit('/'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + it("Disabled device visiblility", () => { + cy.visit("/"); + cy.openAcordeon("collapse-1"); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { // forced click over the control - control.children('input').trigger("click"); + control.children("input").trigger("click"); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); cy.wait(200); - cy.get('[data-cy=inspector-deviceVisibility]').children().children('.custom-control') + cy.get("[data-cy=inspector-deviceVisibility]") + .children() + .children(".custom-control") .each((control) => { - //GET INPUT - expect(control.children('input')).to.have.length(1); + // GET INPUT + expect(control.children("input")).to.have.length(1); // get label - expect(control.children('label')).to.have.length(1); + expect(control.children("label")).to.have.length(1); // get Window reference from element - const win = control.children('label')[0].ownerDocument.defaultView; + const win = control.children("label")[0].ownerDocument.defaultView; // use getComputedStyle to read the pseudo selector - const before = win.getComputedStyle(control.children('label')[0], 'before'); + const before = win.getComputedStyle( + control.children("label")[0], + "before" + ); // read the value of the `content` CSS property - const contentValue = before.getPropertyValue('background-color'); + const contentValue = before.getPropertyValue("background-color"); // the returned value will have double quotes around it, but this is correct - expect(contentValue).to.eq('rgb(255, 255, 255)'); + expect(contentValue).to.eq("rgb(255, 255, 255)"); }) .then(($lis) => { expect($lis).to.have.length(2); // true }); }); - it('Verify Device Visibility of controls inside a loop', () => { - cy.visit('/'); - //Step 1: Add Loop - addControl('Loop'); + it("Verify Device Visibility of controls inside a loop", () => { + cy.visit("/"); + // Step 1: Add Loop + addControl("Loop"); cy.openAcordeon("collapse-1"); - //Step 2: Add Line input inside the loop - addControlInsideLoop(1,nodeControls.formInput); - cy.get('[data-cy=accordion-Advanced]').click(); + // Step 2: Add Line input inside the loop + addControlInsideLoop(1, nodeControls.formInput); + cy.get("[data-cy=accordion-Advanced]").click(); - //Step 3: Verify that Device Visibility is visible - cy.get('[data-cy=inspector-deviceVisibility]').should('be.visible'); + // Step 3: Verify that Device Visibility is visible + cy.get("[data-cy=inspector-deviceVisibility]").should("be.visible"); - //Step 4: Disable for Show for desktop - cy.get('[data-cy="inspector-deviceVisibility"]>* div:nth-child(2) > label').click(); + // Step 4: Disable for Show for desktop + cy.get( + '[data-cy="inspector-deviceVisibility"]>* div:nth-child(2) > label' + ).click(); - //Step 5: Press Preview button + // Step 5: Press Preview button previewScreen(); - //Step 6: Verify that line input is not visible in Web - previewScreenWebMobile('desktop'); - cy.get('body') - .then($body => { - let lineinputControlls = $body.find('[name="form_input_1"]').length; - for (let i = 0; i { + const lineinputControlls = $body.find('[name="form_input_1"]').length; + for (let i = 0; i < lineinputControlls; i++) { + cy.get('[name="form_input_1"]').eq(i).should("not.be.visible"); + } + }); + + // Step 7: Verify that line input is visible in Mobile + previewScreenWebMobile("mobile"); }); - it('Verify Device Visibility of controls inside a Record List', () => { - cy.server(); + it("Verify Device Visibility of controls inside a Record List", () => { cy.visit("/"); - //Step 1: Upload the screen Record List - let filePath = 'recordListDeviceVisibility.json'; + // Step 1: Upload the screen Record List + const filePath = "recordListDeviceVisibility.json"; cy.loadFromJson(filePath, 0); - //Step 2: Press Preview button + // Step 2: Press Preview button previewScreen(); - //Step 3: Verify that line input is not visible in record list - previewScreenWebMobile('desktop'); + // Step 3: Verify that line input is not visible in record list + previewScreenWebMobile("desktop"); cy.get('[data-cy="add-row"]').click(); - cy.get('[data-cy="modal-add"]>* footer>button:nth-child(1)').should('be.visible'); - cy.get('[data-cy="screen-field-a"]').first().should('be.visible'); - cy.get('[data-cy="screen-field-b"]').first().should('not.be.visible'); + cy.get('[data-cy="modal-add"]>* footer>button:nth-child(1)').should( + "be.visible" + ); + cy.get('[data-cy="screen-field-a"]').first().should("be.visible"); + cy.get('[data-cy="screen-field-b"]').first().should("not.be.visible"); - //Step 4: Close the modal + // Step 4: Close the modal cy.get('[data-cy="modal-add"]>* button[aria-label="Close"]').click(); - //Step 5: Verify that line input is visible in record list - previewScreenWebMobile('mobile'); + // Step 5: Verify that line input is visible in record list + previewScreenWebMobile("mobile"); cy.get('[data-cy="add-row"]').click(); - cy.get('[data-cy="modal-add"]>* footer>button:nth-child(1)').should('be.visible'); - cy.get('[data-cy="screen-field-a"]').first().should('not.be.visible'); - cy.get('[data-cy="screen-field-b"]').first().should('be.visible'); - + cy.get('[data-cy="modal-add"]>* footer>button:nth-child(1)').should( + "be.visible" + ); + cy.get('[data-cy="screen-field-a"]').first().should("not.be.visible"); + cy.get('[data-cy="screen-field-b"]').first().should("be.visible"); }); - it('Verify Device Visibility of controls inside a table', () => { - cy.visit('/'); + it("Verify Device Visibility of controls inside a table", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); cy.openAcordeon("collapse-1"); - //Step 1: Add Loop - addControl('Multicolumn / Table'); + // Step 1: Add Loop + addControl("Multicolumn / Table"); - //Step 2: Add Line input inside the loop - addControlInsideTable(1,nodeControls.formTextArea); - cy.get('[data-cy=accordion-Advanced]').click(); + // Step 2: Add Line input inside the loop + addControlInsideTable(1, nodeControls.formTextArea); + cy.get("[data-cy=accordion-Advanced]").click(); - //Step 3: Verify that Device Visibility is visible - cy.get('[data-cy=inspector-deviceVisibility]').should('be.visible'); + // Step 3: Verify that Device Visibility is visible + cy.get("[data-cy=inspector-deviceVisibility]").should("be.visible"); - //Step 4: Disable for Show for desktop - cy.get('[data-cy="inspector-deviceVisibility"]>* div:nth-child(2) > label').click(); + // Step 4: Disable for Show for desktop + cy.get( + '[data-cy="inspector-deviceVisibility"]>* div:nth-child(2) > label' + ).click(); - //Step 5: Press Preview button + // Step 5: Press Preview button previewScreen(); - //Step 6: Verify that line input is not visible in Web - previewScreenWebMobile('desktop'); - cy.get('[data-cy="screen-field-form_text_area_1"]').should('not.be.visible'); + // Step 6: Verify that line input is not visible in Web + previewScreenWebMobile("desktop"); + cy.get('[data-cy="screen-field-form_text_area_1"]').should( + "not.be.visible" + ); - //Step 7: Verify that line input is visible in Mobile - previewScreenWebMobile('mobile'); - cy.get('[data-cy="screen-field-form_text_area_1"]').should('be.visible'); + // Step 7: Verify that line input is visible in Mobile + previewScreenWebMobile("mobile"); + cy.get('[data-cy="screen-field-form_text_area_1"]').should("be.visible"); }); - it('Verify Device Visibility of controls inside a table mobile', () => { - cy.visit('/'); + it("Verify Device Visibility of controls inside a table mobile", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); cy.openAcordeon("collapse-1"); - //Step 1: Add Table - addControl('Multicolumn / Table'); + // Step 1: Add Table + addControl("Multicolumn / Table"); - //Step 2: Add Line input inside the loop - addControlInsideTable(1,nodeControls.formTextArea); - cy.get('[data-cy=accordion-Advanced]').click(); + // Step 2: Add Line input inside the loop + addControlInsideTable(1, nodeControls.formTextArea); + cy.get("[data-cy=accordion-Advanced]").click(); - //Step 3: Verify that Device Visibility is visible - cy.get('[data-cy=inspector-deviceVisibility]').should('be.visible'); + // Step 3: Verify that Device Visibility is visible + cy.get("[data-cy=inspector-deviceVisibility]").should("be.visible"); - //Step 4: Disable for Show for desktop - cy.get('[data-cy="inspector-deviceVisibility"]>* div:nth-child(3) > label').click(); + // Step 4: Disable for Show for desktop + cy.get( + '[data-cy="inspector-deviceVisibility"]>* div:nth-child(3) > label' + ).click(); - //Step 5: Press Preview button + // Step 5: Press Preview button previewScreen(); - //Step 6: Verify that line input is not visible in Web - previewScreenWebMobile('desktop'); - cy.get('[data-cy="screen-field-form_text_area_1"]').should('be.visible'); + // Step 6: Verify that line input is not visible in Web + previewScreenWebMobile("desktop"); + cy.get('[data-cy="screen-field-form_text_area_1"]').should("be.visible"); - //Step 7: Verify that line input is visible in Mobile - previewScreenWebMobile('mobile'); - cy.get('[data-cy="screen-field-form_text_area_1"]').should('not.be.visible'); + // Step 7: Verify that line input is visible in Mobile + previewScreenWebMobile("mobile"); + cy.get('[data-cy="screen-field-form_text_area_1"]').should( + "not.be.visible" + ); }); - it('Verify Device Visibility of a control and Visibility Rule', () => { + it("Verify Device Visibility of a control and Visibility Rule", () => { cy.visit("/"); - //Step 1: Add line input control - addControl('Line Input'); + // Step 1: Add line input control + addControl("Line Input"); - //Step 2: Configure the line Input + // Step 2: Configure the line Input cy.get('[data-cy="accordion-Advanced"]').click(); - cy.get('[data-cy="inspector-conditionalHide"').type('true'); + cy.get('[data-cy="inspector-conditionalHide"').type("true"); previewScreen(); - //Step 3: Verify that line input is not visible in web - previewScreenWebMobile('desktop'); - cy.get('[data-cy="screen-field-form_input_1"]').should('be.visible'); + // Step 3: Verify that line input is not visible in web + previewScreenWebMobile("desktop"); + cy.get('[data-cy="screen-field-form_input_1"]').should("be.visible"); - //Step 4: Verify that line input is visible in mobile - previewScreenWebMobile('mobile'); - cy.get('[data-cy="screen-field-form_input_1"]').should('be.visible'); + // Step 4: Verify that line input is visible in mobile + previewScreenWebMobile("mobile"); + cy.get('[data-cy="screen-field-form_input_1"]').should("be.visible"); - //Step 5: Change the configuration in line input + // Step 5: Change the configuration in line input goToDesigner(); - cy.get('[data-cy="inspector-conditionalHide"').clear().type('false'); + cy.get('[data-cy="inspector-conditionalHide"').clear().type("false"); previewScreen(); - //Step 6: Verify that line input is not visible in web - previewScreenWebMobile('desktop'); - cy.get('[data-cy="screen-field-form_input_1"]').should('not.be.visible'); + // Step 6: Verify that line input is not visible in web + previewScreenWebMobile("desktop"); + cy.get('[data-cy="screen-field-form_input_1"]').should("not.be.visible"); - //Step 7: Verify that line input is visible in mobile - previewScreenWebMobile('mobile'); - cy.get('[data-cy="screen-field-form_input_1"]').should('not.be.visible'); + // Step 7: Verify that line input is visible in mobile + previewScreenWebMobile("mobile"); + cy.get('[data-cy="screen-field-form_input_1"]').should("not.be.visible"); }); - it('Verify Device Visibility with dynamic variable', () => { - cy.server(); + it("Verify Device Visibility with dynamic variable", () => { cy.visit("/"); - //Step 1: Upload the screen Record List - let filePath = 'deviceVisibilityDynamic.json'; + // Step 1: Upload the screen Record List + const filePath = "deviceVisibilityDynamic.json"; cy.loadFromJson(filePath, 0); previewScreen(); - //Step 2: Verify that all controls are visible in Web - previewScreenWebMobile('desktop'); - cy.get('[name="visible"]+label').should('be.visible').click(); - cy.get('[data-cy="screen-field-form_checkbox_1"]').click().should('be.visible'); - cy.get('[data-cy="screen-field-form_date_picker_1"]').should('be.visible'); - cy.get('[data-cy="screen-field-file1"]').click().should('be.visible'); - cy.get('[data-cy="screen-field-form_input_1"]').click().should('be.visible'); - cy.get('[name="loop_1"]>* p').click().should('be.visible'); - cy.get('button[aria-label="Page Navigation"]').click().should('be.visible'); - cy.get('[data-cy="screen-field-form_select_list_1"]').click().should('be.visible'); - cy.get('[data-cy="screen-field-form_text_area_1"]').click().should('be.visible'); - cy.get('button[aria-label="New Submit"]').should('be.visible'); - - //Step 3: Configure checkbox visibility = false + // Step 2: Verify that all controls are visible in Web + previewScreenWebMobile("desktop"); + cy.get('[name="visible"]+label').should("be.visible").click(); + cy.get('[data-cy="screen-field-form_checkbox_1"]') + .click() + .should("be.visible"); + cy.get('[data-cy="screen-field-form_date_picker_1"]').should("be.visible"); + cy.get('[data-cy="screen-field-file1"]').click().should("be.visible"); + cy.get('[data-cy="screen-field-form_input_1"]') + .click() + .should("be.visible"); + cy.get('[name="loop_1"]>* p').click().should("be.visible"); + cy.get('button[aria-label="Page Navigation"]').click().should("be.visible"); + cy.get('[data-cy="screen-field-form_select_list_1"]') + .click() + .should("be.visible"); + cy.get('[data-cy="screen-field-form_text_area_1"]') + .click() + .should("be.visible"); + cy.get('button[aria-label="New Submit"]').should("be.visible"); + + // Step 3: Configure checkbox visibility = false goToDesigner(); - cy.get('[name="visible"]+label').first().click({force:true}); + cy.get('[name="visible"]+label').first().click({ force: true }); cy.get('[data-cy="accordion-Advanced"]').click(); - cy.get('[data-cy="inspector-deviceVisibility"]>* div:nth-child(2) > label').click(); + cy.get( + '[data-cy="inspector-deviceVisibility"]>* div:nth-child(2) > label' + ).click(); previewScreen(); - //Step 6: Verify that controls are visible in mobile - previewScreenWebMobile('mobile'); - cy.get('[name="visible"]+label').should('be.visible').click(); - cy.get('[data-cy="screen-field-form_checkbox_1"]').click().should('be.visible'); - cy.get('[data-cy="screen-field-form_date_picker_1"]').should('be.visible'); - cy.get('[data-cy="screen-field-file1"]').click().should('be.visible'); - cy.get('[data-cy="screen-field-form_input_1"]').click().should('be.visible'); - cy.get('[name="loop_1"]>* p').click().should('be.visible'); - cy.get('button[aria-label="Page Navigation"]').click().should('be.visible'); - cy.get('[data-cy="screen-field-form_select_list_1"]').click().should('be.visible'); - cy.get('[data-cy="screen-field-form_text_area_1"]').click().should('be.visible'); - cy.get('button[aria-label="New Submit"]').should('be.visible'); + // Step 6: Verify that controls are visible in mobile + previewScreenWebMobile("mobile"); + cy.get('[name="visible"]+label').should("be.visible").click(); + cy.get('[data-cy="screen-field-form_checkbox_1"]') + .click() + .should("be.visible"); + cy.get('[data-cy="screen-field-form_date_picker_1"]').should("be.visible"); + cy.get('[data-cy="screen-field-file1"]').click().should("be.visible"); + cy.get('[data-cy="screen-field-form_input_1"]') + .click() + .should("be.visible"); + cy.get('[name="loop_1"]>* p').click().should("be.visible"); + cy.get('button[aria-label="Page Navigation"]').click().should("be.visible"); + cy.get('[data-cy="screen-field-form_select_list_1"]') + .click() + .should("be.visible"); + cy.get('[data-cy="screen-field-form_text_area_1"]') + .click() + .should("be.visible"); + cy.get('button[aria-label="New Submit"]').should("be.visible"); }); }); diff --git a/tests/e2e/specs/DoubleLoop.spec.js b/tests/e2e/specs/DoubleLoop.spec.js index afa22948c..e519428a9 100644 --- a/tests/e2e/specs/DoubleLoop.spec.js +++ b/tests/e2e/specs/DoubleLoop.spec.js @@ -1,6 +1,5 @@ describe("Double loop tests", () => { beforeEach(() => { - cy.server(); cy.visit("/"); }); diff --git a/tests/e2e/specs/FOUR-6721_RAOS_People2.spec.js b/tests/e2e/specs/FOUR-6721_RAOS_People2.spec.js index 726f61514..2bd2a7098 100644 --- a/tests/e2e/specs/FOUR-6721_RAOS_People2.spec.js +++ b/tests/e2e/specs/FOUR-6721_RAOS_People2.spec.js @@ -1,5 +1,4 @@ describe("FOUR-6721 RAOS 1.0.0 Screens", () => { - // initial data to test the screen const initialData = { _user: { @@ -271,7 +270,7 @@ describe("FOUR-6721 RAOS 1.0.0 Screens", () => { id: 3, name: "Briana Banker", task: "Start Application", - email: "solutions+banker@processmaker.com", + email: "solutions+banker@processmaker.com" } ], acceptedDocuments: null, @@ -290,9 +289,8 @@ describe("FOUR-6721 RAOS 1.0.0 Screens", () => { }; beforeEach(() => { - cy.server(); cy.visit("/"); - cy.route( + cy.intercept( "POST", "/api/1.0/requests/data_sources/38", JSON.stringify({ @@ -316,7 +314,7 @@ describe("FOUR-6721 RAOS 1.0.0 Screens", () => { } }) ).as("DataSourceOne"); - cy.route( + cy.intercept( "POST", "/api/1.0/requests/data_sources/22", JSON.stringify({ diff --git a/tests/e2e/specs/FOUR-7027_RecordList_nested_calc.spec.js b/tests/e2e/specs/FOUR-7027_RecordList_nested_calc.spec.js index 7d5ecf2b4..0cda70257 100644 --- a/tests/e2e/specs/FOUR-7027_RecordList_nested_calc.spec.js +++ b/tests/e2e/specs/FOUR-7027_RecordList_nested_calc.spec.js @@ -1,6 +1,5 @@ describe("screen error nested calc", () => { beforeEach(() => { - cy.server(); cy.visit("/"); }); diff --git a/tests/e2e/specs/FOUR-7029_Parent_in_default_value.spec.js b/tests/e2e/specs/FOUR-7029_Parent_in_default_value.spec.js index 6c9e034bd..8cf6d8cdf 100644 --- a/tests/e2e/specs/FOUR-7029_Parent_in_default_value.spec.js +++ b/tests/e2e/specs/FOUR-7029_Parent_in_default_value.spec.js @@ -1,6 +1,5 @@ describe("access to _parent variable in default value", () => { beforeEach(() => { - cy.server(); cy.visit("/"); }); diff --git a/tests/e2e/specs/FOUR-7587_LoopNestedLoop.spec.js b/tests/e2e/specs/FOUR-7587_LoopNestedLoop.spec.js index a080ba486..9651e7b62 100644 --- a/tests/e2e/specs/FOUR-7587_LoopNestedLoop.spec.js +++ b/tests/e2e/specs/FOUR-7587_LoopNestedLoop.spec.js @@ -45,7 +45,6 @@ describe("FOUR-7587 Loop Nested Loop", () => { }; beforeEach(() => { - cy.server(); cy.visit("/", { onBeforeLoad(win) { cy.stub(win.console, "log").as("consoleLog"); diff --git a/tests/e2e/specs/FOUR4849.spec.js b/tests/e2e/specs/FOUR4849.spec.js index b93da7e24..4f19bebad 100644 --- a/tests/e2e/specs/FOUR4849.spec.js +++ b/tests/e2e/specs/FOUR4849.spec.js @@ -1,55 +1,76 @@ -describe('Tests null object property bind to an input text', () => { +describe("Tests null object property bind to an input text", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('Verify visibility rules do not break', () => { - cy.loadFromJson('FOUR-4849.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Verify visibility rules do not break", () => { + cy.loadFromJson("FOUR-4849.json", 0); + cy.get("[data-cy=mode-preview]").click(); // When the person is null, the visibility rules should be working - cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should('not.be.visible'); - cy.get('[data-cy=preview-content] [name=check]').click(); - cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should('be.visible'); - cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').clear().type('it works with person=null'); + cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should( + "not.be.visible" + ); + cy.get("[data-cy=preview-content] [name=check]").click(); + cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should( + "be.visible" + ); + cy.get('[data-cy=preview-content] [name="select1.form_input_1"]') + .clear() + .type("it works with person=null"); - cy.get('[data-cy=preview-content] [data-cy="screen-field-person"]').selectOption('1'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-person"]' + ).selectOption("1"); // When a person is selected, the visibility rules should still be working - cy.get('[data-cy=preview-content] [name=check]').click(); - cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should('not.be.visible'); - cy.get('[data-cy=preview-content] [name=check]').click(); - cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should('be.visible'); - cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').clear().type('still working with person=1'); + cy.get("[data-cy=preview-content] [name=check]").click(); + cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should( + "not.be.visible" + ); + cy.get("[data-cy=preview-content] [name=check]").click(); + cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should( + "be.visible" + ); + cy.get('[data-cy=preview-content] [name="select1.form_input_1"]') + .clear() + .type("still working with person=1"); // Check the data of the screen cy.assertPreviewData({ - 'check': true, - 'select1': { - 'form_input_1': 'still working with person=1', - }, - 'person': { - 'value': '1', - 'content': '1', + check: true, + select1: { + form_input_1: "still working with person=1" }, + person: { + value: "1", + content: "1" + } }); - cy.get('[data-cy=preview-content] [data-cy="screen-field-person"]').unselectOption('1'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-person"]' + ).unselectOption("1"); // When the person is deselected, the visibility rules should still be working - cy.get('[data-cy=preview-content] [name=check]').click(); - cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should('not.be.visible'); - cy.get('[data-cy=preview-content] [name=check]').click(); - cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should('be.visible'); - cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').clear().type('still working with person back to null'); + cy.get("[data-cy=preview-content] [name=check]").click(); + cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should( + "not.be.visible" + ); + cy.get("[data-cy=preview-content] [name=check]").click(); + cy.get('[data-cy=preview-content] [name="select1.form_input_1"]').should( + "be.visible" + ); + cy.get('[data-cy=preview-content] [name="select1.form_input_1"]') + .clear() + .type("still working with person back to null"); // Check the data of the screen cy.assertPreviewData({ - 'check': true, - 'select1': { - 'form_input_1': 'still working with person back to null', + check: true, + select1: { + form_input_1: "still working with person back to null" }, - 'person': null, + person: null }); }); }); diff --git a/tests/e2e/specs/FOUR6788_ScreenPerformanceTests.spec.js b/tests/e2e/specs/FOUR6788_ScreenPerformanceTests.spec.js index a734938ed..58f71d7a8 100644 --- a/tests/e2e/specs/FOUR6788_ScreenPerformanceTests.spec.js +++ b/tests/e2e/specs/FOUR6788_ScreenPerformanceTests.spec.js @@ -1,16 +1,12 @@ describe("FOUR-6788 screen performance", () => { // @todo Improve the boot-time of the stand alone app (general and within cypress) - const avgBootTime = 12000; + const avgBootTime = 16000; const minimumPerformanceScore = 12; const accessibility = 50; - beforeEach(() => { - cy.server(); - }); - // This test includes a Loop with 6 iterations, multi-column, select lists, rich texts and text areas it("Verify FOUR-6788 screen performance: select list, rich text", () => { - const maximumScreenRenderTime = 4000; + const maximumScreenRenderTime = 6000; cy.loadFromJson("FOUR-6788_screen_performance.json"); cy.visit("/?scenario=RenderScreen"); @@ -31,7 +27,7 @@ describe("FOUR-6788 screen performance", () => { // This test includes a Loop with 6 iterations, multi-column, select lists, rich texts, // text areas, input texts, validations rules, visibility rules and a submit button it("Verify FOUR-6788 screen performance: input text, validations, visibility rules", () => { - const maximumScreenRenderTime = 4000; + const maximumScreenRenderTime = 6000; cy.loadFromJson("FOUR-6788_screen_performance_2.json"); cy.visit("/?scenario=RenderScreen2"); diff --git a/tests/e2e/specs/FileDownload.spec.js b/tests/e2e/specs/FileDownload.spec.js index f1a62e82c..6febe3621 100644 --- a/tests/e2e/specs/FileDownload.spec.js +++ b/tests/e2e/specs/FileDownload.spec.js @@ -1,165 +1,221 @@ -describe('File Download', () => { - beforeEach(() => { - cy.server(); - cy.visit('/'); - cy.window().then(win => { +import { validateImage } from "../support/utils"; + +const downloadsFolder = Cypress.config("downloadsFolder"); + +function findTheFile(fileName) { + cy.log("**find the image**"); + const mask = `${downloadsFolder}/*.jpeg`; + + cy.task("findFiles", mask).then((foundImage) => { + expect(foundImage).to.be.a("string"); + cy.log(`found image ${foundImage}`); + cy.log("**confirm downloaded image**"); + validateImage(fileName); + }); +} + +describe("File Download", () => { + beforeEach(function () { + cy.visit("/"); + cy.window().then((win) => { // Add request-id header - const requestIdMeta = window.document.createElement('meta'); - requestIdMeta.setAttribute('name', 'request-id'); - requestIdMeta.setAttribute('content', '1'); + const requestIdMeta = window.document.createElement("meta"); + requestIdMeta.setAttribute("name", "request-id"); + requestIdMeta.setAttribute("content", "1"); win.document.head.appendChild(requestIdMeta); }); }); - it('Lists single file in download control', () => { + it("Lists single file in download control", function () { uploadSingleFile(); // The file should be listed in the file download control - cy.get(':nth-child(2) > .row > :nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"]').contains('avatar.jpeg'); + cy.get( + ':nth-child(2) > .row > :nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"]' + ).contains("avatar.jpeg"); // The file using the `_parent` variable should be listed in the file download control - cy.get('.page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"]').contains('avatar.jpeg'); + cy.get( + '.page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"]' + ).contains("avatar.jpeg"); // The file should be listed in the Record List file download control - cy.get('[data-cy=add-row]').click(); - cy.get('[data-cy=screen-renderer] > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"]').contains('avatar.jpeg'); + cy.get("[data-cy=add-row]").click(); + cy.get( + '[data-cy=screen-renderer] > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"]' + ).contains("avatar.jpeg"); }); - it('Can download a single file', () => { + it("Can download a single file", () => { uploadSingleFile(); // Mock file download - cy.route('/api/1.0/files/1/contents', 'avatar.jpeg').as('download'); + cy.intercept("/api/1.0/files/1/contents", { fixture: "avatar.jpeg" }).as( + "download" + ); // A standard file is downloadable - cy.get('.row > :nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"] > .btn').click(); - cy.wait("@download").then(async (xhr) => { - const content = await xhr.response.body.text(); - expect(content).to.equal("avatar.jpeg"); + cy.get( + '.row > :nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"] > .btn' + ).click(); + cy.wait("@download").then(() => { + findTheFile("avatar.jpeg"); }); // A Loop file is downloadable - cy.get('[icon="fas fa-redo"] > :nth-child(1) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"] > .btn').click(); - cy.wait("@download").then(async (xhr) => { - const content = await xhr.response.body.text(); - expect(content).to.equal("avatar.jpeg"); + cy.get( + '[icon="fas fa-redo"] > :nth-child(1) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"] > .btn' + ).click(); + cy.wait("@download").then(() => { + findTheFile("avatar.jpeg"); }); // A Record List file is downloadable - cy.get('[data-cy=add-row]').click(); - cy.get('[data-cy=screen-renderer] > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"] > .btn').eq(0).click(); - cy.wait("@download").then(async (xhr) => { - const content = await xhr.response.body.text(); - expect(content).to.equal("avatar.jpeg"); + cy.get("[data-cy=add-row]").click(); + cy.get( + '[data-cy=screen-renderer] > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"] > .btn' + ) + .eq(0) + .click(); + cy.wait("@download").then(() => { + findTheFile("avatar.jpeg"); }); }); - it('Lists multiple files in download control', () => { + it("Lists multiple files in download control", () => { uploadMultiFile(); // The files should be listed in a standard multiple file download control - cy.get('.col-sm-6 div').as('file_upload_1').should('include.text', 'avatar.jpeg'); - cy.get('.col-sm-6 div').as('file_upload_1').should('include.text', 'file1.jpeg'); + cy.get(".col-sm-6 div") + .as("file_upload_1") + .should("include.text", "avatar.jpeg"); + cy.get(".col-sm-6 div") + .as("file_upload_1") + .should("include.text", "file1.jpeg"); // The files should be listed in a Record List multiple file download control - cy.get('[data-cy=add-row]').click(); - cy.get('.modal-body').eq(0).should('include.text', 'avatar.jpeg'); - cy.get('.modal-body').eq(0).should('include.text', 'file1.jpeg'); + cy.get("[data-cy=add-row]").click(); + cy.get(".modal-body").eq(0).should("include.text", "avatar.jpeg"); + cy.get(".modal-body").eq(0).should("include.text", "file1.jpeg"); }); - it('Can download multiple files', () => { + it("Can download multiple files", () => { uploadMultiFile(); // Mock the first file download - cy.route('/api/1.0/files/1/contents', 'avatar.jpeg').as('download'); + cy.intercept("/api/1.0/files/1/contents", { fixture: "avatar.jpeg" }).as( + "download" + ); // Mock the second file download - cy.route('/api/1.0/files/2/contents', 'file1.jpeg').as('download'); + cy.intercept("/api/1.0/files/2/contents", { fixture: "file1.jpeg" }).as( + "downloadFile1" + ); cy.wait(1000); // The first file should be downloaded - cy.get('.row > :nth-child(1) > :nth-child(1) > [icon="fas fa-redo"] > :nth-child(1) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"] > .btn') - .click(); - cy.wait('@download').then(async (xhr) => { - const content = await xhr.response.body.text(); - expect(content).to.equal("avatar.jpeg"); + cy.get( + `.row > :nth-child(1) > :nth-child(1) > [icon="fas fa-redo"] > :nth-child(1) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"] > .btn` + ).click(); + cy.wait("@download").then(() => { + findTheFile("avatar.jpeg"); }); // The second file should be downloaded - cy.get('.row > :nth-child(1) > :nth-child(1) > [icon="fas fa-redo"] > :nth-child(2) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="2-file1"] > .btn') - .click(); - cy.wait("@download").then(async (xhr) => { - const content = await xhr.response.body.text(); - expect(content).to.equal("file1.jpeg"); + cy.get( + '.row > :nth-child(1) > :nth-child(1) > [icon="fas fa-redo"] > :nth-child(2) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="2-file1"] > .btn' + ).click(); + cy.wait("@downloadFile1").then(() => { + findTheFile("file1.jpeg"); }); // Assert Record List multiple files are downloadable - cy.get('[data-cy=add-row]').click(); + cy.get("[data-cy=add-row]").click(); // The first file should be downloaded - cy.get('[data-cy=screen-renderer] > :nth-child(1) > [name="record_page"] > :nth-child(1) > [icon="fas fa-redo"] > :nth-child(1) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"] > .btn') + cy.get( + '[data-cy=screen-renderer] > :nth-child(1) > [name="record_page"] > :nth-child(1) > [icon="fas fa-redo"] > :nth-child(1) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="1-avatar"] > .btn' + ) .eq(0) .click(); - cy.wait("@download").then(async (xhr) => { - const content = await xhr.response.body.text(); - expect(content).to.equal("avatar.jpeg"); + cy.wait("@download").then(() => { + findTheFile("avatar.jpeg"); }); // The second file should be downloaded - cy.get('[data-cy=screen-renderer] > :nth-child(1) > [name="record_page"] > :nth-child(1) > [icon="fas fa-redo"] > :nth-child(2) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="2-file1"] > .btn') + cy.get( + '[data-cy=screen-renderer] > :nth-child(1) > [name="record_page"] > :nth-child(1) > [icon="fas fa-redo"] > :nth-child(2) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > :nth-child(1) > :nth-child(2) > [data-cy="2-file1"] > .btn' + ) .eq(0) .click(); - cy.wait("@download").then(async (xhr) => { - const content = await xhr.response.body.text(); - expect(content).to.equal("file1.jpeg"); + cy.wait("@downloadFile1").then(() => { + findTheFile("file1.jpeg"); }); }); }); function uploadSingleFile() { - cy.loadFromJson('single_file_download.json', 0); - cy.get('[data-cy=mode-preview]').click(); + cy.loadFromJson("single_file_download.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Upload single file should show the uploaded file name - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-file_upload_1] input[type=file]', 'avatar.jpeg', 'image/jpg'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + "[data-cy=preview-content] [data-cy=screen-field-file_upload_1] input[type=file]", + "avatar.jpeg", + "image/jpg" + ); // Mock file info - cy.route('/api/1.0/requests/1/files?id=*', - { - id: 1, - file_name: 'avatar.jpeg', - name: 'avatar', - } - ).as('getFileInfo'); + cy.intercept("/api/1.0/requests/1/files?id=*", { + id: 1, + file_name: "avatar.jpeg", + name: "avatar" + }).as("getFileInfoFile1"); } function uploadMultiFile() { - cy.loadFromJson('multiple_file_download.json', 0); - cy.get('[data-cy=mode-preview]').click(); + cy.loadFromJson("multiple_file_download.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Upload first file - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-file_upload_1] input[type=file]', 'avatar.jpeg', 'image/jpg'); - cy.route('/api/1.0/requests/1/files?id=1', - { - id: 1, - file_name: 'avatar.jpeg', - name: 'avatar', - } - ).as('getFileInfo'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + "[data-cy=preview-content] [data-cy=screen-field-file_upload_1] input[type=file]", + "avatar.jpeg", + "image/jpg" + ); + cy.intercept("/api/1.0/requests/1/files?id=1", { + id: 1, + file_name: "avatar.jpeg", + name: "avatar" + }).as("getFileInfo"); // Upload second file - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 2, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-file_upload_1] input[type=file]', 'file1.jpeg', 'image/jpg'); - cy.route('/api/1.0/requests/1/files?id=2', - { - id: 2, - file_name: 'file1.jpeg', - name: 'file1', - } - ).as('getFileInfo'); -} \ No newline at end of file + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 2 + }) + ); + cy.uploadFile( + "[data-cy=preview-content] [data-cy=screen-field-file_upload_1] input[type=file]", + "file1.jpeg", + "image/jpg" + ); + cy.intercept("/api/1.0/requests/1/files?id=2", { + id: 2, + file_name: "file1.jpeg", + name: "file1" + }).as("getFileInfo"); +} diff --git a/tests/e2e/specs/FileUpload.spec.js b/tests/e2e/specs/FileUpload.spec.js index 7230b66c8..caa23f49e 100644 --- a/tests/e2e/specs/FileUpload.spec.js +++ b/tests/e2e/specs/FileUpload.spec.js @@ -1,27 +1,31 @@ -describe('File Upload', () => { - it('Automatically sets a variable name', () => { - cy.visit('/'); +describe("File Upload", () => { + it("Automatically sets a variable name", () => { + cy.visit("/"); cy.openAcordeon("collapse-5"); - cy.get('[data-cy=controls-FileUpload]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); + cy.get("[data-cy=controls-FileUpload]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); cy.get('[data-cy="screen-element-container"] .card-body').then((div) => { const data = div[0].__vue__.name; - expect(data).to.eql('file_upload_1'); + expect(data).to.eql("file_upload_1"); }); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=file-upload-button]').should('not.have.attr', 'disabled'); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=file-upload-button]").should("not.have.attr", "disabled"); }); - it('Disables when task is self service', () => { - cy.visit('/'); + it("Disables when task is self service", () => { + cy.visit("/"); cy.openAcordeon("collapse-5"); cy.window().then((win) => { win.ProcessMaker.isSelfService = true; }); - cy.get('[data-cy=controls-FileUpload]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=file-upload-button]').should('have.attr', 'disabled'); + cy.get("[data-cy=controls-FileUpload]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=file-upload-button]").should("have.attr", "disabled"); }); }); diff --git a/tests/e2e/specs/FormImage.spec.js b/tests/e2e/specs/FormImage.spec.js index 01a215e0c..396944ad9 100644 --- a/tests/e2e/specs/FormImage.spec.js +++ b/tests/e2e/specs/FormImage.spec.js @@ -1,56 +1,63 @@ -describe('Form Image', () => { - it('Upload image to show', () => { - cy.visit('/'); +describe("Form Image", () => { + it("Upload image to show", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormImage]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.uploadFile('[data-cy=inspector-image] input[type=file]', 'avatar.jpeg', 'image/jpeg'); - cy.get('[data-cy=accordion-Design]').click(); - cy.get('[data-cy=inspector-height]').clear().type('80'); - cy.get('[data-cy=inspector-width]').clear().type('100'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] img').should('have.attr', 'src'); - cy.get('[data-cy=preview-content] img').should('have.attr', 'height', '80'); - cy.get('[data-cy=preview-content] img').should('have.attr', 'width', '100'); + cy.get("[data-cy=controls-FormImage]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.uploadFile( + "[data-cy=inspector-image] input[type=file]", + "avatar.jpeg", + "image/jpeg" + ); + cy.get("[data-cy=accordion-Design]").click(); + cy.get("[data-cy=inspector-height]").clear().type("80"); + cy.get("[data-cy=inspector-width]").clear().type("100"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] img").should("have.attr", "src"); + cy.get("[data-cy=preview-content] img").should("have.attr", "height", "80"); + cy.get("[data-cy=preview-content] img").should("have.attr", "width", "100"); }); - it('Image by variable', () => { - cy.visit('/'); + it("Image by variable", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormImage]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-renderImage]').click(); - cy.get('[data-cy=inspector-variableName]').clear().type('image'); - cy.get('[data-cy=accordion-Design]').click(); - cy.get('[data-cy=inspector-height]').clear().type('80'); - cy.get('[data-cy=inspector-width]').clear().type('100'); - - cy.setPreviewDataInput({image: 'https://homepages.cae.wisc.edu/~ece533/images/cat.png'}); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] img').should('have.attr', 'src'); - cy.get('[data-cy=preview-content] img').should('have.attr', 'height', '80'); - cy.get('[data-cy=preview-content] img').should('have.attr', 'width', '100'); + cy.get("[data-cy=controls-FormImage]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-renderImage]").click(); + cy.get("[data-cy=inspector-variableName]").clear().type("image"); + cy.get("[data-cy=accordion-Design]").click(); + cy.get("[data-cy=inspector-height]").clear().type("80"); + cy.get("[data-cy=inspector-width]").clear().type("100"); + + cy.setPreviewDataInput({ + image: "https://homepages.cae.wisc.edu/~ece533/images/cat.png" + }); + + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] img").should("have.attr", "src"); + cy.get("[data-cy=preview-content] img").should("have.attr", "height", "80"); + cy.get("[data-cy=preview-content] img").should("have.attr", "width", "100"); }); - it('Image by variable and load signature', () => { - cy.server(); - cy.visit('/'); + it("Image by variable and load signature", () => { + cy.visit("/"); cy.loadFromJson("screen_parent_signature.json", 0); - const image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnkAAABkCAYAAAD63ibNAAAAAXNSR0IArs4c6QAAEA9JREFUeF7t3VvoZVUBx/Gf+RBoaUqFlaVRUGmlXWiKMruCRdOUNd0MpiISlEqnevChi10ootRCAxOqoQdrpBox6AoWCloa5WXqqYskKllogT1EUfyGtWG1Zl/P2efsvdb+bhiy/9ln77U+azv/n+u2jxAHAggggAACCCCAQHECRxRXIyqEAAIIIIAAAgggIEIeDwECCCCAAAIIIFCgACGvwEalSggggAACCCCAACGPZwABBBBAAAEEEChQgJBXYKNSJQQQQAABBBBAgJDHM4AAAggggAACCBQoQMgrsFGpEgIIIIAAAgggQMjjGUAAAQQQQAABBAoUIOQV2KhUCQEEEEAAAQQQIOTxDCCAAAIIIIAAAgUKEPIKbFSqhAACCCCAAAIIEPJ4BhBAAAEEEEAAgQIFCHkFNipVQgABBBBAAAEECHk8AwgggAACCCCAQIEChLwCG5UqIYAAAggggAAChDyeAQQQQAABBBBAoEABQl6BjUqVtipwjqTLJD1c0iWSPrHVu3MzBBBAAAEEGgQIeTwaCDQLvEvSsZL2SXqw5rRHSfqrpCOjz45rOBdnBBBAAAEEtipAyNsqNzfLSOBbkt4ayvslSRckZXfAu17S6cnPnyPpNxnVk6IigAACCBQqQMgrtGGp1loC+yXtjq5wraQ3RP+/KeD5lJdL+tlad+fLCCCAAAIIjCBAyBsBkUsUJeBw55AXHz+X9LLoB5539/GGWnto18O8HAgggAACCEwqQMiblJ+bz0xgh6SbQ5kc1vaEf/6TpCdHZfX8PM/Vqzv8meflcSCAAAIIIDCpACFvUn5uPiOBkyXdIOlESddIep+kB6LyOeQ57LmX7usd5WZe3owalqIggAACSxUg5C215al3LJDOsXuipLsl/Tc6qZpr50UVp0U/v0uSvx/37DEvj+cLAQQQQGByAULe5E1AAWYgEAe3N0v6TihTHPLeHVbN/jopr3/ulbdx8CPkzaBRKQICCCCwdAFC3tKfAOp/QNKuwODA9o3wz94aJQ50bwzbpcQLLv4eevE8jHtSTa8fuggggAACCEwmQMibjJ4bz0DAga5aXBEHPBfNW6Z8LyrjTknflnRU9LNq/7x0IQY9eTNoXIqAAAIILF2AkLf0J2C59W8LeFbx3nivj3iukHR+wlUtxvACDc/Lq44zJN24XFpqjgACCCAwBwFC3hxagTJsW6Ar4Lk8P5B0VlQwD83Giyt+L+mp4fPbJT0rOvdSSXu3UCn3Ln4+3OciSR565kAAAQQQQOCQACGPB2FJAu5tcwCrNitOh2hjC2+TUp33kKSjE6h4SLZuc+Rqhe4mfM8Lb+SIN2j2Kl9vA8OBAAIIIIAAIY9nYFECDngObp5r5145/2/b68filbUpVPoGDH9+q6TnRSeeK+mrIws71HnhRxzu4lswF3BkcC6HAAII5CxAT17OrUfZ+wqkAc8hydumNB3+/PqWz73SNh0aTXvzPNz72r4F7HGey3S5pFNbznWdHPS8EGTOR2r1Z0kfYLh5zk1G2RBAIEcBQl6OrUaZhwgMDXi+dlvIq+vF83fOlPRdScdHhXOv2yeHFLbhXJenGqKtTnEv5P0hSMZDyW1D0CMUZa1LnCLpYMMVHPSetNbV+TICCCCAwP8JEPJ4IEoWcMD7kaQXSPKcNYcl72nXdbSFvLZXlqU9VLeEe3fdr+1zh8bPhtesVed54YjDnI/0nl4V7KHoOR1uh6skeaPptoO/j+bUapQFAQSyF+Av1eybkAo0CMSvKvMcPG9u3CfgVZf7t6Qjk2t39ZI5HHreX7UA4peSdqzZQn77xtnRNTzPz/P94iPdjHlO/16nJi639x+8WtLFkp4RVWRO5V6z2fg6AgggML0Af6lO3waUYHwBBzoHCYet20IP3tB5ag6Gx0RFu1DSZT2KemXU6/YrSc/v8Z2mU+IVvj7nt2GvvnTBiP+/h4ur47gZzMtzyPZwtV/5Fh+e6/iK8IO03Px9tMbDwlcRQACBVIC/VHkmShNwz5EDnkPGqgHPJg4nnw5bp+yLtlPp8toftjepzqs2TO76Xvx53Rw8f1634MM/n1tYitugqpdDs7ekiRespEPNrA4e8pRwLgIIINAhQMjjESlJwCHCvV8+vEDCc9OG9uClHg6LQ66xW5KDXnVcI+ktA5D9fS+ySLdJ8dCmQ1Hd4VW1p0UfTNmTZ3O3QfwGEL/+zWVPHdNXx7XVcQAhpyKAAAIIWICQx3NQioCHUj8YKjPl4oMTJf0w2erkHWEOWpd1GhCr87vCz72SToguPtW/13HIdnHck+qfNW1X4+H0P0blnrLdutqGzxFAAIHsBKb6ZZAdFAWerUD6FoshQ6ubqlQa1hxyvCq37XDg8UKNxyQndQU8n36TpBdOHPK8VcxHozI0bTWTGsSbThPyNvVEcl0EEFikACFvkc1eTKXjFbSu1BwCXoX7lySwed7chyV5MUZ1PFrSM8PQrBcppIeHeT3c23W4Nyx+pdkq8wC77tH0ebwPYXVO33bwdx+ILuxh3XShxqrl4nsIIIDA4gUIeYt/BLIFiFfQuhJd25tsu6J3NrydwiHPrz/7p6SjGgrlTY4d8NpeuxZ/1StW4zl821rAkLaBy/R9STt7Yqf7EfZdwdzz8pyGAAIILFuAkLfs9s+19unk/rkFPLt6yNb72b1yBeRXS/rpgO/F27b4a32GeAdc/rBT3QPn+Y/pQpCh7fCxUNbqBtsKp+vUne8igAAC2QgQ8rJpKgoaBOJtN7wthwNf3x6vKRDTbULayvCLZG5d3/K6Z/DW6OS6DZP7XqvrPC+k8NByPDzs7zRt79J2vRslvTg6YcpVwV315nMEEEAgOwFCXnZNtugC+3Vee4JA18rNOUF5WNKbFcc9Xx6u/U80R+9rkr65RqHjBQzeNPnUNa5V91XXweEu3dplnXa4I8xJ9P3ukfSEkcvM5RBAAIFFCxDyFt382VTevUbee60KGOtscpxNpQcW1O/Jrd6u8ZCkRwz8ftPpdQsrfK57Ub1tjf8M2Ucwvo+/d2z4Qd/VuCNVi8sggAAC5QsQ8spv49xrmL49oWlj3dzruW75/ZYPD137+J2kU9a8oMPdpyS9M9nY2Jf16ln3Sg55F3BdceLex03PI1yTg68jgAAC+QkQ8vJrsyWV2PO/Lo1CxtCJ/UuySt8e0Xf7ldjIwW5XCItVYIw/d2+b22TdcOdrphshE/KW9LRSVwQQ2IoAIW8rzBu5iX+JnyXpPRu5+vQXjd9g4aFB9+g1vTlh+tJOXwJvouy9+eKjK+g51Pl1aN4Kxb51wc7Xuyv03HlO5FhHukde3731xro/10EAAQSKFyDk5dnEr5L0k1D0GyS9NM9q1Jbav/w99FjNvxvrHbQFETVWpW4lr/fl8951XoH8trCly796Duf+TZKfL/egrjrvrs3dPYInRSe0ra6tngfXw72AY/QmLuGZoI4IILBgAUJeno3vIbUDoeh/kPSUPKtxWKn9i/y6aNEA8++GNazn4e0fYWXtJnru6moS99b687rheAdX91jvSC7gXkWfz4EAAggg0CBAyMvz0fAv84Oh6KvurTa3mqe9UKvsuza3Ok1RHm/C7JXIRw+8uYfE/R8O1Z+BX1/p9HRe3t2SPiLJr2n7nKTnSjqm5cqPk3TfSnfmSwgggMACBAh5+TZyvDLxsZL8KqwcD/+i9/Cs54X5cNjwik4PMXKsJvDe8A7Ypr3yHIz8HwfVHEcPgU61ofQ/JD1ytWoe2jImfhfwipfhawgggECZAoS8fNv1y5LeH4qf6+ug0tWzHib05H8WWIzzXDpAnxGG870Zs+c3ephzTvPZPOfvJStWd29Yfb3i1/kaAgggULYAIS/f9j1P0hWh+OdL+kpGVfHiCm+N4pBXHd7g2AFvTgEkI9Jsi+og+pmwEKTqzU0r42Dq4Vv/iVcAu/fR/4HDgQACCCBQI0DIy/ux+FAo/hczqoYXV3jOWPzuU1bQZtSAGyzqOZI81OzDYf9aSV5YdHv4Wd3qYf4O22CDcGkEEMhbgL8g826/nErv3ju/+/SCpND+Rd60P1tO9aOsmxcg5G3emDsggEBBAoS8ghpzxlXxMJx779LhuAvDu09nXHSKNiOBSyT5makOtlGZUeNQFAQQmJ8AIW9+bVJaiep6X1xHXlFWWktvvj5fkFRNUfDd2GZn8+bcAQEEMhYg5GXceDMvelPvHStoZ95wMy6eN0V20PPWMF504ZC3iTdxzJiAoiGAAAL9BQh5/a04s7+A59159Wx6eP6dV9Tyi7m/JWceLuDFO1Pt60d7IIAAAtkIEPKyaaosCpq+d7YqtDc49rCtX2PFgQACCCCAAAJbECDkbQF5Ibdw751XzzroxYe3R3HvHfvfLeRBoJoIIIAAAvMQIOTNox1yLoVD3U2Snp5Uwr137rlzDx4HAggggAACCGxZgJC3ZfCCbueXw58bXq12fE3vnXv2eD1ZQQ1OVRBAAAEE8hIg5OXVXnMo7YskvV3SmyQ9vqZAF9N7N4dmogwIIIAAAksXIOQt/QnoX3/Pqztb0s6Gr9wn6TX03vUH5UwEEEAAAQQ2KUDI26Ru/tf2VhXeCuXZkh7WUh333nlLC7a1yL/NqQECCCCAQCEChLxCGnLEanghxa4w5Hpyx3XvkXQVw7Mj6nMpBBBAAAEERhIg5I0EWcBlHOj2SPKCiXQblLR63g5ln6QrJd1bQN2pAgIIIIAAAsUJEPKKa9LBFfKQrMOd59x1HTdLulzSjyXd33UynyOAAAIIIIDAdAKEvOnsp7yze+08JOteu7YhWb9ntpprd1DSLVMWmnsjgAACCCCAQH8BQl5/q9zPPF3SmaHHzv/cdPj9sg52B3hLRe5NTvkRQAABBJYsQMgru/X3Stot6YSWHju/mcKBzn8c7h4sm4TaIYAAAgggsAwBQl657ezhWAe3uqMahq3CXbkK1AwBBBBAAIGFChDyym3410m6LqrebVGPHa8bK7fdqRkCCCCAAAKHBAh5ZT8IXljxNEkXMQxbdkNTOwQQQAABBFIBQh7PBAIIIIAAAgggUKAAIa/ARqVKCCCAAAIIIIAAIY9nAAEEEEAAAQQQKFCAkFdgo1IlBBBAAAEEEECAkMczgAACCCCAAAIIFChAyCuwUakSAggggAACCCBAyOMZQAABBBBAAAEEChQg5BXYqFQJAQQQQAABBBAg5PEMIIAAAggggAACBQoQ8gpsVKqEAAIIIIAAAggQ8ngGEEAAAQQQQACBAgUIeQU2KlVCAAEEEEAAAQQIeTwDCCCAAAIIIIBAgQKEvAIblSohgAACCCCAAAKEPJ4BBBBAAAEEEECgQAFCXoGNSpUQQAABBBBAAAFCHs8AAggggAACCCBQoAAhr8BGpUoIIIAAAggggAAhj2cAAQQQQAABBBAoUICQV2CjUiUEEEAAAQQQQICQxzOAAAIIIIAAAggUKEDIK7BRqRICCCCAAAIIIPA/Jo3XdCnCQcsAAAAASUVORK5CYII="; + const image = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnkAAABkCAYAAAD63ibNAAAAAXNSR0IArs4c6QAAEA9JREFUeF7t3VvoZVUBx/Gf+RBoaUqFlaVRUGmlXWiKMruCRdOUNd0MpiISlEqnevChi10ootRCAxOqoQdrpBox6AoWCloa5WXqqYskKllogT1EUfyGtWG1Zl/P2efsvdb+bhiy/9ln77U+azv/n+u2jxAHAggggAACCCCAQHECRxRXIyqEAAIIIIAAAgggIEIeDwECCCCAAAIIIFCgACGvwEalSggggAACCCCAACGPZwABBBBAAAEEEChQgJBXYKNSJQQQQAABBBBAgJDHM4AAAggggAACCBQoQMgrsFGpEgIIIIAAAgggQMjjGUAAAQQQQAABBAoUIOQV2KhUCQEEEEAAAQQQIOTxDCCAAAIIIIAAAgUKEPIKbFSqhAACCCCAAAIIEPJ4BhBAAAEEEEAAgQIFCHkFNipVQgABBBBAAAEECHk8AwgggAACCCCAQIEChLwCG5UqIYAAAggggAAChDyeAQQQQAABBBBAoEABQl6BjUqVtipwjqTLJD1c0iWSPrHVu3MzBBBAAAEEGgQIeTwaCDQLvEvSsZL2SXqw5rRHSfqrpCOjz45rOBdnBBBAAAEEtipAyNsqNzfLSOBbkt4ayvslSRckZXfAu17S6cnPnyPpNxnVk6IigAACCBQqQMgrtGGp1loC+yXtjq5wraQ3RP+/KeD5lJdL+tlad+fLCCCAAAIIjCBAyBsBkUsUJeBw55AXHz+X9LLoB5539/GGWnto18O8HAgggAACCEwqQMiblJ+bz0xgh6SbQ5kc1vaEf/6TpCdHZfX8PM/Vqzv8meflcSCAAAIIIDCpACFvUn5uPiOBkyXdIOlESddIep+kB6LyOeQ57LmX7usd5WZe3owalqIggAACSxUg5C215al3LJDOsXuipLsl/Tc6qZpr50UVp0U/v0uSvx/37DEvj+cLAQQQQGByAULe5E1AAWYgEAe3N0v6TihTHPLeHVbN/jopr3/ulbdx8CPkzaBRKQICCCCwdAFC3tKfAOp/QNKuwODA9o3wz94aJQ50bwzbpcQLLv4eevE8jHtSTa8fuggggAACCEwmQMibjJ4bz0DAga5aXBEHPBfNW6Z8LyrjTknflnRU9LNq/7x0IQY9eTNoXIqAAAIILF2AkLf0J2C59W8LeFbx3nivj3iukHR+wlUtxvACDc/Lq44zJN24XFpqjgACCCAwBwFC3hxagTJsW6Ar4Lk8P5B0VlQwD83Giyt+L+mp4fPbJT0rOvdSSXu3UCn3Ln4+3OciSR565kAAAQQQQOCQACGPB2FJAu5tcwCrNitOh2hjC2+TUp33kKSjE6h4SLZuc+Rqhe4mfM8Lb+SIN2j2Kl9vA8OBAAIIIIAAIY9nYFECDngObp5r5145/2/b68filbUpVPoGDH9+q6TnRSeeK+mrIws71HnhRxzu4lswF3BkcC6HAAII5CxAT17OrUfZ+wqkAc8hydumNB3+/PqWz73SNh0aTXvzPNz72r4F7HGey3S5pFNbznWdHPS8EGTOR2r1Z0kfYLh5zk1G2RBAIEcBQl6OrUaZhwgMDXi+dlvIq+vF83fOlPRdScdHhXOv2yeHFLbhXJenGqKtTnEv5P0hSMZDyW1D0CMUZa1LnCLpYMMVHPSetNbV+TICCCCAwP8JEPJ4IEoWcMD7kaQXSPKcNYcl72nXdbSFvLZXlqU9VLeEe3fdr+1zh8bPhtesVed54YjDnI/0nl4V7KHoOR1uh6skeaPptoO/j+bUapQFAQSyF+Av1eybkAo0CMSvKvMcPG9u3CfgVZf7t6Qjk2t39ZI5HHreX7UA4peSdqzZQn77xtnRNTzPz/P94iPdjHlO/16nJi639x+8WtLFkp4RVWRO5V6z2fg6AgggML0Af6lO3waUYHwBBzoHCYet20IP3tB5ag6Gx0RFu1DSZT2KemXU6/YrSc/v8Z2mU+IVvj7nt2GvvnTBiP+/h4ur47gZzMtzyPZwtV/5Fh+e6/iK8IO03Px9tMbDwlcRQACBVIC/VHkmShNwz5EDnkPGqgHPJg4nnw5bp+yLtlPp8toftjepzqs2TO76Xvx53Rw8f1634MM/n1tYitugqpdDs7ekiRespEPNrA4e8pRwLgIIINAhQMjjESlJwCHCvV8+vEDCc9OG9uClHg6LQ66xW5KDXnVcI+ktA5D9fS+ySLdJ8dCmQ1Hd4VW1p0UfTNmTZ3O3QfwGEL/+zWVPHdNXx7XVcQAhpyKAAAIIWICQx3NQioCHUj8YKjPl4oMTJf0w2erkHWEOWpd1GhCr87vCz72SToguPtW/13HIdnHck+qfNW1X4+H0P0blnrLdutqGzxFAAIHsBKb6ZZAdFAWerUD6FoshQ6ubqlQa1hxyvCq37XDg8UKNxyQndQU8n36TpBdOHPK8VcxHozI0bTWTGsSbThPyNvVEcl0EEFikACFvkc1eTKXjFbSu1BwCXoX7lySwed7chyV5MUZ1PFrSM8PQrBcppIeHeT3c23W4Nyx+pdkq8wC77tH0ebwPYXVO33bwdx+ILuxh3XShxqrl4nsIIIDA4gUIeYt/BLIFiFfQuhJd25tsu6J3NrydwiHPrz/7p6SjGgrlTY4d8NpeuxZ/1StW4zl821rAkLaBy/R9STt7Yqf7EfZdwdzz8pyGAAIILFuAkLfs9s+19unk/rkFPLt6yNb72b1yBeRXS/rpgO/F27b4a32GeAdc/rBT3QPn+Y/pQpCh7fCxUNbqBtsKp+vUne8igAAC2QgQ8rJpKgoaBOJtN7wthwNf3x6vKRDTbULayvCLZG5d3/K6Z/DW6OS6DZP7XqvrPC+k8NByPDzs7zRt79J2vRslvTg6YcpVwV315nMEEEAgOwFCXnZNtugC+3Vee4JA18rNOUF5WNKbFcc9Xx6u/U80R+9rkr65RqHjBQzeNPnUNa5V91XXweEu3dplnXa4I8xJ9P3ukfSEkcvM5RBAAIFFCxDyFt382VTevUbee60KGOtscpxNpQcW1O/Jrd6u8ZCkRwz8ftPpdQsrfK57Ub1tjf8M2Ucwvo+/d2z4Qd/VuCNVi8sggAAC5QsQ8spv49xrmL49oWlj3dzruW75/ZYPD137+J2kU9a8oMPdpyS9M9nY2Jf16ln3Sg55F3BdceLex03PI1yTg68jgAAC+QkQ8vJrsyWV2PO/Lo1CxtCJ/UuySt8e0Xf7ldjIwW5XCItVYIw/d2+b22TdcOdrphshE/KW9LRSVwQQ2IoAIW8rzBu5iX+JnyXpPRu5+vQXjd9g4aFB9+g1vTlh+tJOXwJvouy9+eKjK+g51Pl1aN4Kxb51wc7Xuyv03HlO5FhHukde3731xro/10EAAQSKFyDk5dnEr5L0k1D0GyS9NM9q1Jbav/w99FjNvxvrHbQFETVWpW4lr/fl8951XoH8trCly796Duf+TZKfL/egrjrvrs3dPYInRSe0ra6tngfXw72AY/QmLuGZoI4IILBgAUJeno3vIbUDoeh/kPSUPKtxWKn9i/y6aNEA8++GNazn4e0fYWXtJnru6moS99b687rheAdX91jvSC7gXkWfz4EAAggg0CBAyMvz0fAv84Oh6KvurTa3mqe9UKvsuza3Ok1RHm/C7JXIRw+8uYfE/R8O1Z+BX1/p9HRe3t2SPiLJr2n7nKTnSjqm5cqPk3TfSnfmSwgggMACBAh5+TZyvDLxsZL8KqwcD/+i9/Cs54X5cNjwik4PMXKsJvDe8A7Ypr3yHIz8HwfVHEcPgU61ofQ/JD1ytWoe2jImfhfwipfhawgggECZAoS8fNv1y5LeH4qf6+ug0tWzHib05H8WWIzzXDpAnxGG870Zs+c3ephzTvPZPOfvJStWd29Yfb3i1/kaAgggULYAIS/f9j1P0hWh+OdL+kpGVfHiCm+N4pBXHd7g2AFvTgEkI9Jsi+og+pmwEKTqzU0r42Dq4Vv/iVcAu/fR/4HDgQACCCBQI0DIy/ux+FAo/hczqoYXV3jOWPzuU1bQZtSAGyzqOZI81OzDYf9aSV5YdHv4Wd3qYf4O22CDcGkEEMhbgL8g826/nErv3ju/+/SCpND+Rd60P1tO9aOsmxcg5G3emDsggEBBAoS8ghpzxlXxMJx779LhuAvDu09nXHSKNiOBSyT5makOtlGZUeNQFAQQmJ8AIW9+bVJaiep6X1xHXlFWWktvvj5fkFRNUfDd2GZn8+bcAQEEMhYg5GXceDMvelPvHStoZ95wMy6eN0V20PPWMF504ZC3iTdxzJiAoiGAAAL9BQh5/a04s7+A59159Wx6eP6dV9Tyi7m/JWceLuDFO1Pt60d7IIAAAtkIEPKyaaosCpq+d7YqtDc49rCtX2PFgQACCCCAAAJbECDkbQF5Ibdw751XzzroxYe3R3HvHfvfLeRBoJoIIIAAAvMQIOTNox1yLoVD3U2Snp5Uwr137rlzDx4HAggggAACCGxZgJC3ZfCCbueXw58bXq12fE3vnXv2eD1ZQQ1OVRBAAAEE8hIg5OXVXnMo7YskvV3SmyQ9vqZAF9N7N4dmogwIIIAAAksXIOQt/QnoX3/Pqztb0s6Gr9wn6TX03vUH5UwEEEAAAQQ2KUDI26Ru/tf2VhXeCuXZkh7WUh333nlLC7a1yL/NqQECCCCAQCEChLxCGnLEanghxa4w5Hpyx3XvkXQVw7Mj6nMpBBBAAAEERhIg5I0EWcBlHOj2SPKCiXQblLR63g5ln6QrJd1bQN2pAgIIIIAAAsUJEPKKa9LBFfKQrMOd59x1HTdLulzSjyXd33UynyOAAAIIIIDAdAKEvOnsp7yze+08JOteu7YhWb9ntpprd1DSLVMWmnsjgAACCCCAQH8BQl5/q9zPPF3SmaHHzv/cdPj9sg52B3hLRe5NTvkRQAABBJYsQMgru/X3Stot6YSWHju/mcKBzn8c7h4sm4TaIYAAAgggsAwBQl657ezhWAe3uqMahq3CXbkK1AwBBBBAAIGFChDyym3410m6LqrebVGPHa8bK7fdqRkCCCCAAAKHBAh5ZT8IXljxNEkXMQxbdkNTOwQQQAABBFIBQh7PBAIIIIAAAgggUKAAIa/ARqVKCCCAAAIIIIAAIY9nAAEEEEAAAQQQKFCAkFdgo1IlBBBAAAEEEECAkMczgAACCCCAAAIIFChAyCuwUakSAggggAACCCBAyOMZQAABBBBAAAEEChQg5BXYqFQJAQQQQAABBBAg5PEMIIAAAggggAACBQoQ8gpsVKqEAAIIIIAAAggQ8ngGEEAAAQQQQACBAgUIeQU2KlVCAAEEEEAAAQQIeTwDCCCAAAIIIIBAgQKEvAIblSohgAACCCCAAAKEPJ4BBBBAAAEEEECgQAFCXoGNSpUQQAABBBBAAAFCHs8AAggggAACCCBQoAAhr8BGpUoIIIAAAggggAAhj2cAAQQQQAABBBAoUICQV2CjUiUEEEAAAQQQQICQxzOAAAIIIIAAAggUKEDIK7BRqRICCCCAAAIIIPA/Jo3XdCnCQcsAAAAASUVORK5CYII="; + cy.setPreviewDataInput({ signature: image }); - cy.setPreviewDataInput({signature: image}); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] img').should('have.attr', 'src'); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] img").should("have.attr", "src"); cy.assertPreviewData({ signature: image, - loop: [ - {} - ], + loop: [{}], recordlist: null }); }); diff --git a/tests/e2e/specs/FormInput.spec.js b/tests/e2e/specs/FormInput.spec.js index 910986d4d..cec21c46d 100644 --- a/tests/e2e/specs/FormInput.spec.js +++ b/tests/e2e/specs/FormInput.spec.js @@ -1,148 +1,195 @@ -describe('Form Input', () => { - it('Default properties', () => { - cy.visit('/'); +describe("Form Input", () => { + it("Default properties", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').type('Hello World'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").type("Hello World"); cy.assertPreviewData({ - form_input_1: 'Hello World', + form_input_1: "Hello World" }); }); - it('Variable properties', () => { - cy.visit('/'); + it("Variable properties", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]').clear().type('firstname'); - cy.get('[data-cy=inspector-label]').clear().type('Your Firstname'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content]').should('contain.html', 'Your Firstname'); - cy.get('[data-cy=preview-content] [name=firstname]').type('Bob'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]").clear().type("firstname"); + cy.get("[data-cy=inspector-label]").clear().type("Your Firstname"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content]").should( + "contain.html", + "Your Firstname" + ); + cy.get("[data-cy=preview-content] [name=firstname]").type("Bob"); cy.assertPreviewData({ - firstname: 'Bob', + firstname: "Bob" }); }); - it('Data type Integer', () => { - cy.visit('/'); + it("Data type Integer", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Integer'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').type('123'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Integer"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").type("123"); cy.assertPreviewData({ - form_input_1: 123, + form_input_1: 123 }); }); - it('Data type Currency', () => { - cy.visit('/'); + it("Data type Currency", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Currency'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').type('1234'); - cy.get('[name=form_input_1]:visible').should('have.value', '1.234,00'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Currency"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").type("1234"); + cy.get("[name=form_input_1]:visible").should("have.value", "1.234,00"); cy.assertPreviewData({ - form_input_1: 1234, + form_input_1: 1234 }); }); - it('Data type Currency with initial data', () => { - cy.visit('/'); + it("Data type Currency with initial data", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); cy.setPreviewDataInput('{"form_input_1":1234}'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Currency'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[name=form_input_1]:visible').should('have.value', '1.234,00'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Currency"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[name=form_input_1]:visible").should("have.value", "1.234,00"); cy.assertPreviewData({ - form_input_1: 1234, + form_input_1: 1234 }); }); - it('Data type Currency when backspacing a decimal digit', () => { - cy.visit('/'); + it("Data type Currency when backspacing a decimal digit", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Currency'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Currency"); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[name=form_input_1]:visible').type('1.1'); - cy.get('[data-cy=preview-data-input]').click(); // blur the text box + cy.get("[name=form_input_1]:visible").type("1.1"); + cy.get("[data-cy=preview-data-input]").click(); // blur the text box cy.assertPreviewData({ form_input_1: 1.1 }); - cy.get('[name=form_input_1]:visible').type('{home}{rightArrow}{rightArrow}{rightArrow}{backspace}'); + cy.get("[name=form_input_1]:visible").type( + "{home}{rightArrow}{rightArrow}{rightArrow}{backspace}" + ); cy.assertPreviewData({ form_input_1: 1 }); }); - it('Validation rule', () => { - cy.visit('/'); + it("Validation rule", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-readonly]').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.attr', 'readonly'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-readonly]").click(); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.attr", + "readonly" + ); }); - it('Placeholder', () => { - cy.visit('/'); + it("Placeholder", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-placeholder]').clear().type('enter text here'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.attr', 'placeholder', 'enter text here'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-placeholder]").clear().type("enter text here"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.attr", + "placeholder", + "enter text here" + ); }); - it('Data type Percentage', () => { - cy.visit('/'); + it("Data type Percentage", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Percentage'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').type('50'); - cy.get('[name=form_input_1]:visible').should('have.value', '50.00 %'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Percentage"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").type("50"); + cy.get("[name=form_input_1]:visible").should("have.value", "50.00 %"); cy.assertPreviewData({ - form_input_1: 50, + form_input_1: 50 }); }); - it('Data type Datetime', () => { - cy.visit('/'); + it("Data type Datetime", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Datetime'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').clear().type('2020-01-31 02:30'); - cy.get('[name=form_input_1]:visible').should('have.value', '2020-01-31 02:30'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Datetime"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]") + .clear() + .type("2020-01-31 02:30"); + cy.get("[name=form_input_1]:visible").should( + "have.value", + "2020-01-31 02:30" + ); cy.assertPreviewData({ - form_input_1: '2020-01-31 02:30', + form_input_1: "2020-01-31 02:30" }); }); - it('Data type Date', () => { - cy.visit('/'); + it("Data type Date", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date', 1); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').clear().type('20200131'); - cy.get('[name=form_input_1]:visible').should('have.value', '2020-01-31'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Date", 1); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]") + .clear() + .type("20200131"); + cy.get("[name=form_input_1]:visible").should("have.value", "2020-01-31"); cy.assertPreviewData({ - form_input_1: '2020-01-31', + form_input_1: "2020-01-31" }); }); - it('Data type password', () => { - cy.visit('/'); + it("Data type password", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Password'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.attr', 'type', 'password'); - cy.get('[data-cy=preview-content] [name=form_input_1]').type('12345678'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.setMultiselect("[data-cy=inspector-dataFormat]", "Password"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.attr", + "type", + "password" + ); + cy.get("[data-cy=preview-content] [name=form_input_1]").type("12345678"); }); }); diff --git a/tests/e2e/specs/FormSelectList.spec.js b/tests/e2e/specs/FormSelectList.spec.js index 706683f81..0da8a8dfe 100644 --- a/tests/e2e/specs/FormSelectList.spec.js +++ b/tests/e2e/specs/FormSelectList.spec.js @@ -1,308 +1,390 @@ -describe('Form Select List', () => { +describe("Form Select List", () => { beforeEach(() => { - cy.visit('/'); + cy.visit("/"); cy.openAcordeon("collapse-1"); // Add loop control - cy.get('[data-cy=controls-FormSelectList]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); + cy.get("[data-cy=controls-FormSelectList]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); }); - it('Default properties', () => { - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').click(); - cy.get('[data-cy=preview-content]').should('contain.text', 'No Data Available'); + it("Default properties", () => { + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).click(); + cy.get("[data-cy=preview-content]").should( + "contain.text", + "No Data Available" + ); cy.assertPreviewData({ - form_select_list_1: null, + form_select_list_1: null }); }); - it('Set data source values', () => { - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Provide Values'); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('one'); - cy.get('[data-cy=inspector-option-content]').type('one'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('two'); - cy.get('[data-cy=inspector-option-content]').type('two'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('three'); - cy.get('[data-cy=inspector-option-content]').type('three'); - cy.get('[data-cy=inspector-option-cancel]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('four'); - cy.get('[data-cy=inspector-option-content]').type('four'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-options-remove]').eq(2).click(); - cy.get('[data-cy=inspector-options-remove-cancel]').click(); - cy.get('[data-cy=inspector-options-remove]').eq(2).click(); - cy.get('[data-cy=inspector-options-remove-confirm]').click(); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').click(); - cy.get('[data-cy=preview-content] span:contains(one)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(two)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(three)').should('not.exist'); - - cy.get('[data-cy=preview-content] span:contains(two):first').click(); + it("Set data source values", () => { + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Provide Values"); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("one"); + cy.get("[data-cy=inspector-option-content]").type("one"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("two"); + cy.get("[data-cy=inspector-option-content]").type("two"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("three"); + cy.get("[data-cy=inspector-option-content]").type("three"); + cy.get("[data-cy=inspector-option-cancel]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("four"); + cy.get("[data-cy=inspector-option-content]").type("four"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-options-remove]").eq(2).click(); + cy.get("[data-cy=inspector-options-remove-cancel]").click(); + cy.get("[data-cy=inspector-options-remove]").eq(2).click(); + cy.get("[data-cy=inspector-options-remove-confirm]").click(); + + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).click(); + cy.get("[data-cy=preview-content] span:contains(one)").should("be.visible"); + cy.get("[data-cy=preview-content] span:contains(two)").should("be.visible"); + cy.get("[data-cy=preview-content] span:contains(three)").should( + "not.exist" + ); + + cy.get("[data-cy=preview-content] span:contains(two):first").click(); cy.assertPreviewData({ - form_select_list_1: 'two', + form_select_list_1: "two" }); }); - it('Validate duplicated option', () => { - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Provide Values'); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('one'); - cy.get('[data-cy=inspector-option-content]').type('one'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('one'); - cy.get('[data-cy=inspector-option-content]').type('one'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('div:contains("An item with the same key already exists")').should('be.visible'); - cy.get('[data-cy=inspector-option-value]').clear().type('two'); - cy.get('[data-cy=inspector-option-content]').clear().type('two'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-options-edit]').eq(1).click(); - cy.get('[data-cy=inspector-option-value]').clear().type('one'); - cy.get('[data-cy=inspector-option-content]').clear().type('one'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('div:contains("An item with the same key already exists")').should('be.visible'); + it("Validate duplicated option", () => { + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Provide Values"); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("one"); + cy.get("[data-cy=inspector-option-content]").type("one"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("one"); + cy.get("[data-cy=inspector-option-content]").type("one"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get('div:contains("An item with the same key already exists")').should( + "be.visible" + ); + cy.get("[data-cy=inspector-option-value]").clear().type("two"); + cy.get("[data-cy=inspector-option-content]").clear().type("two"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-options-edit]").eq(1).click(); + cy.get("[data-cy=inspector-option-value]").clear().type("one"); + cy.get("[data-cy=inspector-option-content]").clear().type("one"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get('div:contains("An item with the same key already exists")').should( + "be.visible" + ); }); - it('Multi select list', () => { - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Provide Values'); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('one'); - cy.get('[data-cy=inspector-option-content]').type('one'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('two'); - cy.get('[data-cy=inspector-option-content]').type('two'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('three'); - cy.get('[data-cy=inspector-option-content]').type('three'); - cy.get('[data-cy=inspector-option-cancel]').click(); - cy.get('[data-cy=inspector-allow-multi-select]').click(); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').click(); - cy.get('[data-cy=preview-content] span:contains(one)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(two)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(three)').should('not.exist'); - - cy.get('[data-cy=preview-content] span:contains(two):first').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').click(); - cy.get('[data-cy=preview-content] span:contains(one):first').click(); + it("Multi select list", () => { + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Provide Values"); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("one"); + cy.get("[data-cy=inspector-option-content]").type("one"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("two"); + cy.get("[data-cy=inspector-option-content]").type("two"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("three"); + cy.get("[data-cy=inspector-option-content]").type("three"); + cy.get("[data-cy=inspector-option-cancel]").click(); + cy.get("[data-cy=inspector-allow-multi-select]").click(); + + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).click(); + cy.get("[data-cy=preview-content] span:contains(one)").should("be.visible"); + cy.get("[data-cy=preview-content] span:contains(two)").should("be.visible"); + cy.get("[data-cy=preview-content] span:contains(three)").should( + "not.exist" + ); + + cy.get("[data-cy=preview-content] span:contains(two):first").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).click(); + cy.get("[data-cy=preview-content] span:contains(one):first").click(); cy.assertPreviewData({ - form_select_list_1: ['two', 'one'], + form_select_list_1: ["two", "one"] }); }); - it('Checkbox select list', () => { - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Provide Values'); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('one'); - cy.get('[data-cy=inspector-option-content]').type('one'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('two'); - cy.get('[data-cy=inspector-option-content]').type('two'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('three'); - cy.get('[data-cy=inspector-option-content]').type('three'); - cy.get('[data-cy=inspector-option-cancel]').click(); - cy.get('[data-cy=inspector-render-as]').select('Radio/Checkbox Group'); - cy.get('[data-cy=inspector-allow-multi-select]').click(); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').eq(1).click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').eq(0).click(); + it("Checkbox select list", () => { + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Provide Values"); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("one"); + cy.get("[data-cy=inspector-option-content]").type("one"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("two"); + cy.get("[data-cy=inspector-option-content]").type("two"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("three"); + cy.get("[data-cy=inspector-option-content]").type("three"); + cy.get("[data-cy=inspector-option-cancel]").click(); + cy.get("[data-cy=inspector-render-as]").select("Radio/Checkbox Group"); + cy.get("[data-cy=inspector-allow-multi-select]").click(); + + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ) + .eq(1) + .click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ) + .eq(0) + .click(); cy.assertPreviewData({ - form_select_list_1: ['two', 'one'], + form_select_list_1: ["two", "one"] }); }); - it('Radiobox select list', () => { - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Provide Values'); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('one'); - cy.get('[data-cy=inspector-option-content]').type('one'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('two'); - cy.get('[data-cy=inspector-option-content]').type('two'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('three'); - cy.get('[data-cy=inspector-option-content]').type('three'); - cy.get('[data-cy=inspector-option-cancel]').click(); - cy.get('[data-cy=inspector-render-as]').select('Radio/Checkbox Group'); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').eq(1).click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').eq(0).click(); + it("Radiobox select list", () => { + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Provide Values"); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("one"); + cy.get("[data-cy=inspector-option-content]").type("one"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("two"); + cy.get("[data-cy=inspector-option-content]").type("two"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("three"); + cy.get("[data-cy=inspector-option-content]").type("three"); + cy.get("[data-cy=inspector-option-cancel]").click(); + cy.get("[data-cy=inspector-render-as]").select("Radio/Checkbox Group"); + + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ) + .eq(1) + .click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ) + .eq(0) + .click(); cy.assertPreviewData({ - form_select_list_1: 'one', + form_select_list_1: "one" }); }); - it('Options from Request Variable (object value)', () => { + it("Options from Request Variable (object value)", () => { cy.setPreviewDataInput({ options: [ - {id:'one', label: 'one'}, - {id:'two', label: 'two'}, - ], + { id: "one", label: "one" }, + { id: "two", label: "two" } + ] }); - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Request Data'); - cy.get('[data-cy=inspector-options-variable]').clear().type('options'); - cy.get('[data-cy=inspector-options-label]').clear().type('label'); - cy.get('[data-cy=inspector-value-returned]').select('Object'); + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Request Data"); + cy.get("[data-cy=inspector-options-variable]").clear().type("options"); + cy.get("[data-cy=inspector-options-label]").clear().type("label"); + cy.get("[data-cy=inspector-value-returned]").select("Object"); // todo: fix in vue-form-elements validation (The form select list 1 must be a string.) when object is returned // todo: fin in vue-form-lements default properties for: valueReturned, value and content - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').click(); - cy.get('[data-cy=preview-content] span:contains(one)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(two)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(three)').should('not.exist'); - - cy.get('[data-cy=preview-content] span:contains(two):first').click(); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).click(); + cy.get("[data-cy=preview-content] span:contains(one)").should("be.visible"); + cy.get("[data-cy=preview-content] span:contains(two)").should("be.visible"); + cy.get("[data-cy=preview-content] span:contains(three)").should( + "not.exist" + ); + + cy.get("[data-cy=preview-content] span:contains(two):first").click(); cy.assertPreviewData({ options: [ - {id:'one', label: 'one'}, - {id:'two', label: 'two'}, + { id: "one", label: "one" }, + { id: "two", label: "two" } ], - form_select_list_1: {id:'two', label: 'two'}, + form_select_list_1: { id: "two", label: "two" } }); }); - it('Options from Request Variable (single value)', () => { + it("Options from Request Variable (single value)", () => { cy.setPreviewDataInput({ options: [ - {id:'one', label: 'one'}, - {id:'two', label: 'two'}, - ], + { id: "one", label: "one" }, + { id: "two", label: "two" } + ] }); - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Request Data'); - cy.get('[data-cy=inspector-options-variable]').clear().type('options'); - cy.get('[data-cy=inspector-options-label]').clear().type('label'); - cy.get('[data-cy=inspector-value-returned]').select('Single Value'); - cy.get('[data-cy=inspector-options-value]').clear().type('id'); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').click(); - cy.get('[data-cy=preview-content] span:contains(one)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(two)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(three)').should('not.exist'); - - cy.get('[data-cy=preview-content] span:contains(two):first').click(); + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Request Data"); + cy.get("[data-cy=inspector-options-variable]").clear().type("options"); + cy.get("[data-cy=inspector-options-label]").clear().type("label"); + cy.get("[data-cy=inspector-value-returned]").select("Single Value"); + cy.get("[data-cy=inspector-options-value]").clear().type("id"); + + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).click(); + cy.get("[data-cy=preview-content] span:contains(one)").should("be.visible"); + cy.get("[data-cy=preview-content] span:contains(two)").should("be.visible"); + cy.get("[data-cy=preview-content] span:contains(three)").should( + "not.exist" + ); + + cy.get("[data-cy=preview-content] span:contains(two):first").click(); cy.assertPreviewData({ options: [ - {id:'one', label: 'one'}, - {id:'two', label: 'two'}, + { id: "one", label: "one" }, + { id: "two", label: "two" } ], - form_select_list_1: 'two', + form_select_list_1: "two" }); }); - it('Options from Data Connector (single value)', () => { - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Data Connector'); - cy.get('[data-cy=inspector-data-connector]').select('Persons'); - cy.get('[data-cy=inspector-endpoint]').select('list'); - cy.get('[data-cy=inspector-options-variable]').clear().type('response'); - cy.get('[data-cy=inspector-datasource-content]').clear().type('content'); - cy.get('[data-cy=inspector-value-returned]').select('Single Value'); - cy.get('[data-cy=inspector-datasource-value]').clear().type('value'); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').click(); - cy.get('[data-cy=preview-content] span:contains(James)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(John)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(Mary)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(Patricia)').should('be.visible'); - - cy.get('[data-cy=preview-content] span:contains(John):first').click(); + it("Options from Data Connector (single value)", () => { + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Data Connector"); + cy.get("[data-cy=inspector-data-connector]").select("Persons"); + cy.get("[data-cy=inspector-endpoint]").select("list"); + cy.get("[data-cy=inspector-options-variable]").clear().type("response"); + cy.get("[data-cy=inspector-datasource-content]").clear().type("content"); + cy.get("[data-cy=inspector-value-returned]").select("Single Value"); + cy.get("[data-cy=inspector-datasource-value]").clear().type("value"); + + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).click(); + cy.get("[data-cy=preview-content] span:contains(James)").should( + "be.visible" + ); + cy.get("[data-cy=preview-content] span:contains(John)").should( + "be.visible" + ); + cy.get("[data-cy=preview-content] span:contains(Mary)").should( + "be.visible" + ); + cy.get("[data-cy=preview-content] span:contains(Patricia)").should( + "be.visible" + ); + + cy.get("[data-cy=preview-content] span:contains(John):first").click(); cy.assertPreviewData({ - form_select_list_1: '2', + form_select_list_1: "2" }); }); - it('Options from Data Connector (object value)', () => { - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Data Connector'); - cy.get('[data-cy=inspector-data-connector]').select('Persons'); - cy.get('[data-cy=inspector-endpoint]').select('list'); - cy.get('[data-cy=inspector-options-variable]').clear().type('response'); - cy.get('[data-cy=inspector-datasource-content]').clear().type('content'); - cy.get('[data-cy=inspector-value-returned]').select('Object'); + it("Options from Data Connector (object value)", () => { + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Data Connector"); + cy.get("[data-cy=inspector-data-connector]").select("Persons"); + cy.get("[data-cy=inspector-endpoint]").select("list"); + cy.get("[data-cy=inspector-options-variable]").clear().type("response"); + cy.get("[data-cy=inspector-datasource-content]").clear().type("content"); + cy.get("[data-cy=inspector-value-returned]").select("Object"); // todo: fix in vue-form-elements validation (The form select list 1 must be a string.) of object return and "value" as default id // todo: fin in vue-form-lements default properties for: valueReturned, value and content - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').click(); - cy.get('[data-cy=preview-content] span:contains(James)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(John)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(Mary)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(Patricia)').should('be.visible'); - - cy.get('[data-cy=preview-content] span:contains(John):first').click(); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).click(); + cy.get("[data-cy=preview-content] span:contains(James)").should( + "be.visible" + ); + cy.get("[data-cy=preview-content] span:contains(John)").should( + "be.visible" + ); + cy.get("[data-cy=preview-content] span:contains(Mary)").should( + "be.visible" + ); + cy.get("[data-cy=preview-content] span:contains(Patricia)").should( + "be.visible" + ); + + cy.get("[data-cy=preview-content] span:contains(John):first").click(); cy.assertPreviewData({ form_select_list_1: { value: 2, - content: 'John', - }, + content: "John" + } }); }); - it('Set data source by json', () => { - cy.get('[data-cy=accordion-DataSource]').click(); - cy.get('[data-cy=inspector-data-sources]').select('Provide Values'); - cy.get('[data-cy=inspector-add-option]').click(); - cy.get('[data-cy=inspector-option-value]').type('one'); - cy.get('[data-cy=inspector-option-content]').type('one'); - cy.get('[data-cy=inspector-option-save]').click(); - cy.get('[data-cy=inspector-edit-json]').click(); - - cy.assertComponentValueAsJson('[data-cy="inspector-monaco-json"]', [ {content:'one', value: 'one'}]); - - cy.setVueComponentValue('[data-cy="inspector-monaco-json"]', JSON.stringify([ - {content:'one', value: 'one'}, - {content:'two', value: 'two'}, - ])); - cy.get('[data-cy=inspector-monaco-json-expand]').click(); - cy.setVueComponentValue('[data-cy="inspector-monaco-json-expanded"]', JSON.stringify([ - {content:'one', value: 'one'}, - {content:'two', value: 'two'}, - ], null, 2)); - cy.get('[data-cy=inspector-monaco-json-expanded-close]').click(); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').click(); - cy.get('[data-cy=preview-content] span:contains(one)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(two)').should('be.visible'); - cy.get('[data-cy=preview-content] span:contains(three)').should('not.exist'); - - cy.get('[data-cy=preview-content] span:contains(two):first').click(); + it("Set data source by json", () => { + cy.get("[data-cy=accordion-DataSource]").click(); + cy.get("[data-cy=inspector-data-sources]").select("Provide Values"); + cy.get("[data-cy=inspector-add-option]").click(); + cy.get("[data-cy=inspector-option-value]").type("one"); + cy.get("[data-cy=inspector-option-content]").type("one"); + cy.get("[data-cy=inspector-option-save]").click(); + cy.get("[data-cy=inspector-edit-json]").click(); + + cy.assertComponentValueAsJson('[data-cy="inspector-monaco-json"]', [ + { content: "one", value: "one" } + ]); + + cy.setVueComponentValue( + '[data-cy="inspector-monaco-json"]', + JSON.stringify([ + { content: "one", value: "one" }, + { content: "two", value: "two" } + ]) + ); + cy.get("[data-cy=inspector-monaco-json-expand]").click(); + cy.setVueComponentValue( + '[data-cy="inspector-monaco-json-expanded"]', + JSON.stringify( + [ + { content: "one", value: "one" }, + { content: "two", value: "two" } + ], + null, + 2 + ) + ); + cy.get("[data-cy=inspector-monaco-json-expanded-close]").click(); + + cy.get("[data-cy=mode-preview]").click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).click(); + cy.get("[data-cy=preview-content] span:contains(one)").should("be.visible"); + cy.get("[data-cy=preview-content] span:contains(two)").should("be.visible"); + cy.get("[data-cy=preview-content] span:contains(three)").should( + "not.exist" + ); + + cy.get("[data-cy=preview-content] span:contains(two):first").click(); cy.assertPreviewData({ - form_select_list_1: 'two', + form_select_list_1: "two" }); }); }); diff --git a/tests/e2e/specs/FormTextArea.spec.js b/tests/e2e/specs/FormTextArea.spec.js index 5fcb88845..6f443e5fa 100644 --- a/tests/e2e/specs/FormTextArea.spec.js +++ b/tests/e2e/specs/FormTextArea.spec.js @@ -1,127 +1,194 @@ -describe('Form Text Area Field', () => { - it('Default properties', () => { - cy.visit('/'); +describe("Form Text Area Field", () => { + it("Default properties", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_text_area_1]').type('Hello World'); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_text_area_1]").type( + "Hello World" + ); cy.assertPreviewData({ - form_text_area_1: 'Hello World', + form_text_area_1: "Hello World" }); }); - it('Variable properties', () => { - cy.visit('/'); + it("Variable properties", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]').clear().type('comments'); - cy.get('[data-cy=inspector-label]').clear().type('Comments'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content]').should('contain.html', 'Comments'); - cy.get('[data-cy=preview-content] [name=comments]').type('Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockup.'); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]").clear().type("comments"); + cy.get("[data-cy=inspector-label]").clear().type("Comments"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content]").should("contain.html", "Comments"); + cy.get("[data-cy=preview-content] [name=comments]").type( + "Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockup." + ); cy.assertPreviewData({ - comments: 'Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockup.', + comments: + "Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockup." }); }); - it('Read Only', () => { - cy.visit('/'); + it("Read Only", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]').clear().type('comments'); - cy.get('[data-cy=inspector-label]').clear().type('Comments'); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]").clear().type("comments"); + cy.get("[data-cy=inspector-label]").clear().type("Comments"); - cy.get('[data-cy=inspector-readonly').check() - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=screen-field-comments').should('have.attr', 'readonly', 'readonly'); + cy.get("[data-cy=inspector-readonly").check(); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=screen-field-comments").should( + "have.attr", + "readonly", + "readonly" + ); }); - //Configuration - it('Placeholder', () => { - cy.visit('/'); + // Configuration + it("Placeholder", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-placeholder]').clear().type('enter text here'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_text_area_1]').should('have.attr', 'placeholder', 'enter text here'); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-placeholder]").clear().type("enter text here"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_text_area_1]").should( + "have.attr", + "placeholder", + "enter text here" + ); }); - it('Helper Text', () => { - cy.visit('/'); + it("Helper Text", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-helper]').clear().type('helper text test'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content]').should('contain.html', 'helper text test'); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-helper]").clear().type("helper text test"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content]").should( + "contain.html", + "helper text test" + ); }); - it('Rich Text', () => { - cy.visit('/'); + it("Rich Text", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-richtext').check(); // Check checkbox element - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-richtext").check(); // Check checkbox element + cy.get("[data-cy=mode-preview]").click(); cy.setPreviewDataInput('{"form_text_area_1":"

Hello World

"}'); cy.assertPreviewData({ - form_text_area_1: '

Hello World

', + form_text_area_1: "

Hello World

" }); }); - it('Rows', () => { - cy.visit('/'); + it("Rows", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('[data-cy=inspector-rows]').clear().type('4'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_text_area_1]').should('have.attr', 'rows', '4'); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get("[data-cy=inspector-rows]").clear().type("4"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_text_area_1]").should( + "have.attr", + "rows", + "4" + ); }); - it('Default Value', () => { - cy.visit('/'); + it("Default Value", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-defaultValue-basicValue]').clear().type('default value test'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-defaultValue-basicValue]") + .clear() + .type("default value test"); + cy.get("[data-cy=mode-preview]").click(); cy.assertPreviewData({ - form_text_area_1: 'default value test', + form_text_area_1: "default value test" }); }); - it('CSS Selector Name', () => { - cy.visit('/'); + it("CSS Selector Name", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-customCssSelector]').clear().type('customSelector'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_text_area_1]').parent().parent().should('have.attr', 'selector', 'customSelector'); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-customCssSelector]") + .clear() + .type("customSelector"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_text_area_1]") + .parent() + .parent() + .should("have.attr", "selector", "customSelector"); }); - it('Aria Label', () => { - cy.visit('/'); + it("Aria Label", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-ariaLabel]').clear().type('Aria label test'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_text_area_1]').should('have.attr', 'aria-label', 'Aria label test'); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-ariaLabel]").clear().type("Aria label test"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_text_area_1]").should( + "have.attr", + "aria-label", + "Aria label test" + ); }); - it('Tab Order', () => { - cy.visit('/'); + it("Tab Order", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-tabindex]').clear().type('5'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_text_area_1]').should('have.attr', 'tabindex', '5'); + cy.get("[data-cy=controls-FormTextArea]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-tabindex]").clear().type("5"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_text_area_1]").should( + "have.attr", + "tabindex", + "5" + ); }); - }); diff --git a/tests/e2e/specs/LoadComplexData.spec.js b/tests/e2e/specs/LoadComplexData.spec.js index d312d56a4..323087314 100644 --- a/tests/e2e/specs/LoadComplexData.spec.js +++ b/tests/e2e/specs/LoadComplexData.spec.js @@ -1,69 +1,68 @@ -describe('Validation Rules (Advanced test)', () => { +describe("Validation Rules (Advanced test)", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('Verify all validation rules within loops', () => { - cy.loadFromJson('FPP_PFP_CHAIRS_SCREEN.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Verify all validation rules within loops", () => { + cy.loadFromJson("FPP_PFP_CHAIRS_SCREEN.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Open Tab 2 cy.get('[aria-label="Part Time"]:visible:first').click(); // Tab 2 contains the title '2. PART TIME PAGE' - cy.get('#preview').should('contain.html', '2. PART TIME PAGE'); + cy.get("#preview").should("contain.html", "2. PART TIME PAGE"); // Check the data is properly loaded cy.assertPreviewData({ - 'FPP_COLLEGE': '', - 'FPP_DEPARTMENT': '', + FPP_COLLEGE: "", + FPP_DEPARTMENT: "", // 'FPP_USER_FULL_TIME': { // 'FPP_TL_FULL_TIME': null, // 'FPP_NTL_FULL_TIME': null, // }, // @todo this was overwritten to null by SelectList when list is refreshed // at FormSelectList.vue @ updateWatcherDependentFieldValue() - 'FPP_USER_FULL_TIME': null, - 'FPP_NAME_FULL_TIME': '', - 'FPP_RANK_FULL_TIME': '', - 'FPP_EMPLOYEE_FULL_TIME': '', - 'FPP_FULL_TIME_FRONTLOAD_UNDERLOAD': null, - 'FPP_FULL_TIME_REGULAR_LOAD': null, - 'buttonSaveFullTime': null, - 'buttonSubmit': null, - 'FPP_SUB_TOTAL_UNITS_NTL_FULL_TIME': '0', - 'FPP_SUB_TOTAL_FACULTY_TL_FULL_TIME': '0', - 'FPP_SUB_TOTAL_PREMIUM_TL_FULL_TIME': '0', - 'FPP_REQUEST_ID': '', + FPP_USER_FULL_TIME: null, + FPP_NAME_FULL_TIME: "", + FPP_RANK_FULL_TIME: "", + FPP_EMPLOYEE_FULL_TIME: "", + FPP_FULL_TIME_FRONTLOAD_UNDERLOAD: null, + FPP_FULL_TIME_REGULAR_LOAD: null, + buttonSaveFullTime: null, + buttonSubmit: null, + FPP_SUB_TOTAL_UNITS_NTL_FULL_TIME: "0", + FPP_SUB_TOTAL_FACULTY_TL_FULL_TIME: "0", + FPP_SUB_TOTAL_PREMIUM_TL_FULL_TIME: "0", + FPP_REQUEST_ID: "", // 'FPP_USER_PART_TIME': { // 'FPP_TL_PART_TIME': null, // 'FPP_NTL_PART_TIME': null, // }, // @todo this was overwritten to null by SelectList when list is refreshed // at FormSelectList.vue @ updateWatcherDependentFieldValue() - 'FPP_USER_PART_TIME': null, - 'FPP_NAME_PART_TIME': '', - 'FPP_RANK_PART_TIME': '', - 'FPP_EMPLOYEE_PART_TIME': '', - 'FPP_GRAND_TOTAL_PART_TIME': '0', - 'FPP_PART_TIME_FRONTLOAD_UNDERLOAD': null, - 'FPP_PART_TIME_REGULAR_LOAD': null, - 'FPP_REMARKS_PART_TIME': '', - 'FPP_SUB_TOTAL_UNITS_NTL_PART_TIME': '0', - 'FPP_SUB_TOTAL_FACULTY_TL_PART_TIME': '0', - 'FPP_SUB_TOTAL_PREMIUM_TL_PART_TIME': '0', - 'subTotalPremiumTLFullTime': 0, - 'subTotalFacultyTLFullTime': 0, - 'FPP_GRAND_TOTAL_FULL_TIME': 0, - 'subTotalUnitsNTLPartTime': 0, - 'subTotalPremiumTLPartTime': 0, - 'subTotalFacultyTLPartTime': 0, - 'grandTotalPartTime': 0, - 'subTotalTeachingTLFullTime': 0, - 'subTotalUnitsNTLFullTime': 0, - 'FPP_FULL_TIME_OVERLOAD': 0, - 'FPP_FULL_TIME_PREMIUM_TOTAL': 0, - 'FPP_PART_TIME_OVERLOAD': 0, - 'FPP_PART_TIME_PREMIUM_TOTAL': 0, + FPP_USER_PART_TIME: null, + FPP_NAME_PART_TIME: "", + FPP_RANK_PART_TIME: "", + FPP_EMPLOYEE_PART_TIME: "", + FPP_GRAND_TOTAL_PART_TIME: "0", + FPP_PART_TIME_FRONTLOAD_UNDERLOAD: null, + FPP_PART_TIME_REGULAR_LOAD: null, + FPP_REMARKS_PART_TIME: "", + FPP_SUB_TOTAL_UNITS_NTL_PART_TIME: "0", + FPP_SUB_TOTAL_FACULTY_TL_PART_TIME: "0", + FPP_SUB_TOTAL_PREMIUM_TL_PART_TIME: "0", + subTotalPremiumTLFullTime: 0, + subTotalFacultyTLFullTime: 0, + FPP_GRAND_TOTAL_FULL_TIME: 0, + subTotalUnitsNTLPartTime: 0, + subTotalPremiumTLPartTime: 0, + subTotalFacultyTLPartTime: 0, + grandTotalPartTime: 0, + subTotalTeachingTLFullTime: 0, + subTotalUnitsNTLFullTime: 0, + FPP_FULL_TIME_OVERLOAD: 0, + FPP_FULL_TIME_PREMIUM_TOTAL: 0, + FPP_PART_TIME_OVERLOAD: 0, + FPP_PART_TIME_PREMIUM_TOTAL: 0 }); }); }); diff --git a/tests/e2e/specs/Loop.spec.js b/tests/e2e/specs/Loop.spec.js index d81aa84c7..11a54de3f 100644 --- a/tests/e2e/specs/Loop.spec.js +++ b/tests/e2e/specs/Loop.spec.js @@ -1,323 +1,412 @@ -describe('Loop control', () => { - it('Input inside loop', () => { - cy.visit('/'); +describe("Loop control", () => { + it("Input inside loop", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); // Add loop control - cy.get('[data-cy=controls-FormLoop]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]').clear().type('rows'); - cy.get('[data-cy=inspector-source]').select('existing'); - cy.get('[data-cy=inspector-add]').click(); + cy.get("[data-cy=controls-FormLoop]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]").clear().type("rows"); + cy.get("[data-cy=inspector-source]").select("existing"); + cy.get("[data-cy=inspector-add]").click(); // Add input to loop cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container] .column-draggable div', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container] .column-draggable div", + { position: "bottom" } + ); // Preview - cy.get('[data-cy=mode-preview]').click(); - + cy.get("[data-cy=mode-preview]").click(); + cy.assertPreviewData({ - rows: [], + rows: [] }); // Change source to new array - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=inspector-source]').select('new'); - cy.get('[data-cy=inspector-times]').clear().type('2'); - - // Preview - cy.get('[data-cy=mode-preview]').click(); - - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.length', 2); - cy.get('[data-cy=preview-content] [name=form_input_1]').eq(0).clear().type('one'); - cy.get('[data-cy=preview-content] [name=form_input_1]').eq(1).clear().type('two'); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=inspector-source]").select("new"); + cy.get("[data-cy=inspector-times]").clear().type("2"); - cy.get('[data-cy=preview-content] [data-cy=loop-rows-add]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').should('have.length', 3); - cy.get('[data-cy=preview-content] [name=form_input_1]').eq(2).clear().type('three'); + // Preview + cy.get("[data-cy=mode-preview]").click(); + + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.length", + 2 + ); + cy.get("[data-cy=preview-content] [name=form_input_1]") + .eq(0) + .clear() + .type("one"); + cy.get("[data-cy=preview-content] [name=form_input_1]") + .eq(1) + .clear() + .type("two"); + + cy.get("[data-cy=preview-content] [data-cy=loop-rows-add]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "have.length", + 3 + ); + cy.get("[data-cy=preview-content] [name=form_input_1]") + .eq(2) + .clear() + .type("three"); cy.assertPreviewData({ rows: [ - { form_input_1: 'one' }, - { form_input_1: 'two' }, - { form_input_1: 'three' }, - ], + { form_input_1: "one" }, + { form_input_1: "two" }, + { form_input_1: "three" } + ] }); // Remove items - cy.get('[data-cy=preview-content] [data-cy=loop-rows-remove]').click(); - cy.on('window:confirm', () => true); + cy.get("[data-cy=preview-content] [data-cy=loop-rows-remove]").click(); + cy.on("window:confirm", () => true); cy.assertPreviewData({ - rows: [ - { form_input_1: 'one' }, - { form_input_1: 'two' }, - ], + rows: [{ form_input_1: "one" }, { form_input_1: "two" }] }); }); - it('Verify validation on visible fields', () => { - cy.visit('/'); + it("Verify validation on visible fields", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); // Add loop control - cy.get('[data-cy=controls-FormLoop]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]'); - cy.get('[data-cy=inspector-source]').select('existing'); + cy.get("[data-cy=controls-FormLoop]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]"); + cy.get("[data-cy=inspector-source]").select("existing"); // Add input to loop cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container] .column-draggable div', 'bottom'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container] .column-draggable div', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container] .column-draggable div", + { position: "bottom" } + ); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container] .column-draggable div", + { position: "top" } + ); // Configure Validation rule - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-label]').click().clear().type('New Input 2'); - cy.get('[data-cy=add-rule]').click(); - cy.get('[data-cy=select-rule]').click().type('Required{enter}{esc'); - cy.get('[data-cy=save-rule]').click(); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-label]").click().clear().type("New Input 2"); + cy.get("[data-cy=add-rule]").click(); + cy.get("[data-cy=select-rule]").click().type("Required{enter}{esc"); + cy.get("[data-cy=save-rule]").click(); // Set Visibility rule - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-conditionalHide]').clear().type('name != "foo"'); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-conditionalHide]") + .clear() + .type('name !== "foo"'); // Add submit button - cy.get('[data-cy=controls-FormButton]').contains('Submit Button').drag('[data-cy=screen-element-container]', 'bottom'); + cy.get("[data-cy=controls-FormButton]") + .contains("Submit Button") + .drag("[data-cy=screen-element-container]", { position: "bottom" }); cy.setPreviewDataInput('{"loop_1":[{"name": "foo"}]}'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_2]').should('be.not.visible'); - - //submit form valid - cy.get('[data-cy=preview-content] [name="Default"] > :nth-child(1) > .form-group > .btn').click(); - cy.on('window:alert', (str) => { - expect(str).to.equal('Preview Form was Submitted'); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_2]").should( + "not.be.visible" + ); + + // submit form valid + cy.get( + '[data-cy=preview-content] [name="Default"] > :nth-child(2) > .form-group > .btn' + ).click(); + cy.on("window:alert", (str) => { + expect(str).to.equal("Preview Form was Submitted"); }); }); - it('Runs validations on loops referencing same variable ', () => { - cy.visit('/'); - cy.server(); + it("Runs validations on loops referencing same variable ", () => { + cy.visit("/"); + let alert = false; - cy.on('window:alert', msg => alert = msg); - cy.loadFromJson('multi_loop_validations.json', 0); + cy.on("window:alert", (msg) => (alert = msg)); + cy.loadFromJson("multi_loop_validations.json", 0); cy.setPreviewDataInput('{"accounts": [{"name": "foobar"}]}'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Add data to input field in last loop - cy.get('[data-cy=screen-field-form_input_2]').type('bar'); + cy.get("[data-cy=screen-field-form_input_2]").type("bar"); cy.wait(1000); // Ensure the form cannot yet be submitted - cy.get(':nth-child(4) > .form-group > .btn') + cy.get(":nth-child(4) > .form-group > .btn") .click() .then(() => expect(alert).to.equal(false)); // Fill out the required missing field; ensure the form *can* be submitted - cy.get('[data-cy=screen-field-form_input_1]').type('text'); - - cy.get(':nth-child(4) > .form-group > .btn'); + cy.get("[data-cy=screen-field-form_input_1]").type("text"); + cy.get(":nth-child(4) > .form-group > .btn"); }); - it('Verify validation with multicolumn ', () => { - cy.visit('/'); + it("Verify validation with multicolumn ", () => { + cy.visit("/"); let alert = false; - cy.on('window:alert', msg => alert = msg); + cy.on("window:alert", (msg) => (alert = msg)); // Add loop control cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormLoop]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]'); - cy.get('[data-cy=inspector-source]').select('existing'); + cy.get("[data-cy=controls-FormLoop]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]"); + cy.get("[data-cy=inspector-source]").select("existing"); // Add multicolumn to loop - cy.get('[data-cy=controls-FormMultiColumn]').drag('[data-cy=screen-element-container] .column-draggable div', 'bottom'); + cy.get("[data-cy=controls-FormMultiColumn]").drag( + "[data-cy=screen-element-container] .column-draggable div", + { position: "bottom" } + ); // Set multicolumn Visibility Rule - cy.get('.mb-1 > :nth-child(1) > .row > :nth-child(1)').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-conditionalHide]').clear().type('name != "foo"'); + cy.get(".mb-1 > :nth-child(1) > .row > :nth-child(1)").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-conditionalHide]").clear().type('name != "foo"'); // Add input to multicolumn cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('.mb-1 > :nth-child(1) > .row > :nth-child(1)', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag( + ".mb-1 > :nth-child(1) > .row > :nth-child(1)", + { position: "bottom" } + ); // Configure Validation rule - cy.get('#form_input_1 > .m-2').click(); - cy.get('[data-cy=add-rule]').click(); - cy.get('[data-cy=select-rule]').click().type('Required{enter}{esc'); - cy.get('[data-cy=save-rule]').click(); + cy.get("#form_input_1 > .m-2").click(); + cy.get("[data-cy=add-rule]").click(); + cy.get("[data-cy=select-rule]").click().type("Required{enter}{esc"); + cy.get("[data-cy=save-rule]").click(); // Add submit button - cy.get('[data-cy=controls-FormButton]').contains('Submit Button').drag('[data-cy=screen-element-container]', 'bottom'); + cy.get("[data-cy=controls-FormButton]") + .contains("Submit Button") + .drag("[data-cy=screen-element-container]", { position: "bottom" }); // Set preview data cy.setPreviewDataInput('{"loop_1":[{"name": "bar"}, {"name": "foo"}]}'); - cy.get('[data-cy=mode-preview]').click(); - cy.get(':nth-child(2) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > .row > :nth-child(1)').should('be.not.visible'); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + ":nth-child(2) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > .row > :nth-child(1)" + ).should("not.be.visible"); // Ensure form cannot be submitted - cy.get('[name="Default"] > :nth-child(1) > .form-group > .btn') + cy.get('[name="Default"] > :nth-child(2) > .form-group > .btn') .click() - .then(() => expect(alert).to.equal(false)); + .then(() => expect(alert).to.equal(false)); // Add data to input field - cy.get(':nth-child(1) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > .row > :nth-child(1) > :nth-child(1) > .form-group > [data-cy=screen-field-form_input_1]').clear().type('foobar').blur(); + cy.get( + ":nth-child(1) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > .row > :nth-child(1) > :nth-child(1) > .form-group > [data-cy=screen-field-form_input_1]" + ) + .clear() + .type("foobar") + .blur(); // Ensure form can be submitted - cy.get('.form-group > .btn') + cy.get(".form-group > .btn") .click() - .then(() => expect(alert).to.equal('Preview Form was Submitted')); + .then(() => expect(alert).to.equal("Preview Form was Submitted")); }); - it('Verify validation with nested loop ', () => { - cy.visit('/'); + it("Verify validation with nested loop ", () => { + cy.visit("/"); let alert = false; - cy.on('window:alert', msg => alert = msg); + cy.on("window:alert", (msg) => (alert = msg)); // Add loop contro cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormLoop]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]'); - cy.get('[data-cy=inspector-source]').select('existing'); + cy.get("[data-cy=controls-FormLoop]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]"); + cy.get("[data-cy=inspector-source]").select("existing"); // Add loop to loop - cy.get('[data-cy=controls-FormLoop]').drag('[data-cy=screen-element-container] .column-draggable div', 'bottom'); + cy.get("[data-cy=controls-FormLoop]").drag( + "[data-cy=screen-element-container] .column-draggable div", + { position: "bottom" } + ); // Set nested loop Visibility Rule - cy.get('.m-2').click(); - cy.get('[data-cy=inspector-times]').clear().type(1); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-conditionalHide]').clear().type('name != "foo"'); + cy.get(".m-2").click(); + cy.get("[data-cy=inspector-times]").clear().type(1); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-conditionalHide]").clear().type('name != "foo"'); // Add input to nested loop cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('.m-2 > .column-draggable > div', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag( + ".m-2 > .column-draggable > div", + { position: "bottom" } + ); // Configure Input Validation rule - cy.get('#form_input_1 > .m-2').click(); - cy.get('[data-cy=add-rule]').click(); - cy.get('[data-cy=select-rule]').click().type('Required{enter}{esc'); - cy.get('[data-cy=save-rule]').click(); + cy.get("#form_input_1 > .m-2").click(); + cy.get("[data-cy=add-rule]").click(); + cy.get("[data-cy=select-rule]").click().type("Required{enter}{esc"); + cy.get("[data-cy=save-rule]").click(); // Add submit button - cy.get('[data-cy=controls-FormButton]').contains('Submit Button').drag('[data-cy=screen-element-container]', 'bottom'); + cy.get("[data-cy=controls-FormButton]") + .contains("Submit Button") + .drag("[data-cy=screen-element-container]", { position: "bottom" }); // Set preview data cy.setPreviewDataInput('{"loop_1":[{"name": "bar"}, {"name": "foo"}]}'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[name="loop_1"] > :nth-child(2) > :nth-child(1)').should('be.not.visible'); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[name="loop_1"] > :nth-child(2) > :nth-child(1)').should( + "not.be.visible" + ); // Ensure form cannot be submitted - cy.get('[name="Default"] > :nth-child(1) > .form-group > .btn') + cy.get('[name="Default"] > :nth-child(2) > .form-group > .btn') .click() .then(() => expect(alert).to.equal(false)); // Add data to input field - cy.get(':nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > [name="loop_2"] > :nth-child(1) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > .form-group > [data-cy=screen-field-form_input_1]').clear().type('foobar').blur(); + cy.get( + ':nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > [name="loop_2"] > :nth-child(1) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > .form-group > [data-cy=screen-field-form_input_1]' + ) + .clear() + .type("foobar") + .blur(); // Ensure form can be submitted - cy.get('[name="Default"] > :nth-child(1) > .form-group > .btn') + cy.get('[name="Default"] > :nth-child(2) > .form-group > .btn') .click() - .then(() => expect(alert).to.equal('Preview Form was Submitted')); + .then(() => expect(alert).to.equal("Preview Form was Submitted")); }); - it('Verify validation with nested screen ', () => { + it("Verify validation with nested screen ", () => { // Load Nested Screen - cy.server(); - cy.route('GET', '/api/1.0/screens/1', JSON.stringify({ - id: 1, - screen_category_id: 1, - title: 'Sub screen example', - description: 'A sub screen example', - type: 'FORM', - config: [ - { - name: 'Sub screen example', - items: [ - { - 'config': { - 'icon': 'far fa-square', - 'label': 'First name', - 'name': 'firstname', - 'placeholder': '', - 'validation': 'required', - 'helper': null, - 'type': 'text', - 'dataFormat': 'string', - 'customCssSelector': 'first-name', - }, - 'inspector': [], - 'component': 'FormInput', - 'editor-component': 'FormInput', - 'editor-control': 'FormInput', - 'label': 'Line Input', - 'value': '__vue_devtool_undefined__', - }, - ], - }, - ], - computed: [], - watchers: [], - custom_css: '[selector=\'first-name\'] label { font-style: italic; }', - status: 'ACTIVE', - })); - - cy.visit('/'); + + cy.intercept( + "GET", + "/api/1.0/screens/1", + JSON.stringify({ + id: 1, + screen_category_id: 1, + title: "Sub screen example", + description: "A sub screen example", + type: "FORM", + config: [ + { + name: "Sub screen example", + items: [ + { + config: { + icon: "far fa-square", + label: "First name", + name: "firstname", + placeholder: "", + validation: "required", + helper: null, + type: "text", + dataFormat: "string", + customCssSelector: "first-name" + }, + inspector: [], + component: "FormInput", + "editor-component": "FormInput", + "editor-control": "FormInput", + label: "Line Input", + value: "__vue_devtool_undefined__" + } + ] + } + ], + computed: [], + watchers: [], + custom_css: "[selector='first-name'] label { font-style: italic; }", + status: "ACTIVE" + }) + ); + + cy.visit("/"); cy.showValidationOnLoad(); let alert = false; - cy.on('window:alert', msg => alert = msg); + cy.on("window:alert", (msg) => (alert = msg)); cy.openAcordeon("collapse-2"); // Add loop control - cy.get('[data-cy=controls-FormLoop]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]'); - cy.get('[data-cy=inspector-source]').select('existing'); + cy.get("[data-cy=controls-FormLoop]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]"); + cy.get("[data-cy=inspector-source]").select("existing"); // Add nested screen to loop - cy.get('[data-cy=controls-FormNestedScreen]').drag('[data-cy=screen-element-container] .column-draggable div', 'bottom'); - cy.get('.m-2').click(); - cy.get('.multiselect__tags').click().wait(1000).type('{downarrow}{enter}{esc}'); + cy.get("[data-cy=controls-FormNestedScreen]").drag( + "[data-cy=screen-element-container] .column-draggable div", + { position: "bottom" } + ); + cy.get(".m-2").click(); + cy.get(".multiselect__tags") + .click() + .wait(1000) + .type("{downarrow}{enter}{esc}"); // Set Nested Screen Visibility Rule - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-conditionalHide]').clear().type('name != "foo"'); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-conditionalHide]").clear().type('name != "foo"'); // Add submit button cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormButton]').contains('Submit Button').drag('[data-cy=screen-element-container]', 'bottom'); + cy.get("[data-cy=controls-FormButton]") + .contains("Submit Button") + .drag("[data-cy=screen-element-container]", { position: "bottom" }); // Set preview data cy.setPreviewDataInput('{"loop_1":[{"name": "bar"}, {"name": "foo"}]}'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[name="loop_1"] > :nth-child(2) > :nth-child(1)').should('be.not.visible'); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[name="loop_1"] > :nth-child(2) > :nth-child(1)').should( + "not.be.visible" + ); cy.wait(1000); - cy.get(':nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > [data-cy="screen-field-Nested Screen"] > [data-cy=screen-renderer] > :nth-child(1) > .page > [selector="first-name"] > .form-group > [data-cy=screen-field-firstname]') + cy.get( + ':nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > [data-cy="screen-field-Nested Screen"] > [data-cy=screen-renderer] > :nth-child(1) > .page > [selector="first-name"] > .form-group > [data-cy=screen-field-firstname]' + ) .parent() - .find('.invalid-feedback') - .should('be.visible'); + .find(".invalid-feedback") + .should("be.visible"); // Ensure form cannot be submitted - cy.get('[name="Default"] > :nth-child(1) > .form-group > .btn') + cy.get('[name="Default"] > :nth-child(2) > .form-group > .btn') .click() .then(() => expect(alert).to.equal(false)); // Add data to input field - cy.get(':nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > [data-cy="screen-field-Nested Screen"] > [data-cy=screen-renderer] > :nth-child(1) > .page > [selector="first-name"] > .form-group > [data-cy=screen-field-firstname]').clear().type('foobar').blur(); + cy.get( + ':nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > :nth-child(1) > [data-cy="screen-field-Nested Screen"] > [data-cy=screen-renderer] > :nth-child(1) > .page > [selector="first-name"] > .form-group > [data-cy=screen-field-firstname]' + ) + .clear() + .type("foobar") + .blur(); // Ensure form can be submitted - cy.get('[name="Default"] > :nth-child(1) > .form-group > .btn') + cy.get('[name="Default"] > :nth-child(2) > .form-group > .btn') .click() - .then(() => expect(alert).to.equal('Preview Form was Submitted')); + .then(() => expect(alert).to.equal("Preview Form was Submitted")); }); }); diff --git a/tests/e2e/specs/LoopFileUpload.spec.js b/tests/e2e/specs/LoopFileUpload.spec.js index 778a6aa5a..1d33a62c5 100644 --- a/tests/e2e/specs/LoopFileUpload.spec.js +++ b/tests/e2e/specs/LoopFileUpload.spec.js @@ -3,7 +3,6 @@ describe("FOUR-2164 Loop FileUpload", () => { const initialData = {}; beforeEach(() => { - cy.server(); cy.visit("/", { onBeforeLoad(win) { cy.stub(win.console, "log").as("consoleLog"); @@ -29,7 +28,7 @@ describe("FOUR-2164 Loop FileUpload", () => { cy.get("@consoleError").should("not.to.be.called"); // Upload file 1 - cy.route( + cy.intercept( "POST", "/api/1.0/requests/1/files", JSON.stringify({ @@ -46,7 +45,7 @@ describe("FOUR-2164 Loop FileUpload", () => { cy.wait("@uploadFile1"); // Upload file 2 - cy.route( + cy.intercept( "POST", "/api/1.0/requests/1/files", JSON.stringify({ @@ -63,7 +62,7 @@ describe("FOUR-2164 Loop FileUpload", () => { cy.wait("@uploadFile2"); // Upload file 3 - cy.route( + cy.intercept( "POST", "/api/1.0/requests/1/files", JSON.stringify({ diff --git a/tests/e2e/specs/LoopSelectList.spec.js b/tests/e2e/specs/LoopSelectList.spec.js index c2c84e4e1..e5d13df8e 100644 --- a/tests/e2e/specs/LoopSelectList.spec.js +++ b/tests/e2e/specs/LoopSelectList.spec.js @@ -1,4 +1,4 @@ -describe('Select List Cache', () => { +describe("Select List Cache", () => { function addHeader(win, name, value) { const meta = win.document.createElement("meta"); meta.setAttribute("name", name); @@ -6,74 +6,76 @@ describe('Select List Cache', () => { win.document.head.appendChild(meta); } beforeEach(() => { - cy.server(); - cy.route( - 'GET', - '/api/1.0/requests/data_sources/3/resources/ListAll/data**', + cy.intercept( + "GET", + "/api/1.0/requests/data_sources/3/resources/ListAll/data**", JSON.stringify({ - 'status': 200, - 'response': { - 'data': [{ - 'id': 1, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 1, - 'name': 'Bolivia', + status: 200, + response: { + data: [ + { + id: 1, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 1, + name: "Bolivia" + }, + collection_id: 3, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } }, - 'collection_id': 3, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }, { - 'id': 2, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 2, - 'name': 'United States', - }, - 'collection_id': 3, - 'title': '2', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }], - 'meta': { - 'filter': '', - 'sort_by': '', - 'sort_order': '', - 'count': 2, - 'total_pages': 1, - 'current_page': 1, - 'from': 1, - 'last_page': 1, - 'path': '/api/1.0/collections/3/records', - 'per_page': 9223372036854775807, - 'to': 2, - 'total': 2, - }, - }, + { + id: 2, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 2, + name: "United States" + }, + collection_id: 3, + title: "2", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } + ], + meta: { + filter: "", + sort_by: "", + sort_order: "", + count: 2, + total_pages: 1, + current_page: 1, + from: 1, + last_page: 1, + path: "/api/1.0/collections/3/records", + per_page: 9223372036854775807, + to: 2, + total: 2 + } + } }) - ).as('getDataSource'); + ).as("getDataSource"); }); - it('None Cached - Verify number of service calls for loop that contains a multiselect list', () => { + it("None Cached - Verify number of service calls for loop that contains a multiselect list", () => { cy.visit("/", { onBeforeLoad(win) { // add meta headers @@ -82,18 +84,18 @@ describe('Select List Cache', () => { } }); - cy.loadFromJson('loop_select_list.json', 0); - cy.wait('@getDataSource'); // designer call - cy.get('[data-cy=mode-preview]').click(); - cy.wait('@getDataSource'); - cy.wait('@getDataSource'); - cy.wait('@getDataSource'); - cy.wait('@getDataSource'); - cy.wait('@getDataSource'); - cy.get('@getDataSource.all').should('have.length', 6); + cy.loadFromJson("loop_select_list.json", 0); + cy.wait("@getDataSource"); // designer call + cy.get("[data-cy=mode-preview]").click(); + cy.wait("@getDataSource"); + cy.wait("@getDataSource"); + cy.wait("@getDataSource"); + cy.wait("@getDataSource"); + cy.wait("@getDataSource"); + cy.get("@getDataSource.all").should("have.length", 6); }); - it('Cached - Verify number of service calls for loop that contains a multiselect list', () => { + it("Cached - Verify number of service calls for loop that contains a multiselect list", () => { cy.visit("/", { onBeforeLoad(win) { // add meta headers @@ -102,16 +104,16 @@ describe('Select List Cache', () => { } }); - cy.loadFromJson('loop_select_list.json', 0); - cy.wait('@getDataSource'); // get data source from designer + cy.loadFromJson("loop_select_list.json", 0); + cy.wait("@getDataSource"); // get data source from designer cy.wait(5000); - cy.get('[data-cy=mode-preview]').click(); - cy.wait('@getDataSource'); - cy.get('@getDataSource.all').should('have.length', 2) - //testing cacheTimeout + cy.get("[data-cy=mode-preview]").click(); + cy.wait("@getDataSource"); + cy.get("@getDataSource.all").should("have.length", 2); + // testing cacheTimeout cy.wait(5000); - cy.get('[data-cy=mode-preview]').click(); - cy.wait('@getDataSource'); - cy.get('@getDataSource.all').should('have.length', 3) + cy.get("[data-cy=mode-preview]").click(); + cy.wait("@getDataSource"); + cy.get("@getDataSource.all").should("have.length", 3); }); -}); \ No newline at end of file +}); diff --git a/tests/e2e/specs/MediaQuery.spec.js b/tests/e2e/specs/MediaQuery.spec.js index 2fd1a60be..c22e1943c 100644 --- a/tests/e2e/specs/MediaQuery.spec.js +++ b/tests/e2e/specs/MediaQuery.spec.js @@ -1,48 +1,50 @@ const sizes = [ [700, 800], [1000, 800], - [1200, 768], + [1200, 768] ]; -const backgroundColor = ['rgb(0, 0, 255)', 'rgb(255, 0, 0)', 'rgb(0, 128, 0)']; +const backgroundColor = ["rgb(0, 0, 255)", "rgb(255, 0, 0)", "rgb(0, 128, 0)"]; -describe('Media Query CSS', () => { +describe("Media Query CSS", () => { before(() => { // run these tests as if in a desktop - cy.visit('/'); + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-customCssSelector]').type('new_input_css'); - cy.get('[data-cy=topbar-css]').click(); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-customCssSelector]").type("new_input_css"); + cy.get("[data-cy=topbar-css]").click(); cy.wait(500); // write the media query in the custom css panel - cy.get('#custom-css').type( - `@media (max-width: 480px) { - div[selector="new_input_css"] { + cy.get("#custom-css").type( + `@media (max-width: 480px) {{}{del} + div[selector="new_input_css"] {{}{del} background-color: blue; } } - @media (min-width: 481px) and (max-width: 810px) { - div[selector="new_input_css"] { + @media (min-width: 481px) and (max-width: 810px) {{}{del} + div[selector="new_input_css"] {{}{del} background-color: red; } } - @media (min-width: 811px) { - div[selector="new_input_css"] { + @media (min-width: 811px) {{}{del} + div[selector="new_input_css"] {{}{del} background-color: green; } } `, - { parseSpecialCharSequences: false }, + { parseSpecialCharSequences: true } ); cy.wait(500); - cy.get('[data-cy=save-button]').click(); + cy.get("[data-cy=save-button]").click(); // preview - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); }); sizes.forEach((size, index) => { @@ -56,7 +58,9 @@ describe('Media Query CSS', () => { } cy.wait(300); - cy.get('[selector=new_input_css]').should('have.css', 'background-color').and('eq', backgroundColor[index]); + cy.get("[selector=new_input_css]") + .should("have.css", "background-color") + .and("eq", backgroundColor[index]); }); }); }); diff --git a/tests/e2e/specs/MultiColumn.spec.js b/tests/e2e/specs/MultiColumn.spec.js index 2d44b73a1..378387748 100644 --- a/tests/e2e/specs/MultiColumn.spec.js +++ b/tests/e2e/specs/MultiColumn.spec.js @@ -1,79 +1,128 @@ -describe('MultiColumns', () => { - - it('Configure using JSON', () => { - cy.visit('/'); +describe("MultiColumns", () => { + it("Configure using JSON", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormMultiColumn]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container] .column-draggable:empty'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container] .column-draggable:empty'); - cy.get('.custom-switch:has([data-cy="inspector-jsonFormat"]) label').click(); - cy.get('[data-cy=inspector-dataJson]').clear().type(JSON.stringify([ - { value:'1', content: '4' }, - { value:'1', content: '8' }, - ]), { parseSpecialCharSequences: false }); - cy.get('[data-cy=inspector-dataJson-save]').click(); + cy.get("[data-cy=controls-FormMultiColumn]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container] .column-draggable:empty" + ); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container] .column-draggable:empty" + ); + cy.get( + '.custom-switch:has([data-cy="inspector-jsonFormat"]) label' + ).click(); + cy.get("[data-cy=inspector-dataJson]") + .clear() + .type( + JSON.stringify([ + { value: "1", content: "4" }, + { value: "1", content: "8" } + ]), + { parseSpecialCharSequences: false } + ); + cy.get("[data-cy=inspector-dataJson-save]").click(); // Assertion: Verify multicolumns - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Assertion: check preview contains the configured columns - cy.get('[data-cy=preview-content]').should('contain.html', '
{ - cy.visit('/'); + it("Configure using columns configuration", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormMultiColumn]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); + cy.get("[data-cy=controls-FormMultiColumn]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); // Remove first column - cy.get('[data-cy=inspector-columns-remove]').eq(0).click(); + cy.get("[data-cy=inspector-columns-remove]").eq(0).click(); // Add column of width 4 - cy.get('[data-cy=inspector-columns-add]').click(); - cy.get('[data-cy=inspector-add-column-width]').type('4'); - cy.get('[data-cy=inspector-add-column-modal] button.btn-primary').click(); + cy.get("[data-cy=inspector-columns-add]").click(); + cy.get("[data-cy=inspector-add-column-width]").type("4"); + cy.get("[data-cy=inspector-add-column-modal] button.btn-primary").click(); // Remove first column - cy.get('[data-cy=inspector-columns-remove]').eq(0).click(); + cy.get("[data-cy=inspector-columns-remove]").eq(0).click(); // Add column of width 8 - cy.get('[data-cy=inspector-columns-add]').click(); - cy.get('[data-cy=inspector-add-column-width]').clear().type('invalid'); - cy.get('[data-cy=inspector-add-column-modal] button.btn-primary').click(); - cy.get('[data-cy=inspector-add-column-modal]').should('contain.text', 'This value must be numeric'); - cy.get('[data-cy=inspector-add-column-width]').clear().type('18'); - cy.get('[data-cy=inspector-add-column-modal] button.btn-primary').click(); - cy.get('[data-cy=inspector-add-column-modal]').should('contain.text', 'This value must be between 1-12'); - cy.get('[data-cy=inspector-add-column-width]').clear().type('10'); - cy.get('[data-cy=inspector-add-column-modal] button.btn-primary').click(); - cy.get('[data-cy=inspector-add-column-modal]').should('contain.text', 'The total size of the columns exceeds 12'); - cy.get('[data-cy=inspector-add-column-width]').clear().type('8'); - cy.get('[data-cy=inspector-add-column-modal] button.btn-primary').click(); + cy.get("[data-cy=inspector-columns-add]").click(); + cy.get("[data-cy=inspector-add-column-width]").clear().type("invalid"); + cy.get("[data-cy=inspector-add-column-modal] button.btn-primary").click(); + cy.get("[data-cy=inspector-add-column-modal]").should( + "contain.text", + "This value must be numeric" + ); + cy.get("[data-cy=inspector-add-column-width]").clear().type("18"); + cy.get("[data-cy=inspector-add-column-modal] button.btn-primary").click(); + cy.get("[data-cy=inspector-add-column-modal]").should( + "contain.text", + "This value must be between 1-12" + ); + cy.get("[data-cy=inspector-add-column-width]").clear().type("10"); + cy.get("[data-cy=inspector-add-column-modal] button.btn-primary").click(); + cy.get("[data-cy=inspector-add-column-modal]").should( + "contain.text", + "The total size of the columns exceeds 12" + ); + cy.get("[data-cy=inspector-add-column-width]").clear().type("8"); + cy.get("[data-cy=inspector-add-column-modal] button.btn-primary").click(); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container] .column-draggable:empty'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container] .column-draggable:empty'); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container] .column-draggable:empty" + ); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container] .column-draggable:empty" + ); // Assertion: Verify multicolumns - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Assertion: check preview contains the configured columns - cy.get('[data-cy=preview-content]').should('contain.html', '
{ beforeEach(() => { - cy.server(); - - cy.route( + cy.intercept( "GET", - "http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", { id: 1, advanceStatus: "open", @@ -57,7 +55,7 @@ describe("FOUR-3375 FileUpload inside MultiInstance Task", () => { cy.get("@consoleError").should("not.to.be.called"); // Upload main file - cy.route( + cy.intercept( "POST", "/api/1.0/requests/1/files", JSON.stringify({ @@ -73,7 +71,7 @@ describe("FOUR-3375 FileUpload inside MultiInstance Task", () => { cy.wait("@uploadMainFile"); // Upload file 1 - cy.route( + cy.intercept( "POST", "/api/1.0/requests/1/files", JSON.stringify({ @@ -90,7 +88,7 @@ describe("FOUR-3375 FileUpload inside MultiInstance Task", () => { cy.wait("@uploadFile1"); // Upload file 2 - cy.route( + cy.intercept( "POST", "/api/1.0/requests/1/files", JSON.stringify({ @@ -107,7 +105,7 @@ describe("FOUR-3375 FileUpload inside MultiInstance Task", () => { cy.wait("@uploadFile2"); // Upload file 3 - cy.route( + cy.intercept( "POST", "/api/1.0/requests/1/files", JSON.stringify({ diff --git a/tests/e2e/specs/MultipleUpload.spec.js b/tests/e2e/specs/MultipleUpload.spec.js index b17ffb6e9..11935e93b 100644 --- a/tests/e2e/specs/MultipleUpload.spec.js +++ b/tests/e2e/specs/MultipleUpload.spec.js @@ -1,147 +1,227 @@ - -describe('Multiple Upload', () => { - +describe("Multiple Upload", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); - cy.window().then(win => { + cy.visit("/"); + cy.window().then((win) => { // Add request-id header - const requestIdMeta = window.document.createElement('meta'); - requestIdMeta.setAttribute('name', 'request-id'); - requestIdMeta.setAttribute('content', '1'); + const requestIdMeta = window.document.createElement("meta"); + requestIdMeta.setAttribute("name", "request-id"); + requestIdMeta.setAttribute("content", "1"); win.document.head.appendChild(requestIdMeta); }); }); - it('Upload a Single File', () => { - cy.loadFromJson('multiple_upload.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Upload a Single File", () => { + cy.loadFromJson("multiple_upload.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Upload single file should show the uploaded file name - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-filesingle] input[type=file]', 'avatar.jpeg', 'image/jpg'); - cy.get('[data-cy=avatar-jpeg] .uploader-file-name').should('include.text', 'avatar.jpeg'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + "[data-cy=preview-content] [data-cy=screen-field-filesingle] input[type=file]", + "avatar.jpeg", + "image/jpg" + ); + cy.get("[data-cy=avatar-jpeg] .uploader-file-name").should( + "include.text", + "avatar.jpeg" + ); // Upload another file, it should replace the file displayed in the control - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 2, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-filesingle] input[type=file]', 'file1.jpeg', 'image/jpg'); - cy.get('[data-cy=file1-jpeg] .uploader-file-name').should('include.text', 'file1.jpeg'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 2 + }) + ); + cy.uploadFile( + "[data-cy=preview-content] [data-cy=screen-field-filesingle] input[type=file]", + "file1.jpeg", + "image/jpg" + ); + cy.get("[data-cy=file1-jpeg] .uploader-file-name").should( + "include.text", + "file1.jpeg" + ); }); - it('Upload multiple files', () => { - cy.loadFromJson('multiple_upload.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Upload multiple files", () => { + cy.loadFromJson("multiple_upload.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Upload one file - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-filemultiple] input[type=file]', 'avatar.jpeg', 'image/jpg'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + "[data-cy=preview-content] [data-cy=screen-field-filemultiple] input[type=file]", + "avatar.jpeg", + "image/jpg" + ); // The file should be listed in the multiple upload control - cy.get('[data-cy=preview-content] [data-cy=screen-field-filemultiple]') - .find('[data-cy=1] .uploader-file-name') - .should('include.text', 'avatar.jpeg'); + cy.get("[data-cy=preview-content] [data-cy=screen-field-filemultiple]") + .find("[data-cy=1] .uploader-file-name") + .should("include.text", "avatar.jpeg"); // Add a new file - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 2, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-filemultiple] input[type=file]', 'file1.jpeg', 'image/jpg'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 2 + }) + ); + cy.uploadFile( + "[data-cy=preview-content] [data-cy=screen-field-filemultiple] input[type=file]", + "file1.jpeg", + "image/jpg" + ); // The file should be listed in multiple upload control - cy.get('[data-cy=preview-content] [data-cy=screen-field-filemultiple]') - .find('[data-cy=2] .uploader-file-name') - .should('include.text', 'file1.jpeg'); + cy.get("[data-cy=preview-content] [data-cy=screen-field-filemultiple]") + .find("[data-cy=2] .uploader-file-name") + .should("include.text", "file1.jpeg"); // Remove the last file - cy.route('DELETE', '/api/1.0/files/2', JSON.stringify({ - message: 'File deleted', - })); - cy.get('[data-cy=preview-content] [data-cy=screen-field-filemultiple]') - .find('[data-cy=2] [title=Delete]') + cy.intercept( + "DELETE", + "/api/1.0/files/2", + JSON.stringify({ + message: "File deleted" + }) + ); + cy.get("[data-cy=preview-content] [data-cy=screen-field-filemultiple]") + .find("[data-cy=2] [title=Delete]") .click(); - //The row of file 2 sould not exist, but file 1 should exist - cy.get('[data-cy=preview-content] [data-cy=screen-field-filemultiple]') - .find('[data-cy=2] .uploader-file-name') - .should('not.exist'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-filemultiple]') - .find('[data-cy=1] .uploader-file-name') - .should('exist'); + // The row of file 2 sould not exist, but file 1 should exist + cy.get("[data-cy=preview-content] [data-cy=screen-field-filemultiple]") + .find("[data-cy=2] .uploader-file-name") + .should("not.exist"); + cy.get("[data-cy=preview-content] [data-cy=screen-field-filemultiple]") + .find("[data-cy=1] .uploader-file-name") + .should("exist"); // Remove the first file - cy.route('DELETE', '/api/1.0/files/1', JSON.stringify({ - message: 'File deleted', - })); - cy.get('[data-cy=preview-content] [data-cy=screen-field-filemultiple]') - .find('[data-cy=1] [title=Delete]') + cy.intercept( + "DELETE", + "/api/1.0/files/1", + JSON.stringify({ + message: "File deleted" + }) + ); + cy.get("[data-cy=preview-content] [data-cy=screen-field-filemultiple]") + .find("[data-cy=1] [title=Delete]") .click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-filemultiple]') - .find('[data-cy=1] .uploader-file-name') - .should('not.exist'); + cy.get("[data-cy=preview-content] [data-cy=screen-field-filemultiple]") + .find("[data-cy=1] .uploader-file-name") + .should("not.exist"); }); - it('Upload files in record lists', () => { - cy.loadFromJson('multiple_upload.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Upload files in record lists", () => { + cy.loadFromJson("multiple_upload.json", 0); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-members] [data-cy=add-row]').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-members] [data-cy=add-row]" + ).click(); // Upload single file should show the uploaded file name - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-map] input[type=file]', 'avatar.jpeg', 'image/jpg'); - cy.get('[data-cy=avatar-jpeg] .uploader-file-name').should('include.text', 'avatar.jpeg'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + "[data-cy=preview-content] [data-cy=screen-field-map] input[type=file]", + "avatar.jpeg", + "image/jpg" + ); + cy.get("[data-cy=avatar-jpeg] .uploader-file-name").should( + "include.text", + "avatar.jpeg" + ); // The global variable should store the uploaded item - cy.window().its('PM4ConfigOverrides.requestFiles') - .then(requestFiles => { - const firstMapFileVar = Object.keys(requestFiles).find(x => x.startsWith('map')); - const rowId = firstMapFileVar.split('map.')[1]; - expect(requestFiles['map.' + rowId][0].file_name).to.equal('avatar.jpeg'); + cy.window() + .its("PM4ConfigOverrides.requestFiles") + .then((requestFiles) => { + const firstMapFileVar = Object.keys(requestFiles).find((x) => + x.startsWith("map") + ); + const rowId = firstMapFileVar.split("map.")[1]; + expect(requestFiles[`map.${rowId}`][0].file_name).to.equal( + "avatar.jpeg" + ); }); // Upload a file in multiple file mode - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-pictures] input[type=file]', 'avatar.jpeg', 'image/jpg'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + "[data-cy=preview-content] [data-cy=screen-field-pictures] input[type=file]", + "avatar.jpeg", + "image/jpg" + ); // The file should be listed in multiple upload control - cy.get('[data-cy=preview-content] [data-cy=screen-field-pictures]') - .find('[data-cy=1] .uploader-file-name') - .should('include.text', 'avatar.jpeg'); - - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 2, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-pictures] input[type=file]', 'file1.jpeg', 'image/jpg'); + cy.get("[data-cy=preview-content] [data-cy=screen-field-pictures]") + .find("[data-cy=1] .uploader-file-name") + .should("include.text", "avatar.jpeg"); + + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 2 + }) + ); + cy.uploadFile( + "[data-cy=preview-content] [data-cy=screen-field-pictures] input[type=file]", + "file1.jpeg", + "image/jpg" + ); // The file should be listed in multiple upload control - cy.get('[data-cy=preview-content] [data-cy=screen-field-pictures]') - .find('[data-cy=2] .uploader-file-name') - .should('include.text', 'file1.jpeg'); + cy.get("[data-cy=preview-content] [data-cy=screen-field-pictures]") + .find("[data-cy=2] .uploader-file-name") + .should("include.text", "file1.jpeg"); // Remove the last file - cy.route('DELETE', '/api/1.0/files/2', JSON.stringify({ - message: 'File deleted', - })); - cy.get('[data-cy=preview-content] [data-cy=screen-field-pictures]') - .find('[data-cy=2] [title=Delete]') + cy.intercept( + "DELETE", + "/api/1.0/files/2", + JSON.stringify({ + message: "File deleted" + }) + ); + cy.get("[data-cy=preview-content] [data-cy=screen-field-pictures]") + .find("[data-cy=2] [title=Delete]") .click(); - //The row of file 2 should not be listed, but file 1 yes - cy.get('[data-cy=preview-content] [data-cy=screen-field-pictures]') - .find('[data-cy=2] .uploader-file-name') - .should('not.exist'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-pictures]') - .find('[data-cy=1] .uploader-file-name') - .should('exist'); + // The row of file 2 should not be listed, but file 1 yes + cy.get("[data-cy=preview-content] [data-cy=screen-field-pictures]") + .find("[data-cy=2] .uploader-file-name") + .should("not.exist"); + cy.get("[data-cy=preview-content] [data-cy=screen-field-pictures]") + .find("[data-cy=1] .uploader-file-name") + .should("exist"); }); - }); diff --git a/tests/e2e/specs/MultiselectWithStringValue.spec.js b/tests/e2e/specs/MultiselectWithStringValue.spec.js index 5d4870976..40052928e 100644 --- a/tests/e2e/specs/MultiselectWithStringValue.spec.js +++ b/tests/e2e/specs/MultiselectWithStringValue.spec.js @@ -1,41 +1,40 @@ -describe('multiselect with string value', () => { +describe("multiselect with string value", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('Multiselect checkbox with string value without user interaction keep its value', () => { - cy.loadFromJson('multiselect_with_string_value.json', 0); + it("Multiselect checkbox with string value without user interaction keep its value", () => { + cy.loadFromJson("multiselect_with_string_value.json", 0); // init screen data - cy.setPreviewDataInput({person: 'foo'}); - cy.get('[data-cy=mode-preview]').click(); + cy.setPreviewDataInput({ person: "foo" }); + cy.get("[data-cy=mode-preview]").click(); // Check the data of the screen cy.assertPreviewData({ - person: 'foo', + person: "foo" }); }); - it('Multiselect checkbox with string value after user interaction change to array', () => { - cy.loadFromJson('multiselect_with_string_value.json', 0); + it("Multiselect checkbox with string value after user interaction change to array", () => { + cy.loadFromJson("multiselect_with_string_value.json", 0); // init screen data - cy.setPreviewDataInput({person: 'foo'}); - cy.get('[data-cy=mode-preview]').click(); + cy.setPreviewDataInput({ person: "foo" }); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy=preview-content] [name=person]').eq(0).click(); - cy.get('[data-cy=preview-content] [name=person]').eq(1).click(); - cy.get('[data-cy=preview-content] [name=person]').eq(0).click(); + cy.get("[data-cy=preview-content] [name=person]").eq(0).click(); + cy.get("[data-cy=preview-content] [name=person]").eq(1).click(); + cy.get("[data-cy=preview-content] [name=person]").eq(0).click(); // Check the data of the screen cy.assertPreviewData({ person: [ { - content: 'two', - value: 'two', - }, - ], + content: "two", + value: "two" + } + ] }); }); }); diff --git a/tests/e2e/specs/NestedCalcProperties.spec.js b/tests/e2e/specs/NestedCalcProperties.spec.js index 35a4cf2ff..09d41c40d 100644 --- a/tests/e2e/specs/NestedCalcProperties.spec.js +++ b/tests/e2e/specs/NestedCalcProperties.spec.js @@ -1,28 +1,29 @@ -describe('nested calculated properties', () => { +describe("nested calculated properties", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); // @link: https://processmaker.atlassian.net/browse/FOUR-4873 - it('Verify nested calculated properties', () => { - cy.loadFromJson('nested_calc_properties.json', 1); - cy.get('[data-cy=mode-preview]').click(); + it("Verify nested calculated properties", () => { + cy.loadFromJson("nested_calc_properties.json", 1); + cy.get("[data-cy=mode-preview]").click(); cy.get('[data-cy=preview] input[name="varA"]').type(10); cy.get('[data-cy=preview] input[name="varB"]').type(5); - cy.get('[data-cy=preview-content] [data-cy="screen-field-operation"]').selectOption('Addition'); - + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-operation"]' + ).selectOption("Addition"); + // Wait until you load the screen cy.wait(500); // Check the data of the screen cy.assertPreviewData({ - 'equal': '=', - 'operation': 1, - 'varA': 10, - 'varB': 5, - 'varR': 15, + equal: "=", + operation: 1, + varA: 10, + varB: 5, + varR: 15 }); }); }); diff --git a/tests/e2e/specs/NestedCalcRadioFreeze.spec.js b/tests/e2e/specs/NestedCalcRadioFreeze.spec.js index 4019a5df4..e2cf6ba79 100644 --- a/tests/e2e/specs/NestedCalcRadioFreeze.spec.js +++ b/tests/e2e/specs/NestedCalcRadioFreeze.spec.js @@ -1,30 +1,28 @@ -describe('nested calc radio freeze', () => { +describe("nested calc radio freeze", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); // @link: https://processmaker.atlassian.net/browse/FOUR-4873 - it('Verify nested calc radio do not freeze', () => { - cy.loadFromJson('nested_calc_radio_freeze.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Verify nested calc radio do not freeze", () => { + cy.loadFromJson("nested_calc_radio_freeze.json", 0); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy=preview-content] button:contains(Continue)').click(); + cy.get("[data-cy=preview-content] button:contains(Continue)").click(); // Wait until you load the screen cy.wait(500); // Check the data of the screen cy.assertPreviewData({ - 'jointOwner': [ + jointOwner: [ { - 'varb': null, - 'form_input_1': null, - 'selectLIst1': null, - 'form_select_list_1': [ - ], - 'selectIsArray': true, - }, - ], + varb: null, + form_input_1: null, + selectLIst1: null, + form_select_list_1: [], + selectIsArray: true + } + ] }); }); }); diff --git a/tests/e2e/specs/NestedScreen.spec.js b/tests/e2e/specs/NestedScreen.spec.js index acbc3e1d4..96c91524f 100644 --- a/tests/e2e/specs/NestedScreen.spec.js +++ b/tests/e2e/specs/NestedScreen.spec.js @@ -1,68 +1,70 @@ -describe('Nested screen', () => { - +describe("Nested screen", () => { beforeEach(() => { - cy.server(); - cy.route('GET', '/api/1.0/screens/1', JSON.stringify({ - id: 1, - screen_category_id: 1, - title: 'Sub screen example', - description: 'A sub screen example', - type: 'FORM', - config: [ - { - name: 'Sub screen example', - items: [ - { - 'config': { - 'icon': 'far fa-square', - 'label': 'First name', - 'name': 'firstname', - 'placeholder': '', - 'validation': '', - 'helper': null, - 'type': 'text', - 'dataFormat': 'string', - 'customCssSelector': 'first-name', - }, - 'inspector': [], - 'component': 'FormInput', - 'editor-component': 'FormInput', - 'editor-control': 'FormInput', - 'label': 'Line Input', - 'value': '__vue_devtool_undefined__', - }, - { - 'config': { - 'icon': 'far fa-square', - 'label': 'Last name', - 'name': 'lastname', - 'placeholder': '', - 'validation': '', - 'helper': null, - 'type': 'text', - 'dataFormat': 'string', - 'customCssSelector': '', + cy.intercept( + "GET", + "/api/1.0/screens/1", + JSON.stringify({ + id: 1, + screen_category_id: 1, + title: "Sub screen example", + description: "A sub screen example", + type: "FORM", + config: [ + { + name: "Sub screen example", + items: [ + { + config: { + icon: "far fa-square", + label: "First name", + name: "firstname", + placeholder: "", + validation: "", + helper: null, + type: "text", + dataFormat: "string", + customCssSelector: "first-name" + }, + inspector: [], + component: "FormInput", + "editor-component": "FormInput", + "editor-control": "FormInput", + label: "Line Input", + value: "__vue_devtool_undefined__" }, - 'inspector': [], - 'component': 'FormInput', - 'editor-component': 'FormInput', - 'editor-control': 'FormInput', - 'label': 'Line Input', - 'value': '__vue_devtool_undefined__', - }, - ], - }, - ], - computed: [], - watchers: [], - custom_css: '[selector=\'first-name\'] label { font-style: italic; }', - status: 'ACTIVE', - })); + { + config: { + icon: "far fa-square", + label: "Last name", + name: "lastname", + placeholder: "", + validation: "", + helper: null, + type: "text", + dataFormat: "string", + customCssSelector: "" + }, + inspector: [], + component: "FormInput", + "editor-component": "FormInput", + "editor-control": "FormInput", + label: "Line Input", + value: "__vue_devtool_undefined__" + } + ] + } + ], + computed: [], + watchers: [], + custom_css: "[selector='first-name'] label { font-style: italic; }", + status: "ACTIVE" + }) + ); }); - //it('With a variable defined', () => { + // it('With a variable defined', () => { // cy.visit('/'); - // cy.get('[data-cy=controls-FormNestedScreen]').drag('[data-cy=screen-drop-zone]', 'bottom'); + // cy.get('[data-cy=controls-FormNestedScreen]').drag('[data-cy=screen-drop-zone]', { position: 'bottom' }); // cy.get('[data-cy=screen-element-container]').click(); // cy.get('[data-cy=inspector-name]').type('person'); // cy.get('[data-cy=inspector-screen] div.multiselect').click(); @@ -74,32 +76,37 @@ describe('Nested screen', () => { // const person = JSON.parse(a.text().split('{...}').join('')); // expect(person).to.eql({ person: { firstname: 'Alan', lastname: 'Turing' }}); // }); - //}); + // }); - it('Without a variable defined', () => { - cy.visit('/'); + it("Without a variable defined", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormNestedScreen]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-screen] div.multiselect').click(); - cy.get('[data-cy=inspector-screen] span:contains("Sub screen example"):first').click(); - cy.get('[data-cy=inspector-screen] .screen-link a') - .should('have.attr', 'href') - .and('include', '/designer/screen-builder/1/edit'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview] input[name="firstname"]').type('Alan'); - cy.get('[data-cy=preview] input[name="lastname"]').type('Turing'); + cy.get("[data-cy=controls-FormNestedScreen]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-screen] div.multiselect").click(); + cy.get( + '[data-cy=inspector-screen] span:contains("Sub screen example"):first' + ).click(); + cy.get("[data-cy=inspector-screen] .screen-link a") + .should("have.attr", "href") + .and("include", "/designer/screen-builder/1/edit"); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy=preview] input[name="firstname"]').type("Alan"); + cy.get('[data-cy=preview] input[name="lastname"]').type("Turing"); cy.assertPreviewData({ firstname: "Alan", lastname: "Turing" }); - cy.get('[data-cy=mode-editor]').click(); + cy.get("[data-cy=mode-editor]").click(); }); - it('With nested screen config.event set to submit', () => { - cy.visit('/'); - cy.loadFromJson('nested_screen_with_event_submit.json', 1); - cy.get('[data-cy=screen-element-container]').first().click(); - cy.get('[data-cy=inspector-screen]').should('contain.text', 'Screen'); + it("With nested screen config.event set to submit", () => { + cy.visit("/"); + cy.loadFromJson("nested_screen_with_event_submit.json", 1); + cy.get("[data-cy=screen-element-container]").first().click(); + cy.get("[data-cy=inspector-screen]").should("contain.text", "Screen"); }); }); diff --git a/tests/e2e/specs/NestedScreenFOUR-7257.spec.js b/tests/e2e/specs/NestedScreenFOUR-7257.spec.js index 4c6615351..dd3a3bfd0 100644 --- a/tests/e2e/specs/NestedScreenFOUR-7257.spec.js +++ b/tests/e2e/specs/NestedScreenFOUR-7257.spec.js @@ -1,6 +1,5 @@ describe("FOUR-7257 validations", () => { beforeEach(() => { - cy.server(); cy.visit("/"); cy.showValidationOnLoad(); }); diff --git a/tests/e2e/specs/NestedValidationRules.spec.js b/tests/e2e/specs/NestedValidationRules.spec.js index 9dba761d7..16c4fcb59 100644 --- a/tests/e2e/specs/NestedValidationRules.spec.js +++ b/tests/e2e/specs/NestedValidationRules.spec.js @@ -1,124 +1,120 @@ - -describe('Validation Rules (Hidden fields and Nested Screens)', () => { +describe("Validation Rules (Hidden fields and Nested Screens)", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('Verify validation rules before submit', () => { - cy.loadFromJson('nested_validations.json', 0); - cy.get('[data-cy=mode-preview]').click(); - - cy.get('[data-cy=preview-content] [name="submit"]') - .click(); - - fillInputText('screen-field-parent_input_1'); - cy.shouldNotHaveValidationErrors('screen-field-parent_input_1'); - fillInputText('screen-field-parent_loop_input_2', 0); - cy.shouldNotHaveValidationErrors('screen-field-parent_loop_input_2', 0); - fillInputText('screen-field-parent_loop_input_2', 1); - cy.shouldNotHaveValidationErrors('screen-field-parent_loop_input_2', 1); - fillInputText('screen-field-parent_loop_input_2', 2); - cy.shouldNotHaveValidationErrors('screen-field-parent_loop_input_2', 2); - fillInputText('screen-field-nested_1'); - cy.shouldNotHaveValidationErrors('screen-field-nested_1'); - fillInputText('screen-field-nested_2'); - cy.shouldNotHaveValidationErrors('screen-field-nested_2'); - fillInputText('screen-field-nested_3'); - cy.shouldNotHaveValidationErrors('screen-field-nested_3'); + it("Verify validation rules before submit", () => { + cy.loadFromJson("nested_validations.json", 0); + cy.get("[data-cy=mode-preview]").click(); + + cy.get('[data-cy=preview-content] [name="submit"]').click(); + + fillInputText("screen-field-parent_input_1"); + cy.shouldNotHaveValidationErrors("screen-field-parent_input_1"); + fillInputText("screen-field-parent_loop_input_2", 0); + cy.shouldNotHaveValidationErrors("screen-field-parent_loop_input_2", 0); + fillInputText("screen-field-parent_loop_input_2", 1); + cy.shouldNotHaveValidationErrors("screen-field-parent_loop_input_2", 1); + fillInputText("screen-field-parent_loop_input_2", 2); + cy.shouldNotHaveValidationErrors("screen-field-parent_loop_input_2", 2); + fillInputText("screen-field-nested_1"); + cy.shouldNotHaveValidationErrors("screen-field-nested_1"); + fillInputText("screen-field-nested_2"); + cy.shouldNotHaveValidationErrors("screen-field-nested_2"); + fillInputText("screen-field-nested_3"); + cy.shouldNotHaveValidationErrors("screen-field-nested_3"); submitForm(); }); - it('Verify validation rules with hidden fields before submit', () => { - cy.loadFromJson('nested_validations_with_hidden_rules.json', 0); - cy.get('[data-cy=mode-preview]').click(); - - cy.get('[data-cy=preview-content] [name="submit"]') - .click(); - - fillInputText('screen-field-parent_input_1'); - cy.shouldNotHaveValidationErrors('screen-field-parent_input_1'); - fillInputText('screen-field-parent_loop_input_2', 0); - cy.shouldNotHaveValidationErrors('screen-field-parent_loop_input_2', 0); - fillInputText('screen-field-parent_loop_input_2', 1); - cy.shouldNotHaveValidationErrors('screen-field-parent_loop_input_2', 1); - fillInputText('screen-field-parent_loop_input_2', 2); - cy.shouldNotHaveValidationErrors('screen-field-parent_loop_input_2', 2); - fillInputText('screen-field-nested_1'); - cy.shouldNotHaveValidationErrors('screen-field-nested_1'); - fillInputText('screen-field-nested_2'); - cy.shouldNotHaveValidationErrors('screen-field-nested_2'); - fillInputText('screen-field-nested_3'); - cy.shouldNotHaveValidationErrors('screen-field-nested_3'); + it("Verify validation rules with hidden fields before submit", () => { + cy.loadFromJson("nested_validations_with_hidden_rules.json", 0); + cy.get("[data-cy=mode-preview]").click(); + + cy.get('[data-cy=preview-content] [name="submit"]').click(); + + fillInputText("screen-field-parent_input_1"); + cy.shouldNotHaveValidationErrors("screen-field-parent_input_1"); + fillInputText("screen-field-parent_loop_input_2", 0); + cy.shouldNotHaveValidationErrors("screen-field-parent_loop_input_2", 0); + fillInputText("screen-field-parent_loop_input_2", 1); + cy.shouldNotHaveValidationErrors("screen-field-parent_loop_input_2", 1); + fillInputText("screen-field-parent_loop_input_2", 2); + cy.shouldNotHaveValidationErrors("screen-field-parent_loop_input_2", 2); + fillInputText("screen-field-nested_1"); + cy.shouldNotHaveValidationErrors("screen-field-nested_1"); + fillInputText("screen-field-nested_2"); + cy.shouldNotHaveValidationErrors("screen-field-nested_2"); + fillInputText("screen-field-nested_3"); + cy.shouldNotHaveValidationErrors("screen-field-nested_3"); submitForm(); }); - it('Verify validation rules with hidden fields in nested screen before submit', () => { - cy.loadFromJson('nested_validations_with_hidden_rules.json', 0); - cy.get('[data-cy=mode-preview]').click(); - - cy.get('[data-cy=preview-content] [name="submit"]') - .click(); - - fillInputText('screen-field-parent_input_1'); - cy.shouldNotHaveValidationErrors('screen-field-parent_input_1'); - fillInputText('screen-field-nested_1'); - cy.shouldNotHaveValidationErrors('screen-field-nested_1'); - fillInputText('screen-field-nested_2'); - cy.shouldNotHaveValidationErrors('screen-field-nested_2'); - fillInputText('screen-field-nested_3'); - cy.shouldNotHaveValidationErrors('screen-field-nested_3'); - fillInputText('screen-field-parent_loop_input_2', 0); - cy.shouldNotHaveValidationErrors('screen-field-parent_loop_input_2', 0); - fillInputText('screen-field-parent_loop_input_2', 1); - cy.shouldNotHaveValidationErrors('screen-field-parent_loop_input_2', 1); - fillInputText('screen-field-parent_loop_input_2', 2); - cy.shouldNotHaveValidationErrors('screen-field-parent_loop_input_2', 2); + it("Verify validation rules with hidden fields in nested screen before submit", () => { + cy.loadFromJson("nested_validations_with_hidden_rules.json", 0); + cy.get("[data-cy=mode-preview]").click(); + + cy.get('[data-cy=preview-content] [name="submit"]').click(); + + fillInputText("screen-field-parent_input_1"); + cy.shouldNotHaveValidationErrors("screen-field-parent_input_1"); + fillInputText("screen-field-nested_1"); + cy.shouldNotHaveValidationErrors("screen-field-nested_1"); + fillInputText("screen-field-nested_2"); + cy.shouldNotHaveValidationErrors("screen-field-nested_2"); + fillInputText("screen-field-nested_3"); + cy.shouldNotHaveValidationErrors("screen-field-nested_3"); + fillInputText("screen-field-parent_loop_input_2", 0); + cy.shouldNotHaveValidationErrors("screen-field-parent_loop_input_2", 0); + fillInputText("screen-field-parent_loop_input_2", 1); + cy.shouldNotHaveValidationErrors("screen-field-parent_loop_input_2", 1); + fillInputText("screen-field-parent_loop_input_2", 2); + cy.shouldNotHaveValidationErrors("screen-field-parent_loop_input_2", 2); submitForm(); }); - it('Verify validation rules with hidden fields and use of _parent in the conditional validation rules', () => { - cy.loadFromJson('loops_validations_with_parent_rules.json', 0); - cy.get('[data-cy=mode-preview]').click(); - - fillInputText('screen-field-form_input_1', 0, '13'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_1', 0); - fillInputText('screen-field-form_input_3', 0, 'ok'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_3', 0); - fillInputText('screen-field-form_input_3', 1, 'ok'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_3', 1); - fillInputText('screen-field-form_input_3', 2, 'ok'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_3', 2); - fillInputText('screen-field-form_input_1', 1, '12'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_1', 1); - fillInputText('screen-field-form_input_2', 0, 'ok'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_2', 0); - fillInputText('screen-field-form_input_2', 0, '10'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_2', 0); - fillInputText('screen-field-form_input_4', 0, 'ok'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_4', 0); + it("Verify validation rules with hidden fields and use of _parent in the conditional validation rules", () => { + cy.loadFromJson("loops_validations_with_parent_rules.json", 0); + cy.get("[data-cy=mode-preview]").click(); + + fillInputText("screen-field-form_input_1", 0, "13"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_1", 0); + fillInputText("screen-field-form_input_3", 0, "ok"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_3", 0); + fillInputText("screen-field-form_input_3", 1, "ok"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_3", 1); + fillInputText("screen-field-form_input_3", 2, "ok"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_3", 2); + fillInputText("screen-field-form_input_1", 1, "12"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_1", 1); + fillInputText("screen-field-form_input_2", 0, "ok"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_2", 0); + fillInputText("screen-field-form_input_2", 0, "10"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_2", 0); + fillInputText("screen-field-form_input_4", 0, "ok"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_4", 0); submitForm(); }); }); -function fillInputText(dataCy, index = null, value = 'test') -{ +function fillInputText(dataCy, index = null, value = "test") { if (index === null) { cy.get(`[data-cy=preview-content] [data-cy="${dataCy}"]`) .clear() .type(value); } else { - cy.get(`[data-cy=preview-content] [data-cy="${dataCy}"]`).eq(index) + cy.get(`[data-cy=preview-content] [data-cy="${dataCy}"]`) + .eq(index) .clear() .type(value); } } -function submitForm() -{ - cy.get('[data-cy=preview-content] [data-cy="screen-field-submit"] button').click(); +function submitForm() { + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-submit"] button' + ).click(); } diff --git a/tests/e2e/specs/Pages.spec.js b/tests/e2e/specs/Pages.spec.js index 8be102dc8..dc3b75314 100644 --- a/tests/e2e/specs/Pages.spec.js +++ b/tests/e2e/specs/Pages.spec.js @@ -1,27 +1,33 @@ -describe('Pages and navigations', () => { - it('Basic default value', () => { - cy.visit('/'); +describe("Pages and navigations", () => { + it("Basic default value", () => { + cy.visit("/"); cy.openAllAcordeon(); - cy.get('[data-cy=toolbar-add]').click(); + cy.get("[data-cy=toolbar-add]").click(); // Define Page 2 - cy.get('[data-cy=add-page-name]').clear().type('Page 2'); - cy.get('[data-cy=add-page-modal] button.btn').eq(1).click(); - cy.get('[data-cy=controls-FormButton]:contains("Page")').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-label]').clear().type('Go to Page 1'); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.setMultiselect('[data-cy=inspector-eventData]', 'Default'); + cy.get("[data-cy=add-page-name]").clear().type("Page 2"); + cy.get("[data-cy=add-page-modal] button.btn").eq(1).click(); + cy.get('[data-cy=controls-FormButton]:contains("Page")').drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-label]").clear().type("Go to Page 1"); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.setMultiselect("[data-cy=inspector-eventData]", "Default"); // Define Page 1 - cy.get('[data-cy=toolbar-page]').select('0'); - cy.get('[data-cy=controls-FormButton]:contains("Page")').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-label]').clear().type('Go to Page 2'); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.setMultiselect('[data-cy=inspector-eventData]', 'Page 2'); + cy.get("[data-cy=toolbar-page]").select("0"); + cy.get('[data-cy=controls-FormButton]:contains("Page")').drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-label]").clear().type("Go to Page 2"); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.setMultiselect("[data-cy=inspector-eventData]", "Page 2"); // Preview - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content]').should('contain.text', 'Go to Page 2'); - cy.get('[data-cy=preview-content] button').click(); - cy.get('[data-cy=preview-content]').should('contain.text', 'Go to Page 1'); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content]").should("contain.text", "Go to Page 2"); + cy.get("[data-cy=preview-content] button").click(); + cy.get("[data-cy=preview-content]").should("contain.text", "Go to Page 1"); }); }); diff --git a/tests/e2e/specs/Pagination.spec.js b/tests/e2e/specs/Pagination.spec.js index 70282b119..2acf80322 100644 --- a/tests/e2e/specs/Pagination.spec.js +++ b/tests/e2e/specs/Pagination.spec.js @@ -1,96 +1,105 @@ const data = { form_record_list_1: [ - {'form_input_1': 'John'}, - {'form_input_1': 'Sarah'}, - {'form_input_1': 'Carl'}, - {'form_input_1': 'James'}, - {'form_input_1': 'Karen'}, - {'form_input_1': 'Kristen'}, - {'form_input_1': 'Lisa'}, - {'form_input_1': 'Jacky'}, - {'form_input_1': 'Rebecca'}, - {'form_input_1': 'Ariana'}, - {'form_input_1': 'Peter'}, - {'form_input_1': 'John'}, - {'form_input_1': 'Sarah'}, - {'form_input_1': 'Carl'}, - {'form_input_1': 'James'}, - {'form_input_1': 'Karen'}, - {'form_input_1': 'Kristen'}, - {'form_input_1': 'Lisa'}, - {'form_input_1': 'Jacky'}, - {'form_input_1': 'Rebecca'}, - {'form_input_1': 'Ariana'}, - {'form_input_1': 'Peter'}, - {'form_input_1': 'Peter'}, - {'form_input_1': 'Peter'}, - {'form_input_1': 'John'}, - {'form_input_1': 'Sarah'}, - {'form_input_1': 'Carl'}, - {'form_input_1': 'James'}, - {'form_input_1': 'Karen'}, - {'form_input_1': 'Kristen'}, - {'form_input_1': 'Lisa'}, - {'form_input_1': 'Jacky'}, - {'form_input_1': 'Rebecca'}, - {'form_input_1': 'Ariana'}, - {'form_input_1': 'Peter'}, - {'form_input_1': 'John'}, - {'form_input_1': 'Sarah'}, - {'form_input_1': 'Carl'}, - {'form_input_1': 'James'}, - {'form_input_1': 'Karen'}, - {'form_input_1': 'Kristen'}, - {'form_input_1': 'Lisa'}, - {'form_input_1': 'Jacky'}, - {'form_input_1': 'Rebecca'}, - {'form_input_1': 'Ariana'}, - {'form_input_1': 'Peter'}, - {'form_input_1': 'Peter'}, - {'form_input_1': 'Peter'}, - {'form_input_1': 'Peter'}, - {'form_input_1': 'Peter'}, - {'form_input_1': 'Peter'}, - ], + { form_input_1: "John" }, + { form_input_1: "Sarah" }, + { form_input_1: "Carl" }, + { form_input_1: "James" }, + { form_input_1: "Karen" }, + { form_input_1: "Kristen" }, + { form_input_1: "Lisa" }, + { form_input_1: "Jacky" }, + { form_input_1: "Rebecca" }, + { form_input_1: "Ariana" }, + { form_input_1: "Peter" }, + { form_input_1: "John" }, + { form_input_1: "Sarah" }, + { form_input_1: "Carl" }, + { form_input_1: "James" }, + { form_input_1: "Karen" }, + { form_input_1: "Kristen" }, + { form_input_1: "Lisa" }, + { form_input_1: "Jacky" }, + { form_input_1: "Rebecca" }, + { form_input_1: "Ariana" }, + { form_input_1: "Peter" }, + { form_input_1: "Peter" }, + { form_input_1: "Peter" }, + { form_input_1: "John" }, + { form_input_1: "Sarah" }, + { form_input_1: "Carl" }, + { form_input_1: "James" }, + { form_input_1: "Karen" }, + { form_input_1: "Kristen" }, + { form_input_1: "Lisa" }, + { form_input_1: "Jacky" }, + { form_input_1: "Rebecca" }, + { form_input_1: "Ariana" }, + { form_input_1: "Peter" }, + { form_input_1: "John" }, + { form_input_1: "Sarah" }, + { form_input_1: "Carl" }, + { form_input_1: "James" }, + { form_input_1: "Karen" }, + { form_input_1: "Kristen" }, + { form_input_1: "Lisa" }, + { form_input_1: "Jacky" }, + { form_input_1: "Rebecca" }, + { form_input_1: "Ariana" }, + { form_input_1: "Peter" }, + { form_input_1: "Peter" }, + { form_input_1: "Peter" }, + { form_input_1: "Peter" }, + { form_input_1: "Peter" }, + { form_input_1: "Peter" } + ] }; beforeEach(() => { - cy.visit('/'); + cy.visit("/"); cy.openAcordeon("collapse-2"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormRecordList]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=toolbar-add]').click({force: true}); - cy.get('[data-cy=add-page-name]').type('page2'); - cy.get('#addPageModal___BV_modal_footer_ > .btn-secondary').click(); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=toolbar-page]').select('0'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Configuration]').click(); - cy.get('.form-check-label').click(); - cy.get('div.multiselect').click(); - cy.get('.multiselect__element > .multiselect__option span:contains("page2")').click(); + cy.get("[data-cy=controls-FormRecordList]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=toolbar-add]").click({ force: true }); + cy.get("[data-cy=add-page-name]").type("page2"); + cy.get("#addPageModal___BV_modal_footer_ > .btn-secondary").click(); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=toolbar-page]").select("0"); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Configuration]").click(); + cy.get(".form-check-label").click(); + cy.get("div.multiselect").click(); + cy.get( + '.multiselect__element > .multiselect__option span:contains("page2")' + ).click(); cy.get('button:contains("Columns")').click(); - cy.get('.col-2 > .fas').click(); - cy.get('#option-content').type('Test Input'); - cy.get('#option-value').type('form_input_1'); - cy.get('.card-footer > .btn-secondary').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get(".col-2 > .fas").click(); + cy.get("#option-content").type("Test Input"); + cy.get("#option-value").type("form_input_1"); + cy.get(".card-footer > .btn-secondary").click(); + cy.get("[data-cy=mode-preview]").click(); }); -describe('Pagination', () => { - it('Should Not Be Visible', () => { - cy.setPreviewDataInput({form_record_list_1: [{'form_input_1': 'John'}]}); - cy.get('[data-cy=table-pagination]').should('not.be.visible'); +describe("Pagination", () => { + it("Should Not Be Visible", () => { + cy.setPreviewDataInput({ form_record_list_1: [{ form_input_1: "John" }] }); + cy.get("[data-cy=table-pagination]").should("not.exist"); }); - it('Should Be Visible', () => { + it("Should Be Visible", () => { cy.setPreviewDataInput(data); - cy.get('[data-cy=table-pagination]').scrollIntoView().should('be.visible'); + cy.get("[data-cy=table-pagination]").scrollIntoView().should("be.visible"); }); - it('Should Display Data When Navigating Pages', () => { + it("Should Display Data When Navigating Pages", () => { cy.setPreviewDataInput(data); - cy.get('[data-cy=table-pagination] button[aria-label="Go to last page"]').click(); - cy.get('[data-cy="table"] tbody').find('tr').should('have.length', '1'); + cy.get( + '[data-cy=table-pagination] button[aria-label="Go to last page"]' + ).click(); + cy.get('[data-cy="table"] tbody').find("tr").should("have.length", "1"); }); }); diff --git a/tests/e2e/specs/ParentAccessTests.spec.js b/tests/e2e/specs/ParentAccessTests.spec.js index 39f21a480..e7820703a 100644 --- a/tests/e2e/specs/ParentAccessTests.spec.js +++ b/tests/e2e/specs/ParentAccessTests.spec.js @@ -1,6 +1,5 @@ describe("Test access to _parent", () => { beforeEach(() => { - cy.server(); cy.visit("/"); }); diff --git a/tests/e2e/specs/ParentVariable.spec.js b/tests/e2e/specs/ParentVariable.spec.js index 65d2cc77b..c9dd8e57e 100644 --- a/tests/e2e/specs/ParentVariable.spec.js +++ b/tests/e2e/specs/ParentVariable.spec.js @@ -1,18 +1,21 @@ -describe('_parent variable', () => { +describe("_parent variable", () => { + beforeEach(() => {}); - beforeEach(() => { - cy.server(); - }); - - it('Test _parent in loop>nested', () => { - cy.visit('/'); - cy.loadFromJson('parent_variable.json', 1); - cy.get('[data-cy=mode-preview]').click(); + it("Test _parent in loop>nested", () => { + cy.visit("/"); + cy.loadFromJson("parent_variable.json", 1); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-select_padre"]').selectOption('aaaa'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-select_padre"]' + ).selectOption("aaaa"); - cy.get('[data-cy=preview-content] [data-cy="screen-field-select_hijo"]').selectOption('aaaa'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-input_hijo"]').clear().type('test'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-select_hijo"]' + ).selectOption("aaaa"); + cy.get('[data-cy=preview-content] [data-cy="screen-field-input_hijo"]') + .clear() + .type("test"); cy.assertPreviewData({ select_padre: [ @@ -31,16 +34,24 @@ describe('_parent variable', () => { }); }); - it('Test _parent in record list', () => { - cy.visit('/'); - cy.loadFromJson('parent_variable.json', 1); - cy.get('[data-cy=mode-preview]').click(); + it("Test _parent in record list", () => { + cy.visit("/"); + cy.loadFromJson("parent_variable.json", 1); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-select_padre"]').selectOption('aaaa'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-select_padre"]' + ).selectOption("aaaa"); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-form_select_list_1"]').selectOption('aaaa'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-form_select_list_1"]' + ).selectOption("aaaa"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); cy.assertPreviewData({ select_padre: [ diff --git a/tests/e2e/specs/RAOS1.0.0AccountOpeningCustomerForm.spec.js b/tests/e2e/specs/RAOS1.0.0AccountOpeningCustomerForm.spec.js index faa5eb922..3c9c3cc02 100644 --- a/tests/e2e/specs/RAOS1.0.0AccountOpeningCustomerForm.spec.js +++ b/tests/e2e/specs/RAOS1.0.0AccountOpeningCustomerForm.spec.js @@ -1,6 +1,5 @@ describe("RAOS 1.0.0 Account Opening Customer Form", () => { beforeEach(() => { - cy.server(); cy.visit("/"); }); diff --git a/tests/e2e/specs/RecordList.spec.js b/tests/e2e/specs/RecordList.spec.js index 97a812f2a..26edb38b9 100644 --- a/tests/e2e/specs/RecordList.spec.js +++ b/tests/e2e/specs/RecordList.spec.js @@ -1,589 +1,1015 @@ -import moment from 'moment'; - -describe('Record list', () => { +import moment from "moment"; +describe("Record list", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); cy.showValidationOnLoad(); - cy.window().then(win => { + cy.window().then((win) => { // Add request-id header - const requestIdMeta = window.document.createElement('meta'); - requestIdMeta.setAttribute('name', 'request-id'); - requestIdMeta.setAttribute('content', '1'); + const requestIdMeta = window.document.createElement("meta"); + requestIdMeta.setAttribute("name", "request-id"); + requestIdMeta.setAttribute("content", "1"); win.document.head.appendChild(requestIdMeta); }); }); - it('Invalid default values', () => { - cy.loadFromJson('record_list_invalid.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=firstname]').type('Patricia'); - cy.get('[data-cy=preview-content] [name=lastname]').type('Smith'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=fullname]').type('{home}Miss '); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=fullname]').should('have.value', 'Miss Patricia Smith'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=date]').parent() - .should('contain.text', 'Must be a valid Date'); + it("Invalid default values", () => { + cy.loadFromJson("record_list_invalid.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=firstname]").type("Patricia"); + cy.get("[data-cy=preview-content] [name=lastname]").type("Smith"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=fullname]" + ).type("{home}Miss "); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=fullname]" + ).should("have.value", "Miss Patricia Smith"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=date]" + ) + .parent() + .should("contain.text", "Must be a valid Date"); }); - it('Add row with default values', () => { - cy.loadFromJson('record_list.json', 0); - cy.get('[data-cy=mode-preview]').click(); - const today = new Date().toISOString().substr(0,10); - cy.get('[data-cy=preview-content] [name=firstname]').type('Patricia'); - cy.get('[data-cy=preview-content] [name=lastname]').type('Smith'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=fullname]').type('{home}Miss '); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); - cy.get('#screen-builder-container').then((div) => { + it("Add row with default values", () => { + cy.loadFromJson("record_list.json", 0); + cy.get("[data-cy=mode-preview]").click(); + const today = new Date().toISOString().substr(0, 10); + cy.get("[data-cy=preview-content] [name=firstname]").type("Patricia"); + cy.get("[data-cy=preview-content] [name=lastname]").type("Smith"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=fullname]" + ).type("{home}Miss "); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); + cy.get("#screen-builder-container").then((div) => { const data = div[0].__vue__.previewData; const record_row_id = data.form_record_list_1[0].row_id; expect(data).to.eql({ - 'firstname': 'Patricia', - 'lastname': 'Smith', - 'form_record_list_1': [ + firstname: "Patricia", + lastname: "Smith", + form_record_list_1: [ { - 'fullname': 'Miss Patricia Smith', - 'date': today, - 'row_id': record_row_id, - }, - ], + fullname: "Miss Patricia Smith", + date: today, + row_id: record_row_id + } + ] }); }); }); - it('Recordlist pagination when deleting items should go to previous page if no records in current page', () => { - cy.loadFromJson('record_list_single_input.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Recordlist pagination when deleting items should go to previous page if no records in current page", () => { + cy.loadFromJson("record_list_single_input.json", 0); + cy.get("[data-cy=mode-preview]").click(); - //Add 7 rows + // Add 7 rows for (let i = 1; i <= 7; i++) { - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]').type(i); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]" + ).type(i); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); } - //Go to pagination page 2 - cy.get(':nth-child(4) > .page-link').click(); + // Go to pagination page 2 + cy.get(":nth-child(4) > .page-link").click(); - //Delete record 7 - cy.get('[aria-rowindex="7"] > .text-right > .actions > .btn-group > [data-cy=remove-row]').click(); + // Delete record 7 + cy.get( + '[aria-rowindex="7"] > .text-right > .actions > .btn-group > [data-cy=remove-row]' + ).click(); cy.get("[data-cy='modal-remove'] button.btn.btn-primary").click(); - cy.get('.table-column') - .should('contain.text', '6'); + cy.get(".table-column").should("contain.text", "6"); - cy.get('[data-cy=table-pagination]') - .should('be.visible'); + cy.get("[data-cy=table-pagination]").should("be.visible"); - //Delete record 6 - cy.get('[data-cy=remove-row]').click(); + // Delete record 6 + cy.get("[data-cy=remove-row]").click(); cy.get("[data-cy='modal-remove'] button.btn.btn-primary").click(); - //Assert we see page 1 - cy.get('[data-cy=table-pagination]') - .should('be.not.visible'); + // Assert we see page 1 + cy.get("[data-cy=table-pagination]").should("not.exist"); for (let i = 1; i <= 5; i++) { - cy.get('[aria-rowindex="'+i+'"] > .table-column') - .should('contain.text', i); + cy.get(`[aria-rowindex="${i}"] > .table-column`).should( + "contain.text", + i + ); } }); - it('FileUpload in record lists', () => { - cy.loadFromJson('record_list_fileupload.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); + it("FileUpload in record lists", () => { + cy.loadFromJson("record_list_fileupload.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); // Upload first file - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file1"] input[type=file]', 'avatar.jpeg', 'image/jpg'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file1"] input[type=file]', + "avatar.jpeg", + "image/jpg" + ); // Upload second file - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 2, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file2"] input[type=file]', 'record_list_fileupload.json', 'application/json'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)').click(); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 2 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file2"] input[type=file]', + "record_list_fileupload.json", + "application/json" + ); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)" + ).click(); // Check the file is rendered in the record list - cy.get('[data-cy=preview-content] table tbody tr td').should('contain.text', '1'); - cy.get('[data-cy=preview-content] table tbody tr td').should('contain.text', '2'); + cy.get("[data-cy=preview-content] table tbody tr td").should( + "contain.text", + "1" + ); + cy.get("[data-cy=preview-content] table tbody tr td").should( + "contain.text", + "2" + ); // Edit record and check the uploaded files are displayed - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file1"]').should('contain.text', 'avatar.jpeg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file2"]').should('contain.text', 'record_list_fileupload.json'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Cancel)').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file1"]' + ).should("contain.text", "avatar.jpeg"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file2"]' + ).should("contain.text", "record_list_fileupload.json"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Cancel)" + ).click(); // Verify the data structure - cy.get('#screen-builder-container').then((div) => { + cy.get("#screen-builder-container").then((div) => { const data = div[0].__vue__.previewData; const record_row_id = data.form_record_list_1[0].row_id; expect(data).to.eql({ - 'form_record_list_1': [ + form_record_list_1: [ { - 'file1': 1, - 'file2': 2, - 'row_id': record_row_id, - }, - ], + file1: 1, + file2: 2, + row_id: record_row_id + } + ] }); }); }); - it('Required FileUpload in record lists', () => { - cy.loadFromJson('record_list_fileupload_required.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); + it("Required FileUpload in record lists", () => { + cy.loadFromJson("record_list_fileupload_required.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); // Upload first file - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file1"] input[type=file]', 'avatar.jpeg', 'image/jpg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file2"]').should('contain.text', 'required'); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file1"] input[type=file]', + "avatar.jpeg", + "image/jpg" + ); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)" + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file2"]' + ).should("contain.text", "required"); // Upload second file - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 2, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file2"] input[type=file]', 'record_list_fileupload_required.json', 'application/json'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)').click(); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 2 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file2"] input[type=file]', + "record_list_fileupload_required.json", + "application/json" + ); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)" + ).click(); // Check the file is rendered in the record list - cy.get('[data-cy=preview-content] table tbody tr td').should('contain.text', '1'); - cy.get('[data-cy=preview-content] table tbody tr td').should('contain.text', '2'); + cy.get("[data-cy=preview-content] table tbody tr td").should( + "contain.text", + "1" + ); + cy.get("[data-cy=preview-content] table tbody tr td").should( + "contain.text", + "2" + ); // Edit record and check the uploaded files are displayed - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file1"]').should('contain.text', 'avatar.jpeg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file2"]').should('contain.text', 'record_list_fileupload_required.json'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Cancel)').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file1"]' + ).should("contain.text", "avatar.jpeg"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file2"]' + ).should("contain.text", "record_list_fileupload_required.json"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Cancel)" + ).click(); // Verify the data structure - cy.get('#screen-builder-container').then((div) => { + cy.get("#screen-builder-container").then((div) => { const data = div[0].__vue__.previewData; const record_row_id = data.form_record_list_1[0].row_id; expect(data).to.eql({ - 'form_record_list_1': [ + form_record_list_1: [ { - 'file1': 1, - 'file2': 2, - 'row_id': record_row_id, - }, - ], + file1: 1, + file2: 2, + row_id: record_row_id + } + ] }); }); }); - it('Check editing the correct record in recordlist after sorting', () => { - cy.loadFromJson('record_list_single_input.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Check editing the correct record in recordlist after sorting", () => { + cy.loadFromJson("record_list_single_input.json", 0); + cy.get("[data-cy=mode-preview]").click(); - let data = ['B', 'C', 'A', 'E', 'D', 'G', 'F']; + const data = ["B", "C", "A", "E", "D", "G", "F"]; - //Add 7 rows + // Add 7 rows for (let i = 0; i < 7; i++) { - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]').type(data[i]); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]" + ).type(data[i]); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); } - //Sort data - cy.get('.b-table-sort-icon-left').click(); + // Sort data + cy.get(".b-table-sort-icon-left").click(); // Select and edit "B" to "BBB" - cy.get('[aria-rowindex="2"] > .text-right > .actions > .btn-group > [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]'); - //Check after sort the field has B - cy.should('have.value', 'B'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]').type('BB'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary').click(); - //Check the data is correct after edit - cy.get('[aria-rowindex="1"] > .table-column').should('contain.text', 'A'); - cy.get('[aria-rowindex="2"] > .table-column').should('contain.text', 'BBB'); - cy.get('[aria-rowindex="3"] > .table-column').should('contain.text', 'C'); - cy.get('[aria-rowindex="4"] > .table-column').should('contain.text', 'D'); - cy.get('[aria-rowindex="5"] > .table-column').should('contain.text', 'E'); + cy.get( + '[aria-rowindex="2"] > .text-right > .actions > .btn-group > [data-cy=edit-row]' + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]" + ); + // Check after sort the field has B + cy.should("have.value", "B"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]" + ).type("BB"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary" + ).click(); + // Check the data is correct after edit + cy.get('[aria-rowindex="1"] > .table-column').should("contain.text", "A"); + cy.get('[aria-rowindex="2"] > .table-column').should("contain.text", "BBB"); + cy.get('[aria-rowindex="3"] > .table-column').should("contain.text", "C"); + cy.get('[aria-rowindex="4"] > .table-column').should("contain.text", "D"); + cy.get('[aria-rowindex="5"] > .table-column').should("contain.text", "E"); // Go to pagination page 2 - cy.get(':nth-child(4) > .page-link').click(); - cy.get('[aria-rowindex="6"] > .table-column').should('contain.text', 'F'); - cy.get('[aria-rowindex="7"] > .table-column').should('contain.text', 'G'); - - //Sort data - cy.get('.b-table-sort-icon-left').click(); - //Check last row A has the correct value "A" in the modal - cy.get('[aria-rowindex="7"] > .text-right > .actions > .btn-group > [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]').should('have.value', 'A'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary').click(); + cy.get(":nth-child(4) > .page-link").click(); + cy.get('[aria-rowindex="6"] > .table-column').should("contain.text", "F"); + cy.get('[aria-rowindex="7"] > .table-column').should("contain.text", "G"); + + // Sort data + cy.get(".b-table-sort-icon-left").click(); + // Check last row A has the correct value "A" in the modal + cy.get( + '[aria-rowindex="7"] > .text-right > .actions > .btn-group > [data-cy=edit-row]' + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]" + ).should("have.value", "A"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary" + ).click(); // Go to pagination page 1 - cy.get(':nth-child(3) > .page-link').click(); - //Sort data - cy.get('.b-table-sort-icon-left').click(); - //Get record "D" and replace to "Z" - cy.get('[aria-rowindex="4"] > .text-right > .actions > .btn-group > [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]').should('have.value', 'D').clear().type('Z'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary').click(); - - //Check the data is correct after edit - cy.get('[aria-rowindex="1"] > .table-column').should('contain.text', 'A'); - cy.get('[aria-rowindex="2"] > .table-column').should('contain.text', 'BBB'); - cy.get('[aria-rowindex="3"] > .table-column').should('contain.text', 'C'); - cy.get('[aria-rowindex="4"] > .table-column').should('contain.text', 'E'); - cy.get('[aria-rowindex="5"] > .table-column').should('contain.text', 'F'); + cy.get(":nth-child(3) > .page-link").click(); + // Sort data + cy.get(".b-table-sort-icon-left").click(); + // Get record "D" and replace to "Z" + cy.get( + '[aria-rowindex="4"] > .text-right > .actions > .btn-group > [data-cy=edit-row]' + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]" + ) + .should("have.value", "D") + .clear() + .type("Z"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary" + ).click(); + + // Check the data is correct after edit + cy.get('[aria-rowindex="1"] > .table-column').should("contain.text", "A"); + cy.get('[aria-rowindex="2"] > .table-column').should("contain.text", "BBB"); + cy.get('[aria-rowindex="3"] > .table-column').should("contain.text", "C"); + cy.get('[aria-rowindex="4"] > .table-column').should("contain.text", "E"); + cy.get('[aria-rowindex="5"] > .table-column').should("contain.text", "F"); }); - it('Check deleting the correct record in recordlist after sorting', () => { - cy.loadFromJson('record_list_single_input.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Check deleting the correct record in recordlist after sorting", () => { + cy.loadFromJson("record_list_single_input.json", 0); + cy.get("[data-cy=mode-preview]").click(); - let data = ['B', 'C', 'A', 'E', 'D', 'G', 'F']; + const data = ["B", "C", "A", "E", "D", "G", "F"]; - //Add 7 rows + // Add 7 rows for (let i = 0; i < 7; i++) { - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]').type(data[i]); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]" + ).type(data[i]); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); } - //Sort data - cy.get('.b-table-sort-icon-left').click(); + // Sort data + cy.get(".b-table-sort-icon-left").click(); // Go to pagination page 2 - cy.get(':nth-child(4) > .page-link').click(); + cy.get(":nth-child(4) > .page-link").click(); // Delete H - cy.get('[aria-rowindex="6"] > .text-right > .actions > .btn-group > [data-cy=remove-row]').click(); - cy.get('[data-cy=modal-remove] .btn-primary').click(); - - //Check after Delete it was deleted the correct row and other data are in table - cy.get('.table-column').should('contain.text', 'G'); - cy.get(':nth-child(3) > .page-link').click(); - cy.get('[aria-rowindex="1"] > .table-column').should('contain.text', 'A'); - cy.get('[aria-rowindex="2"] > .table-column').should('contain.text', 'B'); - cy.get('[aria-rowindex="3"] > .table-column').should('contain.text', 'C'); - cy.get('[aria-rowindex="4"] > .table-column').should('contain.text', 'D'); - cy.get('[aria-rowindex="5"] > .table-column').should('contain.text', 'E'); - - //Sort data - cy.get('.b-table-sort-icon-left').click(); + cy.get( + '[aria-rowindex="6"] > .text-right > .actions > .btn-group > [data-cy=remove-row]' + ).click(); + cy.get("[data-cy=modal-remove] .btn-primary").click(); + + // Check after Delete it was deleted the correct row and other data are in table + cy.get(".table-column").should("contain.text", "G"); + cy.get(":nth-child(3) > .page-link").click(); + cy.get('[aria-rowindex="1"] > .table-column').should("contain.text", "A"); + cy.get('[aria-rowindex="2"] > .table-column').should("contain.text", "B"); + cy.get('[aria-rowindex="3"] > .table-column').should("contain.text", "C"); + cy.get('[aria-rowindex="4"] > .table-column').should("contain.text", "D"); + cy.get('[aria-rowindex="5"] > .table-column').should("contain.text", "E"); + + // Sort data + cy.get(".b-table-sort-icon-left").click(); // Delete B - cy.get('[aria-rowindex="5"] > .text-right > .actions > .btn-group > [data-cy=remove-row]').click(); - cy.get('[data-cy=modal-remove] .btn-primary').click(); - - //Check after Delete B, it was deleted the correct row and other data are in table - cy.get('[aria-rowindex="1"] > .table-column').should('contain.text', 'G'); - cy.get('[aria-rowindex="2"] > .table-column').should('contain.text', 'E'); - cy.get('[aria-rowindex="3"] > .table-column').should('contain.text', 'D'); - cy.get('[aria-rowindex="4"] > .table-column').should('contain.text', 'C'); - cy.get('[aria-rowindex="5"] > .table-column').should('contain.text', 'A'); + cy.get( + '[aria-rowindex="5"] > .text-right > .actions > .btn-group > [data-cy=remove-row]' + ).click(); + cy.get("[data-cy=modal-remove] .btn-primary").click(); + + // Check after Delete B, it was deleted the correct row and other data are in table + cy.get('[aria-rowindex="1"] > .table-column').should("contain.text", "G"); + cy.get('[aria-rowindex="2"] > .table-column').should("contain.text", "E"); + cy.get('[aria-rowindex="3"] > .table-column').should("contain.text", "D"); + cy.get('[aria-rowindex="4"] > .table-column').should("contain.text", "C"); + cy.get('[aria-rowindex="5"] > .table-column').should("contain.text", "A"); }); - it('Check editing after remove all records from second page', () => { - cy.loadFromJson('record_list_single_input.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Check editing after remove all records from second page", () => { + cy.loadFromJson("record_list_single_input.json", 0); + cy.get("[data-cy=mode-preview]").click(); - let data = ['A', 'B', 'C', 'D', 'E', 'F']; + const data = ["A", "B", "C", "D", "E", "F"]; - //Add 7 rows + // Add 7 rows for (let i = 0; i < 6; i++) { - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]').type(data[i]); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]" + ).type(data[i]); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); } // Go to pagination page 2 - cy.get(':nth-child(4) > .page-link').click(); + cy.get(":nth-child(4) > .page-link").click(); // Delete F - cy.get('[data-cy=remove-row]').click(); - cy.get('[data-cy=modal-remove] .btn-primary').click(); - - //Get record "B" and replace to "BB" - cy.get('[aria-rowindex="2"] > .text-right > .actions > .btn-group > [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]').should('have.value', 'B').type('B'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary').click(); - - //Check the data is correct after edit - cy.get('[aria-rowindex="1"] > .table-column').should('contain.text', 'A'); - cy.get('[aria-rowindex="2"] > .table-column').should('contain.text', 'BB'); - cy.get('[aria-rowindex="3"] > .table-column').should('contain.text', 'C'); - cy.get('[aria-rowindex="4"] > .table-column').should('contain.text', 'D'); - cy.get('[aria-rowindex="5"] > .table-column').should('contain.text', 'E'); + cy.get("[data-cy=remove-row]").click(); + cy.get("[data-cy=modal-remove] .btn-primary").click(); + + // Get record "B" and replace to "BB" + cy.get( + '[aria-rowindex="2"] > .text-right > .actions > .btn-group > [data-cy=edit-row]' + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]" + ) + .should("have.value", "B") + .type("B"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary" + ).click(); + + // Check the data is correct after edit + cy.get('[aria-rowindex="1"] > .table-column').should("contain.text", "A"); + cy.get('[aria-rowindex="2"] > .table-column').should("contain.text", "BB"); + cy.get('[aria-rowindex="3"] > .table-column').should("contain.text", "C"); + cy.get('[aria-rowindex="4"] > .table-column').should("contain.text", "D"); + cy.get('[aria-rowindex="5"] > .table-column').should("contain.text", "E"); }); - it('FileUpload in record lists within loops', () => { - cy.loadFromJson('record_list_fileupload_loops.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); + it("FileUpload in record lists within loops", () => { + cy.loadFromJson("record_list_fileupload_loops.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); // Upload the first file. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_4]').eq(0).clear().type('First'); - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"] input[type=file]', 'avatar.jpeg', 'image/jpg'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_4]" + ) + .eq(0) + .clear() + .type("First"); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"] input[type=file]', + "avatar.jpeg", + "image/jpg" + ); // Upload a second file. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy=loop-loop_1-add]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_4]').eq(1).clear().type('Second'); - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 2, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"] input[type=file]', 'avatar.jpeg', 'image/jpg', 1); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy=loop-loop_1-add]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_4]" + ) + .eq(1) + .clear() + .type("Second"); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 2 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"] input[type=file]', + "avatar.jpeg", + "image/jpg", + 1 + ); cy.wait(1000); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"]').eq(0).should('contain.text', 'avatar.jpeg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"]').eq(1).should('contain.text', 'avatar.jpeg'); - - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)').click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"]' + ) + .eq(0) + .should("contain.text", "avatar.jpeg"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"]' + ) + .eq(1) + .should("contain.text", "avatar.jpeg"); + + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)" + ).click(); // Edit record and check the uploaded files are displayed. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]').eq(0).should('contain.text', 'avatar.jpeg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]').eq(1).should('contain.text', 'avatar.jpeg'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]' + ) + .eq(0) + .should("contain.text", "avatar.jpeg"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]' + ) + .eq(1) + .should("contain.text", "avatar.jpeg"); // Add a third file in edit modal. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=loop-loop_1-add]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=form_input_4]').eq(2).clear().type('Third'); - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 3, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"] input[type=file]', 'avatar.jpeg', 'image/jpg', 2); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=loop-loop_1-add]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=form_input_4]" + ) + .eq(2) + .clear() + .type("Third"); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 3 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"] input[type=file]', + "avatar.jpeg", + "image/jpg", + 2 + ); cy.wait(1000); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]').eq(2).should('contain.text', 'avatar.jpeg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)').click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]' + ) + .eq(2) + .should("contain.text", "avatar.jpeg"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)" + ).click(); // Delete third file in edit modal. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=loop-loop_1-remove]').click(); - cy.on('window:confirm', () => true); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=loop-loop_1-remove]" + ).click(); + cy.on("window:confirm", () => true); cy.wait(500); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)" + ).click(); // Verify the data structure. - cy.get('#screen-builder-container').then((div) => { + cy.get("#screen-builder-container").then((div) => { const data = div[0].__vue__.previewData; const record_row_id = data.form_record_list_1[0].row_id; expect(data).to.eql({ - 'form_record_list_1': [ + form_record_list_1: [ { - 'loop_1': [ + loop_1: [ { - 'form_input_4': 'First', - 'file_upload_2': 1, + form_input_4: "First", + file_upload_2: 1 }, { - 'form_input_4': 'Second', - 'file_upload_2': 2, - }, + form_input_4: "Second", + file_upload_2: 2 + } ], - 'row_id': record_row_id, - }, - ], - 'loop_1': [ - {}, + row_id: record_row_id + } ], + loop_1: [{}] }); }); }); - it.skip('Check deleting the correct record in recordlist with empty after sorting', () => { - cy.loadFromJson('record_list_date_input.json', 0); - cy.get('[data-cy=mode-preview]').click(); - - let data = [ - { 'date': moment('01/02/2022').format('MM/DD/YYYY'), 'name': 'B' }, - { 'date': moment('01/03/2022').format('MM/DD/YYYY'), 'name': 'C' }, - { 'date': moment('01/01/2022').format('MM/DD/YYYY'), 'name': 'A' }, - { 'date': moment('01/05/2022').format('MM/DD/YYYY'), 'name': 'E' }, - { 'date': moment('01/04/2022').format('MM/DD/YYYY'), 'name': 'D' }, - { 'date': moment('01/06/2022').format('MM/DD/YYYY'), 'name': 'G' }, - { 'date': '', 'name': '' }, - { 'date': '', 'name': 'F' }, - { 'date': '', 'name': 'H'}, + it("Check deleting the correct record in recordlist with empty after sorting", () => { + cy.loadFromJson("record_list_date_input.json", 0); + cy.get("[data-cy=mode-preview]").click(); + + const data = [ + { date: moment("01/02/2022").format("MM/DD/YYYY"), name: "B" }, + { date: moment("01/03/2022").format("MM/DD/YYYY"), name: "C" }, + { date: moment("01/01/2022").format("MM/DD/YYYY"), name: "A" }, + { date: moment("01/05/2022").format("MM/DD/YYYY"), name: "E" }, + { date: moment("01/04/2022").format("MM/DD/YYYY"), name: "D" }, + { date: moment("01/06/2022").format("MM/DD/YYYY"), name: "G" }, + { date: "", name: "" }, + { date: "", name: "F" }, + { date: "", name: "H" } ]; - //Add data + // Add data for (let i = 0; i < 9; i++) { - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - if (data[i]['date'] !== '') { - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-date"] input').click().type(data[i]['date']); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + if (data[i].date !== "") { + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-date"] input' + ) + .click() + .type(data[i].date); } - if (data[i]['name'] !== '') { - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]').type(data[i]['name']); + if (data[i].name !== "") { + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]" + ).type(data[i].name); } - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); } - //Sort data + // Sort data cy.get('[aria-colindex="1"] > div').click(); // Go to pagination page 2 - cy.get(':nth-child(4) > .page-link').click(); + cy.get(":nth-child(4) > .page-link").click(); // Delete G - cy.get('[aria-rowindex="6"] > .text-right > .actions > .btn-group > [data-cy=remove-row]').click(); - cy.get('[data-cy=modal-remove] .btn-primary').click(); + cy.get( + '[aria-rowindex="6"] > .text-right > .actions > .btn-group > [data-cy=remove-row]' + ).click(); + cy.get("[data-cy=modal-remove] .btn-primary").click(); - //Sort data + // Sort data cy.get('[aria-colindex="1"] > div').click(); // Delete B - cy.get('[aria-rowindex="7"] > .text-right > .actions > .btn-group > [data-cy=remove-row]').click(); - cy.get('[data-cy=modal-remove] .btn-primary').click(); + cy.get( + '[aria-rowindex="7"] > .text-right > .actions > .btn-group > [data-cy=remove-row]' + ).click(); + cy.get("[data-cy=modal-remove] .btn-primary").click(); // Go to pagination page 1 - cy.get(':nth-child(3) > .page-link').click(); + cy.get(":nth-child(3) > .page-link").click(); // Delete Empty - cy.get('[aria-rowindex="1"] > .text-right > .actions > .btn-group > [data-cy=remove-row]').click(); - cy.get('[data-cy=modal-remove] .btn-primary').click(); + cy.get( + '[aria-rowindex="1"] > .text-right > .actions > .btn-group > [data-cy=remove-row]' + ).click(); + cy.get("[data-cy=modal-remove] .btn-primary").click(); // Delete H - cy.get('[aria-rowindex="2"] > .text-right > .actions > .btn-group > [data-cy=remove-row]').click(); - cy.get('[data-cy=modal-remove] .btn-primary').click(); + cy.get( + '[aria-rowindex="2"] > .text-right > .actions > .btn-group > [data-cy=remove-row]' + ).click(); + cy.get("[data-cy=modal-remove] .btn-primary").click(); - //Sort data + // Sort data cy.get('[aria-colindex="1"] > div').click(); - //Check after Delete it was deleted the correct row and other data are in table - cy.get('[aria-rowindex="1"] > [aria-colindex="1"]').should('contain.text', '01/01/2022'); - cy.get('[aria-rowindex="2"] > [aria-colindex="1"]').should('contain.text', '01/03/2022'); - cy.get('[aria-rowindex="3"] > [aria-colindex="1"]').should('contain.text', '01/04/2022'); - cy.get('[aria-rowindex="4"] > [aria-colindex="1"]').should('contain.text', '01/05/2022'); - cy.get('[aria-rowindex="5"] > [aria-colindex="1"]').should('contain.text', ''); - - cy.get('[aria-rowindex="1"] > [aria-colindex="2"]').should('contain.text', 'A'); - cy.get('[aria-rowindex="2"] > [aria-colindex="2"]').should('contain.text', 'C'); - cy.get('[aria-rowindex="3"] > [aria-colindex="2"]').should('contain.text', 'D'); - cy.get('[aria-rowindex="4"] > [aria-colindex="2"]').should('contain.text', 'E'); - cy.get('[aria-rowindex="5"] > [aria-colindex="2"]').should('contain.text', 'F'); + // Check after Delete it was deleted the correct row and other data are in table + cy.get('[aria-rowindex="1"] > [aria-colindex="1"]').should( + "contain.text", + "01/01/2022" + ); + cy.get('[aria-rowindex="2"] > [aria-colindex="1"]').should( + "contain.text", + "01/03/2022" + ); + cy.get('[aria-rowindex="3"] > [aria-colindex="1"]').should( + "contain.text", + "01/04/2022" + ); + cy.get('[aria-rowindex="4"] > [aria-colindex="1"]').should( + "contain.text", + "01/05/2022" + ); + cy.get('[aria-rowindex="5"] > [aria-colindex="1"]').should( + "contain.text", + "" + ); + + cy.get('[aria-rowindex="1"] > [aria-colindex="2"]').should( + "contain.text", + "A" + ); + cy.get('[aria-rowindex="2"] > [aria-colindex="2"]').should( + "contain.text", + "C" + ); + cy.get('[aria-rowindex="3"] > [aria-colindex="2"]').should( + "contain.text", + "D" + ); + cy.get('[aria-rowindex="4"] > [aria-colindex="2"]').should( + "contain.text", + "E" + ); + cy.get('[aria-rowindex="5"] > [aria-colindex="2"]').should( + "contain.text", + "F" + ); }); - it.skip('Check editing records with empty from second page', () => { - cy.loadFromJson('record_list_date_input.json', 0); - cy.get('[data-cy=mode-preview]').click(); - - let data = [ - { 'date': moment('01/02/2022').format('MM/DD/YYYY'), 'name': 'B' }, - { 'date': moment('01/03/2022').format('MM/DD/YYYY'), 'name': 'C' }, - { 'date': moment('01/01/2022').format('MM/DD/YYYY'), 'name': 'A' }, - { 'date': moment('01/05/2022').format('MM/DD/YYYY'), 'name': 'E' }, - { 'date': moment('01/04/2022').format('MM/DD/YYYY'), 'name': 'D' }, - { 'date': moment('01/06/2022').format('MM/DD/YYYY'), 'name': 'G' }, - { 'date': '', 'name': '' }, - { 'date': '', 'name': 'F' }, - { 'date': '', 'name': 'H'}, + it("Check editing records with empty from second page", () => { + cy.loadFromJson("record_list_date_input.json", 0); + cy.get("[data-cy=mode-preview]").click(); + + const data = [ + { date: moment("01/02/2022").format("MM/DD/YYYY"), name: "B" }, + { date: moment("01/03/2022").format("MM/DD/YYYY"), name: "C" }, + { date: moment("01/01/2022").format("MM/DD/YYYY"), name: "A" }, + { date: moment("01/05/2022").format("MM/DD/YYYY"), name: "E" }, + { date: moment("01/04/2022").format("MM/DD/YYYY"), name: "D" }, + { date: moment("01/06/2022").format("MM/DD/YYYY"), name: "G" }, + { date: "", name: "" }, + { date: "", name: "F" }, + { date: "", name: "H" } ]; - //Add data + // Add data for (let i = 0; i < 9; i++) { - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - if (data[i]['date'] !== '') { - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-date"] input').click().type(data[i]['date']); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + if (data[i].date !== "") { + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-date"] input' + ) + .click() + .type(data[i].date); } - if (data[i]['name'] !== '') { - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]').type(data[i]['name']); + if (data[i].name !== "") { + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=name]" + ).type(data[i].name); } - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); } - //Sort data + // Sort data cy.get('[aria-colindex="1"] > div').click(); // Go to pagination page 2 - cy.get(':nth-child(4) > .page-link').click(); - - //Get record "G" and replace to "GG" and date 01/06/2022 to 06/06/2022 - cy.get('[aria-rowindex="6"] > .text-right > .actions > .btn-group > [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=screen-field-date] input').should('have.value', '01/06/2022').clear().type('06/06/2022'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]').should('have.value', 'G').type('G'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary').click(); - - //Get record empty "" and replace to "New value" and date 01/10/2022 - cy.get('[aria-rowindex="7"] > .text-right > .actions > .btn-group > [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=screen-field-date] input').should('have.value', '').type('01/10/2022'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]').should('have.value', '').type('New value'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary').click(); - - //Check after edit values are correct - cy.get('[aria-rowindex="6"] > [aria-colindex="1"]').should('contain.text', '01/10/2022'); - cy.get('[aria-rowindex="7"] > [aria-colindex="1"]').should('contain.text', '06/06/2022'); - cy.get('[aria-rowindex="8"] > [aria-colindex="1"]').should('contain.text', ''); - cy.get('[aria-rowindex="9"] > [aria-colindex="1"]').should('contain.text', ''); - - cy.get('[aria-rowindex="6"] > [aria-colindex="2"]').should('contain.text', 'New value'); - cy.get('[aria-rowindex="7"] > [aria-colindex="2"]').should('contain.text', 'GG'); - cy.get('[aria-rowindex="8"] > [aria-colindex="2"]').should('contain.text', 'F'); - cy.get('[aria-rowindex="9"] > [aria-colindex="2"]').should('contain.text', 'H'); + cy.get(":nth-child(4) > .page-link").click(); + + // Get record "G" and replace to "GG" and date 01/06/2022 to 06/06/2022 + cy.get( + '[aria-rowindex="6"] > .text-right > .actions > .btn-group > [data-cy=edit-row]' + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=screen-field-date] input" + ) + .should("have.value", "01/06/2022") + .clear() + .type("06/06/2022"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]" + ) + .should("have.value", "G") + .type("G"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary" + ).click(); + + // Get record empty "" and replace to "New value" and date 01/10/2022 + cy.get( + '[aria-rowindex="7"] > .text-right > .actions > .btn-group > [data-cy=edit-row]' + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=screen-field-date] input" + ) + .should("have.value", "") + .type("01/10/2022"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]" + ) + .should("have.value", "") + .type("New value"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary" + ).click(); + + // Check after edit values are correct + cy.get('[aria-rowindex="6"] > [aria-colindex="1"]').should( + "contain.text", + "01/10/2022" + ); + cy.get('[aria-rowindex="7"] > [aria-colindex="1"]').should( + "contain.text", + "06/06/2022" + ); + cy.get('[aria-rowindex="8"] > [aria-colindex="1"]').should( + "contain.text", + "" + ); + cy.get('[aria-rowindex="9"] > [aria-colindex="1"]').should( + "contain.text", + "" + ); + + cy.get('[aria-rowindex="6"] > [aria-colindex="2"]').should( + "contain.text", + "New value" + ); + cy.get('[aria-rowindex="7"] > [aria-colindex="2"]').should( + "contain.text", + "GG" + ); + cy.get('[aria-rowindex="8"] > [aria-colindex="2"]').should( + "contain.text", + "F" + ); + cy.get('[aria-rowindex="9"] > [aria-colindex="2"]').should( + "contain.text", + "H" + ); // Go to pagination page 1 - cy.get(':nth-child(3) > .page-link').click(); - - //Check after edit values are correct - cy.get('[aria-rowindex="1"] > [aria-colindex="1"]').should('contain.text', '01/01/2022'); - cy.get('[aria-rowindex="2"] > [aria-colindex="1"]').should('contain.text', '01/02/2022'); - cy.get('[aria-rowindex="3"] > [aria-colindex="1"]').should('contain.text', '01/03/2022'); - cy.get('[aria-rowindex="4"] > [aria-colindex="1"]').should('contain.text', '01/04/2022'); - cy.get('[aria-rowindex="5"] > [aria-colindex="1"]').should('contain.text', '01/05/2022'); - - cy.get('[aria-rowindex="1"] > [aria-colindex="2"]').should('contain.text', 'A'); - cy.get('[aria-rowindex="2"] > [aria-colindex="2"]').should('contain.text', 'B'); - cy.get('[aria-rowindex="3"] > [aria-colindex="2"]').should('contain.text', 'C'); - cy.get('[aria-rowindex="4"] > [aria-colindex="2"]').should('contain.text', 'D'); - cy.get('[aria-rowindex="5"] > [aria-colindex="2"]').should('contain.text', 'E'); - - //Sort data + cy.get(":nth-child(3) > .page-link").click(); + + // Check after edit values are correct + cy.get('[aria-rowindex="1"] > [aria-colindex="1"]').should( + "contain.text", + "01/01/2022" + ); + cy.get('[aria-rowindex="2"] > [aria-colindex="1"]').should( + "contain.text", + "01/02/2022" + ); + cy.get('[aria-rowindex="3"] > [aria-colindex="1"]').should( + "contain.text", + "01/03/2022" + ); + cy.get('[aria-rowindex="4"] > [aria-colindex="1"]').should( + "contain.text", + "01/04/2022" + ); + cy.get('[aria-rowindex="5"] > [aria-colindex="1"]').should( + "contain.text", + "01/05/2022" + ); + + cy.get('[aria-rowindex="1"] > [aria-colindex="2"]').should( + "contain.text", + "A" + ); + cy.get('[aria-rowindex="2"] > [aria-colindex="2"]').should( + "contain.text", + "B" + ); + cy.get('[aria-rowindex="3"] > [aria-colindex="2"]').should( + "contain.text", + "C" + ); + cy.get('[aria-rowindex="4"] > [aria-colindex="2"]').should( + "contain.text", + "D" + ); + cy.get('[aria-rowindex="5"] > [aria-colindex="2"]').should( + "contain.text", + "E" + ); + + // Sort data cy.get('[aria-colindex="1"] > div').click(); // Go to pagination page 2 - cy.get(':nth-child(4) > .page-link').click(); - - //Get record "B" and replace to "BB" and date 01/02/2022 to 02/02/2022 - cy.get('[aria-rowindex="8"] > .text-right > .actions > .btn-group > [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=screen-field-date] input').should('have.value', '01/02/2022').clear().type('02/02/2022'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]').should('have.value', 'B').type('B'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary').click(); - - //Check after edit values are correct - cy.get('[aria-rowindex="6"] > [aria-colindex="1"]').should('contain.text', '01/05/2022'); - cy.get('[aria-rowindex="7"] > [aria-colindex="1"]').should('contain.text', '01/04/2022'); - cy.get('[aria-rowindex="8"] > [aria-colindex="1"]').should('contain.text', '01/03/2022'); - cy.get('[aria-rowindex="9"] > [aria-colindex="1"]').should('contain.text', '01/01/2022'); - - cy.get('[aria-rowindex="6"] > [aria-colindex="2"]').should('contain.text', 'E'); - cy.get('[aria-rowindex="7"] > [aria-colindex="2"]').should('contain.text', 'D'); - cy.get('[aria-rowindex="8"] > [aria-colindex="2"]').should('contain.text', 'C'); - cy.get('[aria-rowindex="9"] > [aria-colindex="2"]').should('contain.text', 'A'); + cy.get(":nth-child(4) > .page-link").click(); + + // Get record "B" and replace to "BB" and date 01/02/2022 to 02/02/2022 + cy.get( + '[aria-rowindex="8"] > .text-right > .actions > .btn-group > [data-cy=edit-row]' + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=screen-field-date] input" + ) + .should("have.value", "01/02/2022") + .clear() + .type("02/02/2022"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=name]" + ) + .should("have.value", "B") + .type("B"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary" + ).click(); + + // Check after edit values are correct + cy.get('[aria-rowindex="6"] > [aria-colindex="1"]').should( + "contain.text", + "01/05/2022" + ); + cy.get('[aria-rowindex="7"] > [aria-colindex="1"]').should( + "contain.text", + "01/04/2022" + ); + cy.get('[aria-rowindex="8"] > [aria-colindex="1"]').should( + "contain.text", + "01/03/2022" + ); + cy.get('[aria-rowindex="9"] > [aria-colindex="1"]').should( + "contain.text", + "01/01/2022" + ); + + cy.get('[aria-rowindex="6"] > [aria-colindex="2"]').should( + "contain.text", + "E" + ); + cy.get('[aria-rowindex="7"] > [aria-colindex="2"]').should( + "contain.text", + "D" + ); + cy.get('[aria-rowindex="8"] > [aria-colindex="2"]').should( + "contain.text", + "C" + ); + cy.get('[aria-rowindex="9"] > [aria-colindex="2"]').should( + "contain.text", + "A" + ); // Go to pagination page 2 - cy.get(':nth-child(3) > .page-link').click(); - - //Check after edit values are correct - cy.get('[aria-rowindex="1"] > [aria-colindex="1"]').should('contain.text', ''); - cy.get('[aria-rowindex="2"] > [aria-colindex="1"]').should('contain.text', ''); - cy.get('[aria-rowindex="3"] > [aria-colindex="1"]').should('contain.text', '06/06/2022'); - cy.get('[aria-rowindex="4"] > [aria-colindex="1"]').should('contain.text', '02/02/2022'); - cy.get('[aria-rowindex="5"] > [aria-colindex="1"]').should('contain.text', '01/10/2022'); - - cy.get('[aria-rowindex="1"] > [aria-colindex="2"]').should('contain.text', 'F'); - cy.get('[aria-rowindex="2"] > [aria-colindex="2"]').should('contain.text', 'H'); - cy.get('[aria-rowindex="3"] > [aria-colindex="2"]').should('contain.text', 'GG'); - cy.get('[aria-rowindex="4"] > [aria-colindex="2"]').should('contain.text', 'BB'); - cy.get('[aria-rowindex="5"] > [aria-colindex="2"]').should('contain.text', 'New value'); + cy.get(":nth-child(3) > .page-link").click(); + + // Check after edit values are correct + cy.get('[aria-rowindex="1"] > [aria-colindex="1"]').should( + "contain.text", + "" + ); + cy.get('[aria-rowindex="2"] > [aria-colindex="1"]').should( + "contain.text", + "" + ); + cy.get('[aria-rowindex="3"] > [aria-colindex="1"]').should( + "contain.text", + "06/06/2022" + ); + cy.get('[aria-rowindex="4"] > [aria-colindex="1"]').should( + "contain.text", + "02/02/2022" + ); + cy.get('[aria-rowindex="5"] > [aria-colindex="1"]').should( + "contain.text", + "01/10/2022" + ); + + cy.get('[aria-rowindex="1"] > [aria-colindex="2"]').should( + "contain.text", + "F" + ); + cy.get('[aria-rowindex="2"] > [aria-colindex="2"]').should( + "contain.text", + "H" + ); + cy.get('[aria-rowindex="3"] > [aria-colindex="2"]').should( + "contain.text", + "GG" + ); + cy.get('[aria-rowindex="4"] > [aria-colindex="2"]').should( + "contain.text", + "BB" + ); + cy.get('[aria-rowindex="5"] > [aria-colindex="2"]').should( + "contain.text", + "New value" + ); }); }); diff --git a/tests/e2e/specs/RecordListMultiColumnLoop.spec.js b/tests/e2e/specs/RecordListMultiColumnLoop.spec.js index e04ce962d..e4a06ad5a 100644 --- a/tests/e2e/specs/RecordListMultiColumnLoop.spec.js +++ b/tests/e2e/specs/RecordListMultiColumnLoop.spec.js @@ -1,59 +1,96 @@ -describe('Record List', () => { - +describe("Record List", () => { beforeEach(() => { - cy.visit('/'); - - cy.server(); + cy.visit("/"); }); - it('Recordlist with MultiColumn and Loop', () => { + it("Recordlist with MultiColumn and Loop", () => { // Load screen - cy.loadFromJson('record_list_multicolumn_loop.json', 0); - cy.get('[data-cy=mode-preview]').click(); + cy.loadFromJson("record_list_multicolumn_loop.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Add a recordlist row - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-form_input_1"]').eq(0).type('1'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-form_input_1"]').eq(1).type('2'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-form_input_1"]').eq(2).type('3'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name="form_input_2"]').type('4'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-form_input_3"]').type('5'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-form_input_1"]' + ) + .eq(0) + .type("1"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-form_input_1"]' + ) + .eq(1) + .type("2"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-form_input_1"]' + ) + .eq(2) + .type("3"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name="form_input_2"]' + ).type("4"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-form_input_3"]' + ).type("5"); // Save row - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); - //Edit created row - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-form_input_1"]').eq(0).type('1'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-form_input_1"]').eq(1).type('2'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-form_input_1"]').eq(2).type('3'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name="form_input_2"]').type('4'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-form_input_3"]').type('5'); + // Edit created row + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-form_input_1"]' + ) + .eq(0) + .type("1"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-form_input_1"]' + ) + .eq(1) + .type("2"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-form_input_1"]' + ) + .eq(2) + .type("3"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name="form_input_2"]' + ).type("4"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-form_input_3"]' + ).type("5"); // Update row - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary" + ).click(); // Verify the data structure - cy.get('#screen-builder-container').then((div) => { + cy.get("#screen-builder-container").then((div) => { const data = div[0].__vue__.previewData; const record_row_id = data.form_record_list_1[0].row_id; expect(data.form_record_list_1).to.eql([ { - 'loop_1': [ + loop_1: [ { - 'form_input_1': '11', + form_input_1: "11" }, { - 'form_input_1': '22', + form_input_1: "22" }, { - 'form_input_1': '33', - }, + form_input_1: "33" + } ], - 'form_input_2': '44', - 'form_input_3': '55', - 'row_id': record_row_id, - }, + form_input_2: "44", + form_input_3: "55", + row_id: record_row_id + } ]); }); }); diff --git a/tests/e2e/specs/RecordListWithLoops.js b/tests/e2e/specs/RecordListWithLoops.js index 84d1e0820..7b45f8b22 100644 --- a/tests/e2e/specs/RecordListWithLoops.js +++ b/tests/e2e/specs/RecordListWithLoops.js @@ -1,120 +1,237 @@ -describe('Record list', () => { +describe("Record list", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); - cy.window().then(win => { + cy.visit("/"); + cy.window().then((win) => { // Add request-id header - const requestIdMeta = window.document.createElement('meta'); - requestIdMeta.setAttribute('name', 'request-id'); - requestIdMeta.setAttribute('content', '1'); + const requestIdMeta = window.document.createElement("meta"); + requestIdMeta.setAttribute("name", "request-id"); + requestIdMeta.setAttribute("content", "1"); win.document.head.appendChild(requestIdMeta); }); }); - it('FileUpload in record lists within loops', () => { - cy.loadFromJson('record_list_fileupload_loops.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("FileUpload in record lists within loops", () => { + cy.loadFromJson("record_list_fileupload_loops.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Add 1 row to the record list. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); // Upload the first file. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_4]').eq(0).clear().type('First'); - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 1, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"] input[type=file]', 'avatar.jpeg', 'image/jpg'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_4]" + ) + .eq(0) + .clear() + .type("First"); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 1 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"] input[type=file]', + "avatar.jpeg", + "image/jpg" + ); // Upload a second file. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy=loop-loop_1-add]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_4]').eq(1).clear().type('Second'); - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 2, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"] input[type=file]', 'avatar.jpeg', 'image/jpg', 1); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy=loop-loop_1-add]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_4]" + ) + .eq(1) + .clear() + .type("Second"); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 2 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"] input[type=file]', + "avatar.jpeg", + "image/jpg", + 1 + ); cy.wait(1000); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"]').eq(0).should('contain.text', 'avatar.jpeg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"]').eq(1).should('contain.text', 'avatar.jpeg'); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"]' + ) + .eq(0) + .should("contain.text", "avatar.jpeg"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"]' + ) + .eq(1) + .should("contain.text", "avatar.jpeg"); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)" + ).click(); // Edit record and check the uploaded files are displayed. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]').eq(0).should('contain.text', 'avatar.jpeg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=form_input_4]').eq(1).clear().type('Second edited'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]').eq(1).should('contain.text', 'avatar.jpeg'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ).click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]' + ) + .eq(0) + .should("contain.text", "avatar.jpeg"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=form_input_4]" + ) + .eq(1) + .clear() + .type("Second edited"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]' + ) + .eq(1) + .should("contain.text", "avatar.jpeg"); // Add a third file in edit modal. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=loop-loop_1-add]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=form_input_4]').eq(2).clear().type('Third'); - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 3, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"] input[type=file]', 'avatar.jpeg', 'image/jpg', 2); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=loop-loop_1-add]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=form_input_4]" + ) + .eq(2) + .clear() + .type("Third"); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 3 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"] input[type=file]', + "avatar.jpeg", + "image/jpg", + 2 + ); cy.wait(1000); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]').eq(2).should('contain.text', 'avatar.jpeg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)').click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]' + ) + .eq(2) + .should("contain.text", "avatar.jpeg"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)" + ).click(); // Delete third file in edit modal. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=loop-loop_1-remove]').click(); - cy.on('window:confirm', () => true); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy=loop-loop_1-remove]" + ).click(); + cy.on("window:confirm", () => true); cy.wait(500); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)" + ).click(); // Add 2nd. row to the record list and add a new file. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); - cy.route('POST', '/api/1.0/requests/1/files', JSON.stringify({ - message: 'The file was uploaded.', - fileUploadId: 4, - })); - cy.uploadFile('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"] input[type=file]', 'avatar.jpeg', 'image/jpg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); + cy.intercept( + "POST", + "/api/1.0/requests/1/files", + JSON.stringify({ + message: "The file was uploaded.", + fileUploadId: 4 + }) + ); + cy.uploadFile( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [data-cy="screen-field-file_upload_2"] input[type=file]', + "avatar.jpeg", + "image/jpg" + ); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button:contains(Ok)" + ).click(); // Click on Edit first record and check the uploaded files are still displayed. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').eq(0).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]').eq(0).should('contain.text', 'avatar.jpeg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]').eq(1).should('contain.text', 'avatar.jpeg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ) + .eq(0) + .click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]' + ) + .eq(0) + .should("contain.text", "avatar.jpeg"); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]' + ) + .eq(1) + .should("contain.text", "avatar.jpeg"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)" + ).click(); // Click on Edit second record and check uploaded files. - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').eq(1).click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]').eq(0).should('contain.text', 'avatar.jpeg'); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ) + .eq(1) + .click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [data-cy="screen-field-file_upload_2"]' + ) + .eq(0) + .should("contain.text", "avatar.jpeg"); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button:contains(Save)" + ).click(); // Verify the data structure. - cy.get('#screen-builder-container').then((div) => { + cy.get("#screen-builder-container").then((div) => { const data = div[0].__vue__.previewData; const record_row_id = data.form_record_list_1[0].row_id; const second_record_row_id = data.form_record_list_1[1].row_id; expect(data).to.eql({ - 'form_record_list_1': [ + form_record_list_1: [ { - 'loop_1': [ + loop_1: [ { - 'form_input_4': 'First', - 'file_upload_2': 1, + form_input_4: "First", + file_upload_2: 1 }, { - 'form_input_4': 'Second edited', - 'file_upload_2': 2, - }, + form_input_4: "Second edited", + file_upload_2: 2 + } ], - 'row_id': record_row_id, + row_id: record_row_id }, { - 'loop_1': [ + loop_1: [ { - 'form_input_4': '', - 'file_upload_2': 4, - }, + form_input_4: "", + file_upload_2: 4 + } ], - 'row_id': second_record_row_id, - }, - ], - 'loop_1': [ - {}, + row_id: second_record_row_id + } ], + loop_1: [{}] }); }); }); diff --git a/tests/e2e/specs/RefreshNestedScreen.spec.js b/tests/e2e/specs/RefreshNestedScreen.spec.js index 6e533c110..bb052eeb2 100644 --- a/tests/e2e/specs/RefreshNestedScreen.spec.js +++ b/tests/e2e/specs/RefreshNestedScreen.spec.js @@ -1,49 +1,69 @@ -describe('refresh nested screen', () => { +describe("refresh nested screen", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('Verify main screen is refreshed with nested changes', () => { - cy.loadFromJson('refresh_nested_screen.json', 0); + it("Verify main screen is refreshed with nested changes", () => { + cy.loadFromJson("refresh_nested_screen.json", 0); // Preview the screen - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content]').should('contain.text', 'Form Input 1'); - cy.get('[data-cy=preview-content]').should('contain.text', 'Form Input 2'); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content]").should("contain.text", "Form Input 1"); + cy.get("[data-cy=preview-content]").should("contain.text", "Form Input 2"); // Go back to edit the screen - cy.get('[data-cy=mode-editor]').click(); + cy.get("[data-cy=mode-editor]").click(); // CHANGE the nested screen content from behind the scenes - cy.loadFromJson('refresh_nested_screen_2.json'); + cy.loadFromJson("refresh_nested_screen_2.json"); // Preview the screen: It should show the new content - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content]').should('contain.text', 'CHANGED Form Input 1'); - cy.get('[data-cy=preview-content]').should('contain.text', 'CHANGED Form Input 2'); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content]").should( + "contain.text", + "CHANGED Form Input 1" + ); + cy.get("[data-cy=preview-content]").should( + "contain.text", + "CHANGED Form Input 2" + ); // Go back to edit the screen: Should show the new content - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=editor-content]').should('contain.text', 'CHANGED Form Input 1'); - cy.get('[data-cy=editor-content]').should('contain.text', 'CHANGED Form Input 2'); - + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=editor-content]").should( + "contain.text", + "CHANGED Form Input 1" + ); + cy.get("[data-cy=editor-content]").should( + "contain.text", + "CHANGED Form Input 2" + ); }); - it('Verify main screen is refreshed with nested nested changes', () => { - cy.loadFromJson('refresh_nested_nested_screen.json', 0); + it("Verify main screen is refreshed with nested nested changes", () => { + cy.loadFromJson("refresh_nested_nested_screen.json", 0); // CHANGE the nested screen content from behind the scenes - cy.loadFromJson('refresh_nested_nested_screen_2.json'); + cy.loadFromJson("refresh_nested_nested_screen_2.json"); - cy.get('[data-cy=screen-element-container]').eq(0).click(); - cy.get('[data-cy=inspector-screen] div.multiselect').click(); - cy.get('[data-cy=inspector-screen] span:contains("Nested Screen"):first').click(); - cy.get('[data-cy=inspector-screen] div.multiselect').click(); - cy.get('[data-cy=inspector-screen] span:contains("Nested Screen"):first').click(); + cy.get("[data-cy=screen-element-container]").eq(0).click(); + cy.get("[data-cy=inspector-screen] div.multiselect").click(); + cy.get( + '[data-cy=inspector-screen] span:contains("Nested Screen"):first' + ).click(); + cy.get("[data-cy=inspector-screen] div.multiselect").click(); + cy.get( + '[data-cy=inspector-screen] span:contains("Nested Screen"):first' + ).click(); // Should show the new content - cy.get('[data-cy=editor-content]').should('contain.text', 'CHANGED Form Input 1'); - cy.get('[data-cy=editor-content]').should('contain.text', 'CHANGED Nested Nested Input 1'); + cy.get("[data-cy=editor-content]").should( + "contain.text", + "CHANGED Form Input 1" + ); + cy.get("[data-cy=editor-content]").should( + "contain.text", + "CHANGED Nested Nested Input 1" + ); }); }); diff --git a/tests/e2e/specs/ResponsivePreview.spec.js b/tests/e2e/specs/ResponsivePreview.spec.js index 8552f4c66..01573e5fc 100644 --- a/tests/e2e/specs/ResponsivePreview.spec.js +++ b/tests/e2e/specs/ResponsivePreview.spec.js @@ -1,69 +1,85 @@ -describe('Responsive Preview test', () => { - const modeEditorSelector = '[data-cy=mode-editor]'; - const modePreviewSelector = '[data-cy=mode-preview]'; - const desktopButtonSelector = '[data-cy=device-screen-desktop-button]'; - const mobileButtonSelector = '[data-cy=device-screen-mobile-button]'; - const screenRendererSelector = '[data-cy=screen-renderer-container]'; - const screenDropZoneSelector = '[data-cy=screen-drop-zone]'; - const screenContainerSelector = '[data-cy=screen-element-container]'; - const controlInputSelector = '[data-cy=controls-FormInput]'; +describe("Responsive Preview test", () => { + const modeEditorSelector = "[data-cy=mode-editor]"; + const modePreviewSelector = "[data-cy=mode-preview]"; + const desktopButtonSelector = "[data-cy=device-screen-desktop-button]"; + const mobileButtonSelector = "[data-cy=device-screen-mobile-button]"; + const screenRendererSelector = "[data-cy=screen-renderer-container]"; + const screenDropZoneSelector = "[data-cy=screen-drop-zone]"; + const screenContainerSelector = "[data-cy=screen-element-container]"; + const controlInputSelector = "[data-cy=controls-FormInput]"; beforeEach(() => { - cy.visit('/'); + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get(controlInputSelector).drag(screenDropZoneSelector, 'bottom'); - cy.get('[data-cy=controls-FormSelectList]').drag(screenContainerSelector, 'bottom'); + cy.get(controlInputSelector).drag(screenDropZoneSelector, { + position: "bottom" + }); + cy.get("[data-cy=controls-FormSelectList]").drag(screenContainerSelector, { + position: "bottom" + }); }); - it('should render the mode editor and mode preview buttons', () => { + it("should render the mode editor and mode preview buttons", () => { // Mode buttons - cy.get(modeEditorSelector).should('be.visible').and('have.class', 'btn-secondary'); - cy.get(modePreviewSelector).should('be.visible').and('not.have.class', 'btn-secondary'); + cy.get(modeEditorSelector) + .should("be.visible") + .and("have.class", "btn-secondary"); + cy.get(modePreviewSelector) + .should("be.visible") + .and("not.have.class", "btn-secondary"); // Device buttons - cy.get(desktopButtonSelector).should('not.be.visible'); - cy.get(mobileButtonSelector).should('not.be.visible'); + cy.get(desktopButtonSelector).should("not.be.visible"); + cy.get(mobileButtonSelector).should("not.be.visible"); }); - it('Buttons should have title attributes', () => { + it("Buttons should have title attributes", () => { // Preview button cy.get(modePreviewSelector).click(); - // Device buttons - cy.get(desktopButtonSelector).should('be.visible').should('have.attr', 'title'); - cy.get(mobileButtonSelector).should('be.visible').should('have.attr', 'title'); + // Device buttons + cy.get(desktopButtonSelector) + .should("be.visible") + .should("have.attr", "title"); + cy.get(mobileButtonSelector) + .should("be.visible") + .should("have.attr", "title"); }); - it('should render the device screen buttons when clicking on mode preview', () => { + it("should render the device screen buttons when clicking on mode preview", () => { // Preview button cy.get(modePreviewSelector).click(); // Device buttons - cy.get(desktopButtonSelector).should('be.visible').and('have.class', 'btn-secondary'); - cy.get(mobileButtonSelector).should('be.visible').and('not.have.class', 'btn-secondary'); + cy.get(desktopButtonSelector) + .should("be.visible") + .and("have.class", "btn-secondary"); + cy.get(mobileButtonSelector) + .should("be.visible") + .and("not.have.class", "btn-secondary"); }); - it('should render the screen renderer as a the desktop device by default when clicking on mode preview', () => { + it("should render the screen renderer as a the desktop device by default when clicking on mode preview", () => { // Preview button cy.get(modePreviewSelector).click(); // Screen container cy.get(screenRendererSelector).then(($el) => { expect($el).to.be.visible; - expect($el).to.have.class('container-desktop'); + expect($el).to.have.class("container-desktop"); const width = $el.width(); expect(width).to.be.greaterThan(480); }); }); - it('should render the screen renderer as a mobile device when clicking on the mobile button', () => { + it("should render the screen renderer as a mobile device when clicking on the mobile button", () => { // Preview button cy.get(modePreviewSelector).click(); // Mobile button cy.get(mobileButtonSelector).click(); // Screen container cy.get(screenRendererSelector) - .should('be.visible') - .and('have.class', 'container-mobile') - .and('have.css', 'width', '480px'); + .should("be.visible") + .and("have.class", "container-mobile") + .and("have.css", "width", "480px"); }); - it('should render the screen renderer as a desktop device when clicking on the desktop button after clicking on the mobile button', () => { + it("should render the screen renderer as a desktop device when clicking on the desktop button after clicking on the mobile button", () => { // Preview button cy.get(modePreviewSelector).click(); // Mobile button @@ -71,10 +87,12 @@ describe('Responsive Preview test', () => { // Desktop button cy.get(desktopButtonSelector).click(); // Screen container - cy.get(screenRendererSelector).should('be.visible').and('have.class', 'container-desktop'); + cy.get(screenRendererSelector) + .should("be.visible") + .and("have.class", "container-desktop"); }); - it('should render the screen renderer as a mobile device when clicking on the mobile button after clicking on the mode editor', () => { + it("should render the screen renderer as a mobile device when clicking on the mobile button after clicking on the mode editor", () => { // Preview button cy.get(modePreviewSelector).click(); // Mobile button @@ -83,24 +101,28 @@ describe('Responsive Preview test', () => { // Editor button cy.get(modeEditorSelector).click(); // Mobile button - cy.get(mobileButtonSelector).should('not.be.visible'); + cy.get(mobileButtonSelector).should("not.be.visible"); cy.wait(500); // Preview button cy.get(modePreviewSelector).click(); // Desktop button - cy.get(desktopButtonSelector).should('be.visible').and('not.have.class', 'btn-secondary'); + cy.get(desktopButtonSelector) + .should("be.visible") + .and("not.have.class", "btn-secondary"); // Mobile button - cy.get(mobileButtonSelector).should('be.visible').and('have.class', 'btn-secondary'); + cy.get(mobileButtonSelector) + .should("be.visible") + .and("have.class", "btn-secondary"); // Screen container cy.get(screenRendererSelector) - .should('be.visible') - .and('have.class', 'container-mobile') - .and('have.css', 'width', '480px'); + .should("be.visible") + .and("have.class", "container-mobile") + .and("have.css", "width", "480px"); }); - it('should render the input control in desktop preview', () => { + it("should render the input control in desktop preview", () => { const variableNames = []; cy.get(screenContainerSelector).each(($el) => { @@ -117,12 +139,12 @@ describe('Responsive Preview test', () => { expect(names.length).to.be.greaterThan(0); names.forEach((name) => { - cy.get(`[data-cy="screen-field-${name}"]`).should('be.visible'); + cy.get(`[data-cy="screen-field-${name}"]`).should("be.visible"); }); }); }); - it('should render the input control in mobile preview', () => { + it("should render the input control in mobile preview", () => { const variableNames = []; cy.get(screenContainerSelector).each(($el) => { @@ -140,7 +162,7 @@ describe('Responsive Preview test', () => { expect(names.length).to.be.greaterThan(0); names.forEach((name) => { - cy.get(`[data-cy="screen-field-${name}"]`).should('be.visible'); + cy.get(`[data-cy="screen-field-${name}"]`).should("be.visible"); }); }); }); diff --git a/tests/e2e/specs/RichText.spec.js b/tests/e2e/specs/RichText.spec.js index 01e20225a..46c701651 100644 --- a/tests/e2e/specs/RichText.spec.js +++ b/tests/e2e/specs/RichText.spec.js @@ -1,24 +1,42 @@ -describe('Rich Text control', () => { - it('Rich text with mustache', () => { - cy.visit('/'); +describe("Rich Text control", () => { + it("Rich text with mustache", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormHtmlViewer]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-content]').focus().clear().type('

Hello {{ name }}

', {parseSpecialCharSequences: false}); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=controls-FormHtmlViewer]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-content]") + .focus() + .clear() + .type("

Hello {{ name }}

", { parseSpecialCharSequences: false }); + cy.get("[data-cy=mode-preview]").click(); cy.setPreviewDataInput('{"name":"World"}'); - cy.get('[data-cy=preview-content]').should('contain.html', '

Hello World

'); + cy.get("[data-cy=preview-content]").should( + "contain.html", + "

Hello World

" + ); }); - it('Rich text render HTML from a Variable', () => { - cy.visit('/'); + it("Rich text render HTML from a Variable", () => { + cy.visit("/"); cy.openAcordeon("collapse-2"); - cy.get('[data-cy=controls-FormHtmlViewer]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-content]').focus().clear().type('{{ name }}', {parseSpecialCharSequences: false}); - cy.get('[data-cy=inspector-renderVarHtml]').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=controls-FormHtmlViewer]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-content]") + .focus() + .clear() + .type("{{ name }}", { parseSpecialCharSequences: false }); + cy.get("[data-cy=inspector-renderVarHtml]").click(); + cy.get("[data-cy=mode-preview]").click(); cy.setPreviewDataInput('{"name":"

Hello World

"}'); - cy.get('[data-cy=preview-content]').should('contain.html', '

Hello World

'); + cy.get("[data-cy=preview-content]").should( + "contain.html", + "

Hello World

" + ); }); }); diff --git a/tests/e2e/specs/ScreenBuilder.spec.js b/tests/e2e/specs/ScreenBuilder.spec.js index 1850f739d..d0add3a75 100644 --- a/tests/e2e/specs/ScreenBuilder.spec.js +++ b/tests/e2e/specs/ScreenBuilder.spec.js @@ -1,6 +1,6 @@ -describe('ScreenBuilder', () => { - it('Visits the app root url and renders form builder', () => { - cy.visit('/'); - cy.contains('Place your controls here.').should('be.visible'); +describe("ScreenBuilder", () => { + it("Visits the app root url and renders form builder", () => { + cy.visit("/"); + cy.contains("Place your controls here.").should("be.visible"); }); }); diff --git a/tests/e2e/specs/ScreenErrorNestedCalc.spec.js b/tests/e2e/specs/ScreenErrorNestedCalc.spec.js index 8afc9cdd8..4b9081015 100644 --- a/tests/e2e/specs/ScreenErrorNestedCalc.spec.js +++ b/tests/e2e/specs/ScreenErrorNestedCalc.spec.js @@ -1,6 +1,5 @@ describe("screen error nested calc", () => { beforeEach(() => { - cy.server(); cy.visit("/"); }); diff --git a/tests/e2e/specs/ScreenWarnings.spec.js b/tests/e2e/specs/ScreenWarnings.spec.js index 851692b69..57851014c 100644 --- a/tests/e2e/specs/ScreenWarnings.spec.js +++ b/tests/e2e/specs/ScreenWarnings.spec.js @@ -1,32 +1,53 @@ -describe('Screen Warnings', () => { +describe("Screen Warnings", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('Large screen warning', () => { - cy.loadFromJson('large_screen_warning.json', 1); + it("Large screen warning", () => { + cy.loadFromJson("large_screen_warning.json", 1); - cy.get('[data-cy="open-console"] .badge-warning').should('contain.text', '1'); + cy.get('[data-cy="open-console"] .badge-warning').should( + "contain.text", + "1" + ); cy.get('[data-cy="open-console"]').click(); - cy.get('[data-cy="validation-panel"]').should('contain.text', 'We recommend using fewer than 25 form elements in your screen for optimal performance.'); + cy.get('[data-cy="validation-panel"]').should( + "contain.text", + "We recommend using fewer than 25 form elements in your screen for optimal performance." + ); }); - it('Use script warning', () => { + it("Use script warning", () => { cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]').type('test'); - cy.get('[data-cy="watchers-watcher-variable"]').selectOption('form_input_1'); + cy.get('[data-cy="watchers-watcher-name"]').type("test"); + cy.get('[data-cy="watchers-watcher-variable"]').selectOption( + "form_input_1" + ); cy.get('[data-cy="watchers-accordion-source"]').click(); - cy.get('#watcherSource').should('not.contain.text', 'Using watchers with Scripts can slow the performance of your screen'); - cy.get('[data-cy="watchers-watcher-source"]').selectOption('Test Script'); - cy.get('#watcherSource').should('contain.text', 'Using watchers with Scripts can slow the performance of your screen'); + cy.get("#watcherSource").should( + "not.contain.text", + "Using watchers with Scripts can slow the performance of your screen" + ); + cy.get('[data-cy="watchers-watcher-source"]').selectOption("Test Script"); + cy.get("#watcherSource").should( + "contain.text", + "Using watchers with Scripts can slow the performance of your screen" + ); cy.get('[data-cy="watchers-button-save"]').click(); cy.get('[data-cy="watchers-modal"] .close').click(); - cy.get('[data-cy="open-console"] .badge-warning').should('contain.text', '1'); + cy.get('[data-cy="open-console"] .badge-warning').should( + "contain.text", + "1" + ); cy.get('[data-cy="open-console"]').click(); - cy.get('[data-cy="validation-panel"]').should('contain.text', 'Using watchers with Scripts can slow the performance of your screen.'); + cy.get('[data-cy="validation-panel"]').should( + "contain.text", + "Using watchers with Scripts can slow the performance of your screen." + ); }); }); diff --git a/tests/e2e/specs/SelectListCollection.spec.js b/tests/e2e/specs/SelectListCollection.spec.js index 7708e1bcc..f10d05658 100644 --- a/tests/e2e/specs/SelectListCollection.spec.js +++ b/tests/e2e/specs/SelectListCollection.spec.js @@ -1,832 +1,1003 @@ -describe('select list mustache', () => { +describe("select list mustache", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); - cy.route( - 'POST', - '/api/1.0/requests/data_sources/2', + cy.visit("/"); + cy.intercept( + "POST", + "/api/1.0/requests/data_sources/2", JSON.stringify({ - 'status': 200, - 'response': { - 'data': [{ - 'id': 1, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + status: 200, + response: { + data: [ + { + id: 1, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" + }, + id: 1 }, - 'id': 1, - }, - 'collection_id': 1, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }, { - 'id': 2, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + collection_id: 1, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" }, - 'id': 2, - }, - 'collection_id': 1, - 'title': '2', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', + updated_by: { + id: 2, + email: "admin@processmaker.com" + } }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }], - 'meta': { - 'filter': '', - 'sort_by': '', - 'sort_order': '', - 'count': 2, - 'total_pages': 1, - 'current_page': 1, - 'from': 1, - 'last_page': 1, - 'path': '/api/1.0/collections/1/records', - 'per_page': 9223372036854775807, - 'to': 2, - 'total': 2, - }, - }, + { + id: 2, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + dni: "5678", + name: { + last: "Doe", + first: "John" + }, + id: 2 + }, + collection_id: 1, + title: "2", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } + ], + meta: { + filter: "", + sort_by: "", + sort_order: "", + count: 2, + total_pages: 1, + current_page: 1, + from: 1, + last_page: 1, + path: "/api/1.0/collections/1/records", + per_page: 9223372036854775807, + to: 2, + total: 2 + } + } }) - ).as('executeScript'); + ).as("executeScript"); }); - - it('Verify select list mustache + collection', () => { - cy.loadFromJson('select_list_collection.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Verify select list mustache + collection", () => { + cy.loadFromJson("select_list_collection.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Select all the row - cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption('1234'); + cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption("1234"); // Select property `data.name` - cy.get('[data-cy="screen-field-form_select_list_2"]').selectOption('Oliver'); + cy.get('[data-cy="screen-field-form_select_list_2"]').selectOption( + "Oliver" + ); // Select all the row - cy.get('[data-cy="screen-field-form_select_list_3"]').selectOption('DNI: 1234 Name: Oliver Smith'); + cy.get('[data-cy="screen-field-form_select_list_3"]').selectOption( + "DNI: 1234 Name: Oliver Smith" + ); // Select data.dni - cy.get('[data-cy="screen-field-form_select_list_4"]').selectOption('Oliver Smith'); + cy.get('[data-cy="screen-field-form_select_list_4"]').selectOption( + "Oliver Smith" + ); // Select {{ data.name.first }} {{ data.name.last }} - cy.get('[data-cy="screen-field-form_select_list_5"]').selectOption('Oliver Smith'); + cy.get('[data-cy="screen-field-form_select_list_5"]').selectOption( + "Oliver Smith" + ); // Select {{ data.id }} - cy.get('[data-cy="screen-field-form_select_list_6"]').selectOption('Oliver Smith'); + cy.get('[data-cy="screen-field-form_select_list_6"]').selectOption( + "Oliver Smith" + ); // Check the data of the screen cy.assertPreviewData({ - 'form_select_list_1': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_1: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_2': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_2: { + last: "Smith", + first: "Oliver" }, - 'form_select_list_3': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_3: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_4': '1', - 'form_select_list_5': 'Oliver Smith', - 'form_select_list_6': '1', + form_select_list_4: "1", + form_select_list_5: "Oliver Smith", + form_select_list_6: "1" }); }); - it('Verify radio list mustache + collection', () => { - cy.loadFromJson('select_list_radio_collection.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Verify radio list mustache + collection", () => { + cy.loadFromJson("select_list_radio_collection.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Select all the row - cy.get('[data-cy="screen-field-form_select_list_1"]').parent().find('label:contains("1234")').click(); + cy.get('[data-cy="screen-field-form_select_list_1"]') + .parent() + .find('label:contains("1234")') + .click(); // Select property `data.name` - cy.get('[data-cy="screen-field-form_select_list_2"]').parent().find('label:contains("Oliver")').click(); + cy.get('[data-cy="screen-field-form_select_list_2"]') + .parent() + .find('label:contains("Oliver")') + .click(); // Select all the row - cy.get('[data-cy="screen-field-form_select_list_3"]').parent().find('label:contains("DNI: 1234 Name: Oliver Smith")').click(); + cy.get('[data-cy="screen-field-form_select_list_3"]') + .parent() + .find('label:contains("DNI: 1234 Name: Oliver Smith")') + .click(); // Select data.dni - cy.get('[data-cy="screen-field-form_select_list_4"]').parent().find('label:contains("Oliver Smith")').click(); + cy.get('[data-cy="screen-field-form_select_list_4"]') + .parent() + .find('label:contains("Oliver Smith")') + .click(); // Select {{ data.name.first }} {{ data.name.last }} - cy.get('[data-cy="screen-field-form_select_list_5"]').parent().find('label:contains("Oliver Smith")').click(); + cy.get('[data-cy="screen-field-form_select_list_5"]') + .parent() + .find('label:contains("Oliver Smith")') + .click(); // Select {{ data.id }} - cy.get('[data-cy="screen-field-form_select_list_6"]').parent().find('label:contains("Oliver Smith")').click(); + cy.get('[data-cy="screen-field-form_select_list_6"]') + .parent() + .find('label:contains("Oliver Smith")') + .click(); // Check the data of the screen cy.assertPreviewData({ - 'form_select_list_1': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_1: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_2': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_2: { + last: "Smith", + first: "Oliver" }, - 'form_select_list_3': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_3: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_4': '1', - 'form_select_list_5': 'Oliver Smith', - 'form_select_list_6': '1', + form_select_list_4: "1", + form_select_list_5: "Oliver Smith", + form_select_list_6: "1" }); }); - it('Verify check list mustache + collection', () => { - cy.loadFromJson('select_list_checkbox_collection.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Verify check list mustache + collection", () => { + cy.loadFromJson("select_list_checkbox_collection.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Select all the row - cy.get('[data-cy="screen-field-form_select_list_1"]').parent().find('label:contains("1234")').click(); - cy.get('[data-cy="screen-field-form_select_list_1"]').parent().find('label:contains("5678")').click(); + cy.get('[data-cy="screen-field-form_select_list_1"]') + .parent() + .find('label:contains("1234")') + .click(); + cy.get('[data-cy="screen-field-form_select_list_1"]') + .parent() + .find('label:contains("5678")') + .click(); // Select property `data.name` - cy.get('[data-cy="screen-field-form_select_list_2"]').parent().find('label:contains("Oliver")').click(); - cy.get('[data-cy="screen-field-form_select_list_2"]').parent().find('label:contains("John")').click(); + cy.get('[data-cy="screen-field-form_select_list_2"]') + .parent() + .find('label:contains("Oliver")') + .click(); + cy.get('[data-cy="screen-field-form_select_list_2"]') + .parent() + .find('label:contains("John")') + .click(); // Select all the row - cy.get('[data-cy="screen-field-form_select_list_3"]').parent().find('label:contains("DNI: 1234 Name: Oliver Smith")').click(); - cy.get('[data-cy="screen-field-form_select_list_3"]').parent().find('label:contains("DNI: 5678 Name: John Doe")').click(); + cy.get('[data-cy="screen-field-form_select_list_3"]') + .parent() + .find('label:contains("DNI: 1234 Name: Oliver Smith")') + .click(); + cy.get('[data-cy="screen-field-form_select_list_3"]') + .parent() + .find('label:contains("DNI: 5678 Name: John Doe")') + .click(); // Select data.dni - cy.get('[data-cy="screen-field-form_select_list_4"]').parent().find('label:contains("Oliver Smith")').click(); - cy.get('[data-cy="screen-field-form_select_list_4"]').parent().find('label:contains("John Doe")').click(); + cy.get('[data-cy="screen-field-form_select_list_4"]') + .parent() + .find('label:contains("Oliver Smith")') + .click(); + cy.get('[data-cy="screen-field-form_select_list_4"]') + .parent() + .find('label:contains("John Doe")') + .click(); // Select {{ data.name.first }} {{ data.name.last }} - cy.get('[data-cy="screen-field-form_select_list_5"]').parent().find('label:contains("Oliver Smith")').click(); - cy.get('[data-cy="screen-field-form_select_list_5"]').parent().find('label:contains("John Doe")').click(); + cy.get('[data-cy="screen-field-form_select_list_5"]') + .parent() + .find('label:contains("Oliver Smith")') + .click(); + cy.get('[data-cy="screen-field-form_select_list_5"]') + .parent() + .find('label:contains("John Doe")') + .click(); // Select {{ data.id }} - cy.get('[data-cy="screen-field-form_select_list_6"]').parent().find('label:contains("Oliver Smith")').click(); - cy.get('[data-cy="screen-field-form_select_list_6"]').parent().find('label:contains("John Doe")').click(); + cy.get('[data-cy="screen-field-form_select_list_6"]') + .parent() + .find('label:contains("Oliver Smith")') + .click(); + cy.get('[data-cy="screen-field-form_select_list_6"]') + .parent() + .find('label:contains("John Doe")') + .click(); // Check the data of the screen cy.assertPreviewData({ - 'form_select_list_1': [ + form_select_list_1: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + dni: "5678", + name: { + last: "Doe", + first: "John" }, - 'id': 2, - }, + id: 2 + } ], - 'form_select_list_2': [ + form_select_list_2: [ { - 'last': 'Smith', - 'first': 'Oliver', + last: "Smith", + first: "Oliver" }, { - 'last': 'Doe', - 'first': 'John', - }, + last: "Doe", + first: "John" + } ], - 'form_select_list_3': [ + form_select_list_3: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + dni: "5678", + name: { + last: "Doe", + first: "John" }, - 'id': 2, - }, - ], - 'form_select_list_4': [ - '1', - '2', - ], - 'form_select_list_5': [ - 'Oliver Smith', - 'John Doe', - ], - 'form_select_list_6': [ - '1', - '2', + id: 2 + } ], + form_select_list_4: ["1", "2"], + form_select_list_5: ["Oliver Smith", "John Doe"], + form_select_list_6: ["1", "2"] }); }); - it('Verify multiselect list mustache + collection', () => { - cy.loadFromJson('select_list_multiselect_collection.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Verify multiselect list mustache + collection", () => { + cy.loadFromJson("select_list_multiselect_collection.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Select all the row - cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption('1234'); + cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption("1234"); cy.get('[data-cy="screen-field-form_select_list_1"]').click(); - cy.get('[data-cy="screen-field-form_select_list_1"] li:contains("5678")').click(); + cy.get( + '[data-cy="screen-field-form_select_list_1"] li:contains("5678")' + ).click(); // Select property `data.name` - cy.get('[data-cy="screen-field-form_select_list_2"]').selectOption('Oliver'); + cy.get('[data-cy="screen-field-form_select_list_2"]').selectOption( + "Oliver" + ); cy.get('[data-cy="screen-field-form_select_list_2"]').click(); - cy.get('[data-cy="screen-field-form_select_list_2"] li:contains("John")').click(); + cy.get( + '[data-cy="screen-field-form_select_list_2"] li:contains("John")' + ).click(); // Select all the row - cy.get('[data-cy="screen-field-form_select_list_3"]').selectOption('DNI: 1234 Name: Oliver Smith'); + cy.get('[data-cy="screen-field-form_select_list_3"]').selectOption( + "DNI: 1234 Name: Oliver Smith" + ); cy.get('[data-cy="screen-field-form_select_list_3"]').click(); - cy.get('[data-cy="screen-field-form_select_list_3"] li:contains("DNI: 5678 Name: John Doe")').click(); + cy.get( + '[data-cy="screen-field-form_select_list_3"] li:contains("DNI: 5678 Name: John Doe")' + ).click(); // Select data.dni - cy.get('[data-cy="screen-field-form_select_list_4"]').selectOption('Oliver Smith'); + cy.get('[data-cy="screen-field-form_select_list_4"]').selectOption( + "Oliver Smith" + ); cy.get('[data-cy="screen-field-form_select_list_4"]').click(); - cy.get('[data-cy="screen-field-form_select_list_4"] li:contains("John Doe")').click(); + cy.get( + '[data-cy="screen-field-form_select_list_4"] li:contains("John Doe")' + ).click(); // Select {{ data.name.first }} {{ data.name.last }} - cy.get('[data-cy="screen-field-form_select_list_5"]').selectOption('Oliver Smith'); + cy.get('[data-cy="screen-field-form_select_list_5"]').selectOption( + "Oliver Smith" + ); cy.get('[data-cy="screen-field-form_select_list_5"]').click(); - cy.get('[data-cy="screen-field-form_select_list_5"] li:contains("John Doe")').click(); + cy.get( + '[data-cy="screen-field-form_select_list_5"] li:contains("John Doe")' + ).click(); // Select {{ data.id }} - cy.get('[data-cy="screen-field-form_select_list_6"]').selectOption('Oliver Smith'); + cy.get('[data-cy="screen-field-form_select_list_6"]').selectOption( + "Oliver Smith" + ); cy.get('[data-cy="screen-field-form_select_list_6"]').click(); - cy.get('[data-cy="screen-field-form_select_list_6"] li:contains("John Doe")').click(); + cy.get( + '[data-cy="screen-field-form_select_list_6"] li:contains("John Doe")' + ).click(); // Check the data of the screen cy.assertPreviewData({ - 'form_select_list_1': [ + form_select_list_1: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + dni: "5678", + name: { + last: "Doe", + first: "John" }, - 'id': 2, - }, + id: 2 + } ], - 'form_select_list_2': [ + form_select_list_2: [ { - 'last': 'Smith', - 'first': 'Oliver', + last: "Smith", + first: "Oliver" }, { - 'last': 'Doe', - 'first': 'John', - }, + last: "Doe", + first: "John" + } ], - 'form_select_list_3': [ + form_select_list_3: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + dni: "5678", + name: { + last: "Doe", + first: "John" }, - 'id': 2, - }, - ], - 'form_select_list_4': [ - '1', - '2', - ], - 'form_select_list_5': [ - 'Oliver Smith', - 'John Doe', - ], - 'form_select_list_6': [ - '1', - '2', + id: 2 + } ], + form_select_list_4: ["1", "2"], + form_select_list_5: ["Oliver Smith", "John Doe"], + form_select_list_6: ["1", "2"] }); }); - it('Verify Load values in select list mustache + collection', () => { - cy.loadFromJson('select_list_collection.json', 0); + it("Verify Load values in select list mustache + collection", () => { + cy.loadFromJson("select_list_collection.json", 0); cy.setPreviewDataInput({ - 'form_select_list_1': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_1: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_2': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_2: { + last: "Smith", + first: "Oliver" }, - 'form_select_list_3': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_3: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_4': '1', - 'form_select_list_5': 'Oliver Smith', - 'form_select_list_6': '1', + form_select_list_4: "1", + form_select_list_5: "Oliver Smith", + form_select_list_6: "1" }); - cy.get('[data-cy=mode-preview]').click(); - - cy.get('[data-cy="screen-field-form_select_list_1"] .multiselect__single').contains('1234'); - cy.get('[data-cy="screen-field-form_select_list_2"] .multiselect__single').contains('Oliver'); - cy.get('[data-cy="screen-field-form_select_list_3"] .multiselect__single').contains('DNI: 1234 Name: Oliver Smith'); - cy.get('[data-cy="screen-field-form_select_list_4"] .multiselect__single').contains('Oliver Smith'); - cy.get('[data-cy="screen-field-form_select_list_5"] .multiselect__single').contains('Oliver Smith'); - cy.get('[data-cy="screen-field-form_select_list_6"] .multiselect__single').contains('Oliver Smith'); + cy.get("[data-cy=mode-preview]").click(); + + cy.get( + '[data-cy="screen-field-form_select_list_1"] .multiselect__single' + ).contains("1234"); + cy.get( + '[data-cy="screen-field-form_select_list_2"] .multiselect__single' + ).contains("Oliver"); + cy.get( + '[data-cy="screen-field-form_select_list_3"] .multiselect__single' + ).contains("DNI: 1234 Name: Oliver Smith"); + cy.get( + '[data-cy="screen-field-form_select_list_4"] .multiselect__single' + ).contains("Oliver Smith"); + cy.get( + '[data-cy="screen-field-form_select_list_5"] .multiselect__single' + ).contains("Oliver Smith"); + cy.get( + '[data-cy="screen-field-form_select_list_6"] .multiselect__single' + ).contains("Oliver Smith"); // Check the data of the screen cy.assertPreviewData({ - 'form_select_list_1': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_1: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_2': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_2: { + last: "Smith", + first: "Oliver" }, - 'form_select_list_3': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_3: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_4': '1', - 'form_select_list_5': 'Oliver Smith', - 'form_select_list_6': '1', + form_select_list_4: "1", + form_select_list_5: "Oliver Smith", + form_select_list_6: "1" }); }); - it('Verify Load values in select list mustache + collection', () => { - cy.loadFromJson('select_list_collection.json', 0); + it("Verify Load values in select list mustache + collection", () => { + cy.loadFromJson("select_list_collection.json", 0); cy.setPreviewDataInput({ - 'form_select_list_1': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_1: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_2': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_2: { + last: "Smith", + first: "Oliver" }, - 'form_select_list_3': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_3: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_4': '1', - 'form_select_list_5': 'Oliver Smith', - 'form_select_list_6': '1', + form_select_list_4: "1", + form_select_list_5: "Oliver Smith", + form_select_list_6: "1" }); - cy.get('[data-cy=mode-preview]').click(); - - cy.get('[data-cy="screen-field-form_select_list_1"] .multiselect__single').contains('1234'); - cy.get('[data-cy="screen-field-form_select_list_2"] .multiselect__single').contains('Oliver'); - cy.get('[data-cy="screen-field-form_select_list_3"] .multiselect__single').contains('DNI: 1234 Name: Oliver Smith'); - cy.get('[data-cy="screen-field-form_select_list_4"] .multiselect__single').contains('Oliver Smith'); - cy.get('[data-cy="screen-field-form_select_list_5"] .multiselect__single').contains('Oliver Smith'); - cy.get('[data-cy="screen-field-form_select_list_6"] .multiselect__single').contains('Oliver Smith'); + cy.get("[data-cy=mode-preview]").click(); + + cy.get( + '[data-cy="screen-field-form_select_list_1"] .multiselect__single' + ).contains("1234"); + cy.get( + '[data-cy="screen-field-form_select_list_2"] .multiselect__single' + ).contains("Oliver"); + cy.get( + '[data-cy="screen-field-form_select_list_3"] .multiselect__single' + ).contains("DNI: 1234 Name: Oliver Smith"); + cy.get( + '[data-cy="screen-field-form_select_list_4"] .multiselect__single' + ).contains("Oliver Smith"); + cy.get( + '[data-cy="screen-field-form_select_list_5"] .multiselect__single' + ).contains("Oliver Smith"); + cy.get( + '[data-cy="screen-field-form_select_list_6"] .multiselect__single' + ).contains("Oliver Smith"); // Check the data of the screen cy.assertPreviewData({ - 'form_select_list_1': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_1: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_2': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_2: { + last: "Smith", + first: "Oliver" }, - 'form_select_list_3': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_3: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_4': '1', - 'form_select_list_5': 'Oliver Smith', - 'form_select_list_6': '1', + form_select_list_4: "1", + form_select_list_5: "Oliver Smith", + form_select_list_6: "1" }); }); - it('Verify Load values in radio list mustache + collection', () => { - cy.loadFromJson('select_list_radio_collection.json', 0); + it("Verify Load values in radio list mustache + collection", () => { + cy.loadFromJson("select_list_radio_collection.json", 0); cy.setPreviewDataInput({ - 'form_select_list_1': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_1: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_2': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_2: { + last: "Smith", + first: "Oliver" }, - 'form_select_list_3': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_3: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_4': '1', - 'form_select_list_5': 'Oliver Smith', - 'form_select_list_6': '1', + form_select_list_4: "1", + form_select_list_5: "Oliver Smith", + form_select_list_6: "1" }); - cy.get('[data-cy=mode-preview]').click(); - - cy.get('[data-cy="screen-field-form_select_list_1"] + .form-check-label:contains("1234")').parent().find('input').should('be.checked'); - cy.get('[data-cy="screen-field-form_select_list_2"] + .form-check-label:contains("Oliver")').parent().find('input').should('be.checked'); - cy.get('[data-cy="screen-field-form_select_list_3"] + .form-check-label:contains("DNI: 1234 Name: Oliver Smith")').parent().find('input').should('be.checked'); - cy.get('[data-cy="screen-field-form_select_list_4"] + .form-check-label:contains("Oliver Smith")').parent().find('input').should('be.checked'); - cy.get('[data-cy="screen-field-form_select_list_5"] + .form-check-label:contains("Oliver Smith")').parent().find('input').should('be.checked'); - cy.get('[data-cy="screen-field-form_select_list_6"] + .form-check-label:contains("Oliver Smith")').parent().find('input').should('be.checked'); + cy.get("[data-cy=mode-preview]").click(); + + cy.get( + '[data-cy="screen-field-form_select_list_1"] + .form-check-label:contains("1234")' + ) + .parent() + .find("input") + .should("be.checked"); + cy.get( + '[data-cy="screen-field-form_select_list_2"] + .form-check-label:contains("Oliver")' + ) + .parent() + .find("input") + .should("be.checked"); + cy.get( + '[data-cy="screen-field-form_select_list_3"] + .form-check-label:contains("DNI: 1234 Name: Oliver Smith")' + ) + .parent() + .find("input") + .should("be.checked"); + cy.get( + '[data-cy="screen-field-form_select_list_4"] + .form-check-label:contains("Oliver Smith")' + ) + .parent() + .find("input") + .should("be.checked"); + cy.get( + '[data-cy="screen-field-form_select_list_5"] + .form-check-label:contains("Oliver Smith")' + ) + .parent() + .find("input") + .should("be.checked"); + cy.get( + '[data-cy="screen-field-form_select_list_6"] + .form-check-label:contains("Oliver Smith")' + ) + .parent() + .find("input") + .should("be.checked"); // Check the data of the screen cy.assertPreviewData({ - 'form_select_list_1': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_1: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_2': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_2: { + last: "Smith", + first: "Oliver" }, - 'form_select_list_3': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_3: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'form_select_list_4': '1', - 'form_select_list_5': 'Oliver Smith', - 'form_select_list_6': '1', + form_select_list_4: "1", + form_select_list_5: "Oliver Smith", + form_select_list_6: "1" }); }); - it('Verify Load value in check list mustache + collection', () => { - cy.loadFromJson('select_list_checkbox_collection.json', 0); + it("Verify Load value in check list mustache + collection", () => { + cy.loadFromJson("select_list_checkbox_collection.json", 0); cy.setPreviewDataInput({ - 'form_select_list_1': [ + form_select_list_1: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + dni: "5678", + name: { + last: "Doe", + first: "John" }, - 'id': 2, - }, + id: 2 + } ], - 'form_select_list_2': [ + form_select_list_2: [ { - 'last': 'Smith', - 'first': 'Oliver', + last: "Smith", + first: "Oliver" }, { - 'last': 'Doe', - 'first': 'John', - }, + last: "Doe", + first: "John" + } ], - 'form_select_list_3': [ + form_select_list_3: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + dni: "5678", + name: { + last: "Doe", + first: "John" }, - 'id': 2, - }, - ], - 'form_select_list_4': [ - '1', - '2', - ], - 'form_select_list_5': [ - 'Oliver Smith', - 'John Doe', - ], - 'form_select_list_6': [ - '1', - '2', + id: 2 + } ], + form_select_list_4: ["1", "2"], + form_select_list_5: ["Oliver Smith", "John Doe"], + form_select_list_6: ["1", "2"] }); - cy.get('[data-cy=mode-preview]').click(); - - cy.get('[data-cy="screen-field-form_select_list_1"] + .form-check-label:contains("1234")').parent().find('input').should('be.checked'); - cy.get('[data-cy="screen-field-form_select_list_1"] + .form-check-label:contains("5678")').parent().find('input').should('be.checked'); - - cy.get('[data-cy="screen-field-form_select_list_2"] + .form-check-label:contains("Oliver")').parent().find('input').should('be.checked'); - cy.get('[data-cy="screen-field-form_select_list_2"] + .form-check-label:contains("John")').parent().find('input').should('be.checked'); - - cy.get('[data-cy="screen-field-form_select_list_3"] + .form-check-label:contains("DNI: 1234 Name: Oliver Smith")').parent().find('input').should('be.checked'); - cy.get('[data-cy="screen-field-form_select_list_3"] + .form-check-label:contains("DNI: 5678 Name: John Doe")').parent().find('input').should('be.checked'); - - cy.get('[data-cy="screen-field-form_select_list_4"] + .form-check-label:contains("Oliver Smith")').parent().find('input').should('be.checked'); - cy.get('[data-cy="screen-field-form_select_list_4"] + .form-check-label:contains("John Doe")').parent().find('input').should('be.checked'); - - cy.get('[data-cy="screen-field-form_select_list_5"] + .form-check-label:contains("Oliver Smith")').parent().find('input').should('be.checked'); - cy.get('[data-cy="screen-field-form_select_list_5"] + .form-check-label:contains("John Doe")').parent().find('input').should('be.checked'); - - cy.get('[data-cy="screen-field-form_select_list_6"] + .form-check-label:contains("Oliver Smith")').parent().find('input').should('be.checked'); - cy.get('[data-cy="screen-field-form_select_list_6"] + .form-check-label:contains("John Doe")').parent().find('input').should('be.checked'); + cy.get("[data-cy=mode-preview]").click(); + + cy.get( + '[data-cy="screen-field-form_select_list_1"] + .form-check-label:contains("1234")' + ) + .parent() + .find("input") + .should("be.checked"); + cy.get( + '[data-cy="screen-field-form_select_list_1"] + .form-check-label:contains("5678")' + ) + .parent() + .find("input") + .should("be.checked"); + + cy.get( + '[data-cy="screen-field-form_select_list_2"] + .form-check-label:contains("Oliver")' + ) + .parent() + .find("input") + .should("be.checked"); + cy.get( + '[data-cy="screen-field-form_select_list_2"] + .form-check-label:contains("John")' + ) + .parent() + .find("input") + .should("be.checked"); + + cy.get( + '[data-cy="screen-field-form_select_list_3"] + .form-check-label:contains("DNI: 1234 Name: Oliver Smith")' + ) + .parent() + .find("input") + .should("be.checked"); + cy.get( + '[data-cy="screen-field-form_select_list_3"] + .form-check-label:contains("DNI: 5678 Name: John Doe")' + ) + .parent() + .find("input") + .should("be.checked"); + + cy.get( + '[data-cy="screen-field-form_select_list_4"] + .form-check-label:contains("Oliver Smith")' + ) + .parent() + .find("input") + .should("be.checked"); + cy.get( + '[data-cy="screen-field-form_select_list_4"] + .form-check-label:contains("John Doe")' + ) + .parent() + .find("input") + .should("be.checked"); + + cy.get( + '[data-cy="screen-field-form_select_list_5"] + .form-check-label:contains("Oliver Smith")' + ) + .parent() + .find("input") + .should("be.checked"); + cy.get( + '[data-cy="screen-field-form_select_list_5"] + .form-check-label:contains("John Doe")' + ) + .parent() + .find("input") + .should("be.checked"); + + cy.get( + '[data-cy="screen-field-form_select_list_6"] + .form-check-label:contains("Oliver Smith")' + ) + .parent() + .find("input") + .should("be.checked"); + cy.get( + '[data-cy="screen-field-form_select_list_6"] + .form-check-label:contains("John Doe")' + ) + .parent() + .find("input") + .should("be.checked"); // Check the data of the screen cy.assertPreviewData({ - 'form_select_list_1': [ + form_select_list_1: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + dni: "5678", + name: { + last: "Doe", + first: "John" }, - 'id': 2, - }, + id: 2 + } ], - 'form_select_list_2': [ + form_select_list_2: [ { - 'last': 'Smith', - 'first': 'Oliver', + last: "Smith", + first: "Oliver" }, { - 'last': 'Doe', - 'first': 'John', - }, + last: "Doe", + first: "John" + } ], - 'form_select_list_3': [ + form_select_list_3: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + dni: "5678", + name: { + last: "Doe", + first: "John" }, - 'id': 2, - }, - ], - 'form_select_list_4': [ - '1', - '2', - ], - 'form_select_list_5': [ - 'Oliver Smith', - 'John Doe', - ], - 'form_select_list_6': [ - '1', - '2', + id: 2 + } ], + form_select_list_4: ["1", "2"], + form_select_list_5: ["Oliver Smith", "John Doe"], + form_select_list_6: ["1", "2"] }); }); - it('Verify Load values in multiselect list mustache + collection', () => { - cy.loadFromJson('select_list_multiselect_collection.json', 0); + it("Verify Load values in multiselect list mustache + collection", () => { + cy.loadFromJson("select_list_multiselect_collection.json", 0); cy.setPreviewDataInput({ - 'form_select_list_1': [ + form_select_list_1: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'id': 2, - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', - }, - }, + id: 2, + dni: "5678", + name: { + last: "Doe", + first: "John" + } + } ], - 'form_select_list_2': [ + form_select_list_2: [ { - 'last': 'Smith', - 'first': 'Oliver', + last: "Smith", + first: "Oliver" }, { - 'last': 'Doe', - 'first': 'John', - }, + last: "Doe", + first: "John" + } ], - 'form_select_list_3': [ + form_select_list_3: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + dni: "5678", + name: { + last: "Doe", + first: "John" }, - 'id': 2, - }, - ], - 'form_select_list_4': [ - '1', - '2', - ], - 'form_select_list_5': [ - 'Oliver Smith', - 'John Doe', - ], - 'form_select_list_6': [ - '1', - '2', + id: 2 + } ], + form_select_list_4: ["1", "2"], + form_select_list_5: ["Oliver Smith", "John Doe"], + form_select_list_6: ["1", "2"] }); - cy.get('[data-cy=mode-preview]').click(); - - cy.get('[data-cy="screen-field-form_select_list_1"] .multiselect__tag:contains("1234")').contains('1234'); - cy.get('[data-cy="screen-field-form_select_list_1"] .multiselect__tag:contains("5678")').contains('5678'); - - cy.get('[data-cy="screen-field-form_select_list_2"] .multiselect__tag:contains("Oliver")').contains('Oliver'); - cy.get('[data-cy="screen-field-form_select_list_2"] .multiselect__tag:contains("John")').contains('John'); - - cy.get('[data-cy="screen-field-form_select_list_3"] .multiselect__tag:contains("DNI: 1234 Name: Oliver Smith")').contains('DNI: 1234 Name: Oliver Smith'); - cy.get('[data-cy="screen-field-form_select_list_3"] .multiselect__tag:contains("DNI: 5678 Name: John Doe")').contains('DNI: 5678 Name: John Doe'); - - cy.get('[data-cy="screen-field-form_select_list_4"] .multiselect__tag:contains("Oliver Smith")').contains('Oliver Smith'); - cy.get('[data-cy="screen-field-form_select_list_4"] .multiselect__tag:contains("John Doe")').contains('John Doe'); - - cy.get('[data-cy="screen-field-form_select_list_5"] .multiselect__tag:contains("Oliver Smith")').contains('Oliver Smith'); - cy.get('[data-cy="screen-field-form_select_list_5"] .multiselect__tag:contains("John Doe")').contains('John Doe'); - - cy.get('[data-cy="screen-field-form_select_list_6"] .multiselect__tag:contains("Oliver Smith")').contains('Oliver Smith'); - cy.get('[data-cy="screen-field-form_select_list_6"] .multiselect__tag:contains("John Doe")').contains('John Doe'); + cy.get("[data-cy=mode-preview]").click(); + + cy.get( + '[data-cy="screen-field-form_select_list_1"] .multiselect__tag:contains("1234")' + ).contains("1234"); + cy.get( + '[data-cy="screen-field-form_select_list_1"] .multiselect__tag:contains("5678")' + ).contains("5678"); + + cy.get( + '[data-cy="screen-field-form_select_list_2"] .multiselect__tag:contains("Oliver")' + ).contains("Oliver"); + cy.get( + '[data-cy="screen-field-form_select_list_2"] .multiselect__tag:contains("John")' + ).contains("John"); + + cy.get( + '[data-cy="screen-field-form_select_list_3"] .multiselect__tag:contains("DNI: 1234 Name: Oliver Smith")' + ).contains("DNI: 1234 Name: Oliver Smith"); + cy.get( + '[data-cy="screen-field-form_select_list_3"] .multiselect__tag:contains("DNI: 5678 Name: John Doe")' + ).contains("DNI: 5678 Name: John Doe"); + + cy.get( + '[data-cy="screen-field-form_select_list_4"] .multiselect__tag:contains("Oliver Smith")' + ).contains("Oliver Smith"); + cy.get( + '[data-cy="screen-field-form_select_list_4"] .multiselect__tag:contains("John Doe")' + ).contains("John Doe"); + + cy.get( + '[data-cy="screen-field-form_select_list_5"] .multiselect__tag:contains("Oliver Smith")' + ).contains("Oliver Smith"); + cy.get( + '[data-cy="screen-field-form_select_list_5"] .multiselect__tag:contains("John Doe")' + ).contains("John Doe"); + + cy.get( + '[data-cy="screen-field-form_select_list_6"] .multiselect__tag:contains("Oliver Smith")' + ).contains("Oliver Smith"); + cy.get( + '[data-cy="screen-field-form_select_list_6"] .multiselect__tag:contains("John Doe")' + ).contains("John Doe"); // Check the data of the screen cy.assertPreviewData({ - 'form_select_list_1': [ + form_select_list_1: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + dni: "5678", + name: { + last: "Doe", + first: "John" }, - 'id': 2, - }, + id: 2 + } ], - 'form_select_list_2': [ + form_select_list_2: [ { - 'last': 'Smith', - 'first': 'Oliver', + last: "Smith", + first: "Oliver" }, { - 'last': 'Doe', - 'first': 'John', - }, + last: "Doe", + first: "John" + } ], - 'form_select_list_3': [ + form_select_list_3: [ { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + dni: "5678", + name: { + last: "Doe", + first: "John" }, - 'id': 2, - }, - ], - 'form_select_list_4': [ - '1', - '2', - ], - 'form_select_list_5': [ - 'Oliver Smith', - 'John Doe', - ], - 'form_select_list_6': [ - '1', - '2', + id: 2 + } ], + form_select_list_4: ["1", "2"], + form_select_list_5: ["Oliver Smith", "John Doe"], + form_select_list_6: ["1", "2"] }); }); }); diff --git a/tests/e2e/specs/SelectListDataSource.spec.js b/tests/e2e/specs/SelectListDataSource.spec.js index e047598ee..e444515de 100644 --- a/tests/e2e/specs/SelectListDataSource.spec.js +++ b/tests/e2e/specs/SelectListDataSource.spec.js @@ -1,142 +1,146 @@ -describe('Select List with DataSource', () => { +describe("Select List with DataSource", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); - cy.route( - 'POST', - '/api/1.0/requests/data_sources/2', + cy.visit("/"); + cy.intercept( + "POST", + "/api/1.0/requests/data_sources/2", JSON.stringify({ - 'status': 200, - 'response': { - 'data': [{ - 'id': 1, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + status: 200, + response: { + data: [ + { + id: 1, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" + }, + id: 1 }, - 'id': 1, - }, - 'collection_id': 1, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }, { - 'id': 2, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'dni': '5678', - 'name': { - 'last': 'Doe', - 'first': 'John', + collection_id: 1, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" }, - 'id': 2, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } }, - 'collection_id': 1, - 'title': '2', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }], - 'meta': { - 'filter': '', - 'sort_by': '', - 'sort_order': '', - 'count': 2, - 'total_pages': 1, - 'current_page': 1, - 'from': 1, - 'last_page': 1, - 'path': '/api/1.0/collections/1/records', - 'per_page': 9223372036854775807, - 'to': 2, - 'total': 2, - }, - }, + { + id: 2, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + dni: "5678", + name: { + last: "Doe", + first: "John" + }, + id: 2 + }, + collection_id: 1, + title: "2", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } + ], + meta: { + filter: "", + sort_by: "", + sort_order: "", + count: 2, + total_pages: 1, + current_page: 1, + from: 1, + last_page: 1, + path: "/api/1.0/collections/1/records", + per_page: 9223372036854775807, + to: 2, + total: 2 + } + } }) - ).as('executeScript'); + ).as("executeScript"); }); - it('Verify Load values in select list using mustache from root data from DataSource', () => { - cy.loadFromJson('select_list_datasource.json', 0); + it("Verify Load values in select list using mustache from root data from DataSource", () => { + cy.loadFromJson("select_list_datasource.json", 0); cy.setPreviewDataInput({ - 'form_select_list_1': { - 'id': 1, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_1: { + id: 1, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, + id: 1 }, - 'collection_id': 1, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', + collection_id: 1, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } }); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy="screen-field-form_select_list_1"] .multiselect__single').contains('1'); + cy.get( + '[data-cy="screen-field-form_select_list_1"] .multiselect__single' + ).contains("1"); // Check the data of the screen cy.assertPreviewData({ - 'form_select_list_1': { - 'id': 1, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'dni': '1234', - 'name': { - 'last': 'Smith', - 'first': 'Oliver', + form_select_list_1: { + id: 1, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + dni: "1234", + name: { + last: "Smith", + first: "Oliver" }, - 'id': 1, - }, - 'collection_id': 1, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', + id: 1 }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', + collection_id: 1, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" }, - }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } }); }); }); diff --git a/tests/e2e/specs/SelectListDefaultValues.spec.js b/tests/e2e/specs/SelectListDefaultValues.spec.js index 56ac95a2a..fea78af21 100644 --- a/tests/e2e/specs/SelectListDefaultValues.spec.js +++ b/tests/e2e/specs/SelectListDefaultValues.spec.js @@ -1,44 +1,43 @@ -describe('Select List default Value', () => { +describe("Select List default Value", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('Verify default value not existing in option list set value to null', () => { - cy.loadFromJson('select_list_default_value.json', 0); - + it("Verify default value not existing in option list set value to null", () => { + cy.loadFromJson("select_list_default_value.json", 0); + // Configure a non existing default value in option list - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-defaultValue-basicValue]').clear().type('c'); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-defaultValue-basicValue]").clear().type("c"); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Assert value was configured in null cy.assertPreviewData({ - 'form_select_list_1': null + form_select_list_1: null }); // Select a valid option - cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption('a'); + cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption("a"); // Assert value is set correctly cy.assertPreviewData({ - 'form_select_list_1': 'a' + form_select_list_1: "a" }); - cy.get('[data-cy=mode-editor]').click(); + cy.get("[data-cy=mode-editor]").click(); // Configure an existing default value in option list - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-defaultValue-basicValue]').clear().type('b'); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-defaultValue-basicValue]").clear().type("b"); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Assert default valid value is set correctly cy.assertPreviewData({ - 'form_select_list_1': 'b' + form_select_list_1: "b" }); }); }); diff --git a/tests/e2e/specs/SelectListDependent.spec.js b/tests/e2e/specs/SelectListDependent.spec.js index 7382f2a04..57cf7a5a2 100644 --- a/tests/e2e/specs/SelectListDependent.spec.js +++ b/tests/e2e/specs/SelectListDependent.spec.js @@ -1,437 +1,465 @@ -describe('select list mustache', () => { +describe("select list mustache", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); - cy.route( - 'POST', - '/api/1.0/requests/data_sources/3', + cy.visit("/"); + cy.intercept( + "POST", + "/api/1.0/requests/data_sources/3", JSON.stringify({ - 'status': 200, - 'response': { - 'data': [{ - 'id': 1, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 1, - 'name': 'Bolivia', + status: 200, + response: { + data: [ + { + id: 1, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 1, + name: "Bolivia" + }, + collection_id: 3, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } }, - 'collection_id': 3, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }, { - 'id': 2, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 2, - 'name': 'United States', - }, - 'collection_id': 3, - 'title': '2', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }], - 'meta': { - 'filter': '', - 'sort_by': '', - 'sort_order': '', - 'count': 2, - 'total_pages': 1, - 'current_page': 1, - 'from': 1, - 'last_page': 1, - 'path': '/api/1.0/collections/3/records', - 'per_page': 9223372036854775807, - 'to': 2, - 'total': 2, - }, - }, + { + id: 2, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 2, + name: "United States" + }, + collection_id: 3, + title: "2", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } + ], + meta: { + filter: "", + sort_by: "", + sort_order: "", + count: 2, + total_pages: 1, + current_page: 1, + from: 1, + last_page: 1, + path: "/api/1.0/collections/3/records", + per_page: 9223372036854775807, + to: 2, + total: 2 + } + } }) - ).as('executeScript'); + ).as("executeScript"); // Bolivia Cities - const BoliviaCities = [{ - 'id': 1, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 1, - 'name': 'La Paz', - }, - 'collection_id': 4, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }, { - 'id': 2, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 2, - 'name': 'Santa Cruz', - }, - 'collection_id': 4, - 'title': '2', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', + const BoliviaCities = [ + { + id: 1, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 1, + name: "La Paz" + }, + collection_id: 4, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } }, - }]; + { + id: 2, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 2, + name: "Santa Cruz" + }, + collection_id: 4, + title: "2", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } + ]; // US Cities - const USCities = [{ - 'id': 3, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 3, - 'name': 'Las Vegas', - }, - 'collection_id': 4, - 'title': '1', - 'created_by': { - 'id': 1, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 1, - 'email': 'admin@processmaker.com', - }, - }, { - 'id': 4, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 4, - 'name': 'Asheville', - }, - 'collection_id': 4, - 'title': '2', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', + const USCities = [ + { + id: 3, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 3, + name: "Las Vegas" + }, + collection_id: 4, + title: "1", + created_by: { + id: 1, + email: "admin@processmaker.com" + }, + updated_by: { + id: 1, + email: "admin@processmaker.com" + } }, - }]; + { + id: 4, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 4, + name: "Asheville" + }, + collection_id: 4, + title: "2", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } + ]; let cities = []; - cy.route({ - method: 'POST', - url: '/api/1.0/requests/data_sources/4', - onRequest: ({ xhr, request }) => { - switch (request.body.config.outboundConfig[0].value) { - case 'data.country_id=1': - cities = BoliviaCities; - break; - case 'data.country_id=2': - cities = USCities; - break; - default: - cities = []; + cy.intercept("POST", "/api/1.0/requests/data_sources/4", (req) => { + switch (req.body.config.outboundConfig[0].value) { + case "data.country_id=1": + cities = BoliviaCities; + break; + case "data.country_id=2": + cities = USCities; + break; + default: + cities = []; + } + const response = { + data: cities, + meta: { + filter: "", + sort_by: "", + sort_order: "", + count: cities.length, + total_pages: 1, + current_page: 1, + from: 1, + last_page: 1, + path: "/api/1.0/collections/4/records", + per_page: 9223372036854775807, + to: cities.length, + total: cities.length } - const response = { - 'data': cities, - 'meta': { - 'filter': '', - 'sort_by': '', - 'sort_order': '', - 'count': cities.length, - 'total_pages': 1, - 'current_page': 1, - 'from': 1, - 'last_page': 1, - 'path': '/api/1.0/collections/4/records', - 'per_page': 9223372036854775807, - 'to': cities.length, - 'total': cities.length, - }, - }; - xhr.setRequestHeader( - 'X-Cypress-Response', - '"response":' + JSON.stringify(response) + '}', - ); - }, - response: '{"status": 200', + }; + req.reply({ + headers: { + "X-Cypress-Response": `"response":${JSON.stringify(response)}}` + }, + statusCode: 200, + body: { response } + }); }); - + // La Paz addresses - const LaPazAddresses = [{ - 'id': 1, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 1, - 'name': 'My address in La Paz 1', - }, - 'collection_id': 5, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }, { - 'id': 2, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 2, - 'name': 'My address in La Paz 2', - }, - 'collection_id': 5, - 'title': '2', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', + const LaPazAddresses = [ + { + id: 1, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 1, + name: "My address in La Paz 1" + }, + collection_id: 5, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } }, - }]; + { + id: 2, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 2, + name: "My address in La Paz 2" + }, + collection_id: 5, + title: "2", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } + ]; // Santa Cruz addresses - const SantaCruzAddresses = [{ - 'id': 1, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 1, - 'name': 'My address in Santa Cruz 1', - }, - 'collection_id': 5, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }, { - 'id': 2, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 2, - 'name': 'My address in Santa Cruz 2', - }, - 'collection_id': 5, - 'title': '2', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', + const SantaCruzAddresses = [ + { + id: 1, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 1, + name: "My address in Santa Cruz 1" + }, + collection_id: 5, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } }, - }]; + { + id: 2, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 2, + name: "My address in Santa Cruz 2" + }, + collection_id: 5, + title: "2", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } + ]; // LasVegas addresses - const LasVegasAddresses = [{ - 'id': 3, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 3, - 'name': 'My address in Las Vegas 1', - }, - 'collection_id': 5, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }, { - 'id': 4, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 4, - 'name': 'My address in Las Vegas 2', - }, - 'collection_id': 5, - 'title': '2', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', + const LasVegasAddresses = [ + { + id: 3, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 3, + name: "My address in Las Vegas 1" + }, + collection_id: 5, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } }, - }]; + { + id: 4, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 4, + name: "My address in Las Vegas 2" + }, + collection_id: 5, + title: "2", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } + ]; // Asheville addresses - const AshevilleAddresses = [{ - 'id': 5, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 5, - 'name': 'My address in Asheville 1', - }, - 'collection_id': 5, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }, { - 'id': 6, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'id': 6, - 'name': 'My address in Asheville 2', - }, - 'collection_id': 5, - 'title': '2', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', + const AshevilleAddresses = [ + { + id: 5, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 5, + name: "My address in Asheville 1" + }, + collection_id: 5, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } }, - }]; + { + id: 6, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + id: 6, + name: "My address in Asheville 2" + }, + collection_id: 5, + title: "2", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } + ]; let addresses = []; - cy.route({ - method: 'POST', - url: '/api/1.0/requests/data_sources/5', - onRequest: ({ xhr, request }) => { - switch (request.body.config.outboundConfig[0].value) { - case 'data.city_id=1': - addresses = LaPazAddresses; - break; - case 'data.city_id=2': - addresses = SantaCruzAddresses; - break; - case 'data.city_id=3': - addresses = LasVegasAddresses; - break; - case 'data.city_id=4': - addresses = AshevilleAddresses; - break; - default: - addresses = []; + cy.intercept("POST", "/api/1.0/requests/data_sources/5", (req) => { + switch (req.body.config.outboundConfig[0].value) { + case "data.city_id=1": + addresses = LaPazAddresses; + break; + case "data.city_id=2": + addresses = SantaCruzAddresses; + break; + case "data.city_id=3": + addresses = LasVegasAddresses; + break; + case "data.city_id=4": + addresses = AshevilleAddresses; + break; + default: + addresses = []; + } + const response = { + data: addresses, + meta: { + filter: "", + sort_by: "", + sort_order: "", + count: addresses.length, + total_pages: 1, + current_page: 1, + from: 1, + last_page: 1, + path: "/api/1.0/collections/5/records", + per_page: 9223372036854775807, + to: addresses.length, + total: addresses.length } - const response = { - 'data': addresses, - 'meta': { - 'filter': '', - 'sort_by': '', - 'sort_order': '', - 'count': addresses.length, - 'total_pages': 1, - 'current_page': 1, - 'from': 1, - 'last_page': 1, - 'path': '/api/1.0/collections/5/records', - 'per_page': 9223372036854775807, - 'to': addresses.length, - 'total': addresses.length, - }, - }; - xhr.setRequestHeader( - 'X-Cypress-Response', - '"response":' + JSON.stringify(response) + '}', - ); - }, - response: '{"status": 200', + }; + req.reply({ + headers: { + "X-Cypress-Response": `"response":${JSON.stringify(response)}}` + }, + statusCode: 200, + body: { response } + }); }); }); - it.skip('Verify Load values in multiselect list mustache + collection', () => { - cy.loadFromJson('select_list_dependent.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Verify Load values in multiselect list mustache + collection", () => { + cy.loadFromJson("select_list_dependent.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Country should be empty - cy.get('[data-cy="screen-field-country"] .multiselect__placeholder').should('be.visible'); + cy.get('[data-cy="screen-field-country"] .multiselect__placeholder').should( + "be.visible" + ); // City should be empty - cy.get('[data-cy="screen-field-city"] .multiselect__placeholder').should('be.visible'); + cy.get('[data-cy="screen-field-city"] .multiselect__placeholder').should( + "be.visible" + ); - cy.get('[data-cy="screen-field-country"]').selectOption('Bolivia'); - cy.get('[data-cy="screen-field-city"]').selectOption('La Paz'); - cy.get('[data-cy="screen-field-address"]').selectOption('My address in La Paz 1'); - cy.get('[data-cy="screen-field-country"]').selectOption('United States'); + cy.get('[data-cy="screen-field-country"]').selectOption("Bolivia"); + cy.get('[data-cy="screen-field-city"]').selectOption("La Paz"); + cy.get('[data-cy="screen-field-address"]').selectOption( + "My address in La Paz 1" + ); + cy.get('[data-cy="screen-field-country"]').selectOption("United States"); // Once selected a different country city should be cleaned - cy.get('[data-cy="screen-field-city"] .multiselect__placeholder').should('be.visible'); - cy.get('[data-cy="screen-field-address"] .multiselect__placeholder').should('be.visible'); - cy.get('[data-cy="screen-field-city"]').selectOption('Asheville'); - cy.get('[data-cy="screen-field-address"]').selectOption('My address in Asheville 2'); + cy.get('[data-cy="screen-field-city"] .multiselect__placeholder').should( + "be.visible" + ); + cy.get('[data-cy="screen-field-address"] .multiselect__placeholder').should( + "be.visible" + ); + cy.get('[data-cy="screen-field-city"]').selectOption("Asheville"); + cy.get('[data-cy="screen-field-address"]').selectOption( + "My address in Asheville 2" + ); cy.assertPreviewData({ - 'country': '2', - 'city': '4', - 'address': '6', + country: "2", + city: "4", + address: "6" }); }); }); diff --git a/tests/e2e/specs/SelectListDependentCollection.spec.js b/tests/e2e/specs/SelectListDependentCollection.spec.js index 0fb19e3a3..9bd71508d 100644 --- a/tests/e2e/specs/SelectListDependentCollection.spec.js +++ b/tests/e2e/specs/SelectListDependentCollection.spec.js @@ -1,73 +1,76 @@ -describe('select list dependent collection', () => { +describe("select list dependent collection", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); - cy.route( - 'GET', - '/api/1.0/collections*', + cy.intercept( + "GET", + "/api/1.0/collections*", JSON.stringify({ - 'data': [ - { 'id': 88, 'name': 'States', }, - { 'id': 99, 'name': 'Cities', }, - ], + data: [ + { id: 88, name: "States" }, + { id: 99, name: "Cities" } + ] }) ); - - cy.route( - 'GET', - '/api/1.0/collections/88/columns*', + + cy.intercept( + "GET", + "/api/1.0/collections/88/columns*", JSON.stringify({ - 'data': [ - { 'label': 'name', 'field': 'data.name' }, - { 'label': 'code', 'field': 'data.code' }, - ], + data: [ + { label: "name", field: "data.name" }, + { label: "code", field: "data.code" } + ] }) ); - - cy.route( - 'GET', - '/api/1.0/collections/99/columns*', + + cy.intercept( + "GET", + "/api/1.0/collections/99/columns*", JSON.stringify({ - 'data': [ - { 'label': 'city', 'field': 'data.city' }, - { 'label': 'state', 'field': 'data.state' }, - ], + data: [ + { label: "city", field: "data.city" }, + { label: "state", field: "data.state" } + ] }) ); - - cy.route( - 'GET', - '/api/1.0/collections/88/records*', + + cy.intercept( + "GET", + "/api/1.0/collections/88/records*", JSON.stringify({ - 'data': [ - { id: 123, data: { name: 'California', code: 'CA' } }, - { id: 456, data: { name: 'Nevada', code: 'NV' } }, - ], + data: [ + { id: 123, data: { name: "California", code: "CA" } }, + { id: 456, data: { name: "Nevada", code: "NV" } } + ] }) ); - - cy.route('GET', /collections\/99\/records.*NV/, + + cy.intercept( + "GET", + /collections\/99\/records.*NV/, JSON.stringify({ data: [ - { id: 123, data: { city: 'Las Vegas' } }, - { id: 456, data: { city: 'Reno'} }, + { id: 123, data: { city: "Las Vegas" } }, + { id: 456, data: { city: "Reno" } } ], meta: { total: 400 } }) ); - + // load individual record - cy.route('GET', /collections\/99\/records.*NV.*(Henderson|789)/, + cy.intercept( + "GET", + /collections\/99\/records.*NV.*(Henderson|789)/, JSON.stringify({ - data: [ - { id: 789, data: { city: 'Henderson' } }, - ], + data: [{ id: 789, data: { city: "Henderson" } }], meta: { total: 1 } }) ); - - cy.route('GET', /collections\/99\/records.*3344/, + + cy.intercept( + "GET", + /collections\/99\/records.*3344/, JSON.stringify({ data: [], meta: { total: 0 } @@ -75,76 +78,84 @@ describe('select list dependent collection', () => { ); }); - it('Configure collection select list', () => { + it("Configure collection select list", () => { cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormSelectList]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-DataSource]').click(); - - cy.get('[data-cy=inspector-data-sources]').select('Collection'); - cy.get('[data-cy=inspector-collection]').select('States'); - cy.get('[data-cy=inspector-collection-label]').select('name'); - cy.get('[data-cy=inspector-collection-value]').select('Collection Record ID'); - - cy.get('[data-cy=mode-preview]').click(); - + cy.get("[data-cy=controls-FormSelectList]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-DataSource]").click(); + + cy.get("[data-cy=inspector-data-sources]").select("Collection"); + cy.get("[data-cy=inspector-collection]").select("States"); + cy.get("[data-cy=inspector-collection-label]").select("name"); + cy.get("[data-cy=inspector-collection-value]").select( + "Collection Record ID" + ); + + cy.get("[data-cy=mode-preview]").click(); + // Select a valid option - cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption('Nevada'); + cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption( + "Nevada" + ); // Assert value is set correctly cy.assertPreviewData({ - 'form_select_list_1': '456' + form_select_list_1: "456" }); }); - it('Without dependent list option checked', () => { - cy.loadFromJson('select_list_dependent_collection.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy="screen-field-state"]').selectOption('Nevada'); - cy.get('[data-cy="screen-field-city"]').selectOption('Henderson'); + it("Without dependent list option checked", () => { + cy.loadFromJson("select_list_dependent_collection.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy="screen-field-state"]').selectOption("Nevada"); + cy.get('[data-cy="screen-field-city"]').selectOption("Henderson"); cy.assertPreviewData({ - state: 'NV', - city: '789', - id_gt_than: '33', + state: "NV", + city: "789", + id_gt_than: "33", form_select_list_2: null }); // Updating a value referenced with mustache in the PMQL should trigger a backend call - cy.get('[data-cy="screen-field-id_gt_than"]').type('44'); + cy.get('[data-cy="screen-field-id_gt_than"]').type("44"); cy.assertPreviewData({ - state: 'NV', + state: "NV", city: null, // Reset value since it's not in the results id_gt_than: 3344, form_select_list_2: null }); }); - describe('with city and state set', () => { + describe("with city and state set", () => { const setup = () => { - cy.loadFromJson('select_list_dependent_collection.json', 0); + cy.loadFromJson("select_list_dependent_collection.json", 0); cy.setPreviewDataInput({ - 'city': '789', - 'state': 'NV', + city: "789", + state: "NV" }); - }; const assert = () => { - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy="screen-field-city"] .multiselect__single').should('have.text', 'Henderson'); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy="screen-field-city"] .multiselect__single').should( + "have.text", + "Henderson" + ); cy.assertPreviewData({ - state: 'NV', - city: '789', - id_gt_than: '33', + state: "NV", + city: "789", + id_gt_than: "33", form_select_list_2: null }); - } + }; it("Sets the correct city in the select list", () => { setup(); assert(); }); - }); -}); \ No newline at end of file +}); diff --git a/tests/e2e/specs/SelectListMustache.spec.js b/tests/e2e/specs/SelectListMustache.spec.js index 7f8d5ae56..b28c384ed 100644 --- a/tests/e2e/specs/SelectListMustache.spec.js +++ b/tests/e2e/specs/SelectListMustache.spec.js @@ -1,159 +1,163 @@ -describe('select list mustache', () => { +describe("select list mustache", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); - cy.route( - 'POST', - '/api/1.0/requests/data_sources/2', + cy.visit("/"); + cy.intercept( + "POST", + "/api/1.0/requests/data_sources/2", JSON.stringify({ - 'status': 200, - 'response': { - 'data': [{ - 'id': 1, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'dni': '1234', - 'name': { - 'last': 'Callizaya', - 'first': 'David', + status: 200, + response: { + data: [ + { + id: 1, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + dni: "1234", + name: { + last: "Callizaya", + first: "David" + }, + id: 1 }, - 'id': 1, - }, - 'collection_id': 1, - 'title': '1', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }, { - 'id': 2, - 'created_by_id': 2, - 'updated_by_id': 2, - 'created_at': '2021-11-08 10:29:56', - 'updated_at': '2021-11-08 10:29:56', - 'data': { - 'dni': '5678', - 'name': { - 'last': 'Loayza', - 'first': 'Dante', + collection_id: 1, + title: "1", + created_by: { + id: 2, + email: "admin@processmaker.com" }, - 'id': 2, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } }, - 'collection_id': 1, - 'title': '2', - 'created_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - 'updated_by': { - 'id': 2, - 'email': 'admin@processmaker.com', - }, - }], - 'meta': { - 'filter': '', - 'sort_by': '', - 'sort_order': '', - 'count': 2, - 'total_pages': 1, - 'current_page': 1, - 'from': 1, - 'last_page': 1, - 'path': '/api/1.0/collections/1/records', - 'per_page': 9223372036854775807, - 'to': 2, - 'total': 2, - }, - }, + { + id: 2, + created_by_id: 2, + updated_by_id: 2, + created_at: "2021-11-08 10:29:56", + updated_at: "2021-11-08 10:29:56", + data: { + dni: "5678", + name: { + last: "Loayza", + first: "Dante" + }, + id: 2 + }, + collection_id: 1, + title: "2", + created_by: { + id: 2, + email: "admin@processmaker.com" + }, + updated_by: { + id: 2, + email: "admin@processmaker.com" + } + } + ], + meta: { + filter: "", + sort_by: "", + sort_order: "", + count: 2, + total_pages: 1, + current_page: 1, + from: 1, + last_page: 1, + path: "/api/1.0/collections/1/records", + per_page: 9223372036854775807, + to: 2, + total: 2 + } + } }) - ).as('executeScript'); + ).as("executeScript"); }); - it('Verify select list mustache + data source', () => { - cy.loadFromJson('select_list_mustache.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption('id: 2'); + it("Verify select list mustache + data source", () => { + cy.loadFromJson("select_list_mustache.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption("id: 2"); // Check the data of the screen cy.assertPreviewData({ form_select_list_1: { - 'dni': '5678', - 'name': { - 'last': 'Loayza', - 'first': 'Dante', + dni: "5678", + name: { + last: "Loayza", + first: "Dante" }, - 'id': 2, - }, + id: 2 + } }); }); - it('Verify select list mustache + data source with custom key', () => { - cy.loadFromJson('select_list_mustache_custom_key.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption('id: 2'); + it("Verify select list mustache + data source with custom key", () => { + cy.loadFromJson("select_list_mustache_custom_key.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption("id: 2"); // Check the data of the screen cy.assertPreviewData({ form_select_list_1: { - 'dni': '5678', - 'name': { - 'last': 'Loayza', - 'first': 'Dante', + dni: "5678", + name: { + last: "Loayza", + first: "Dante" }, - 'id': 2, - }, + id: 2 + } }); }); - it('Verify select list simple array of options', () => { - cy.loadFromJson('select_list_array_data.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption('two'); + it("Verify select list simple array of options", () => { + cy.loadFromJson("select_list_array_data.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption("two"); // Check the data of the screen cy.assertPreviewData({ - form_select_list_1: '2', + form_select_list_1: "2" }); }); - it('Verify select list mustache with request data', () => { - cy.loadFromJson('select_list_mustache_request_data.json', 0); + it("Verify select list mustache with request data", () => { + cy.loadFromJson("select_list_mustache_request_data.json", 0); // Setup Request Data cy.setPreviewDataInput({ array: [ { - 'id': '1', - 'content': 'one', + id: "1", + content: "one" }, { - 'id': '2', - 'content': 'two', - }, - ], + id: "2", + content: "two" + } + ] }); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption('id: 2 two'); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption( + "id: 2 two" + ); // Check the data of the screen cy.assertPreviewData({ array: [ { - 'id': '1', - 'content': 'one', + id: "1", + content: "one" }, { - 'id': '2', - 'content': 'two', - }, + id: "2", + content: "two" + } ], - form_select_list_1: '2', + form_select_list_1: "2" }); }); -}); \ No newline at end of file +}); diff --git a/tests/e2e/specs/SelectListWatcher.spec.js b/tests/e2e/specs/SelectListWatcher.spec.js index 65897b830..7de52ce75 100644 --- a/tests/e2e/specs/SelectListWatcher.spec.js +++ b/tests/e2e/specs/SelectListWatcher.spec.js @@ -29,9 +29,8 @@ describe("SelectList - Watcher", () => { ]; beforeEach(() => { - cy.server(); // Mock the response from the data source - cy.route( + cy.intercept( "POST", "/api/1.0/requests/data_sources/2", JSON.stringify({ diff --git a/tests/e2e/specs/SingleSelectWithInvalidValue.spec.js b/tests/e2e/specs/SingleSelectWithInvalidValue.spec.js index 01092226e..684c800de 100644 --- a/tests/e2e/specs/SingleSelectWithInvalidValue.spec.js +++ b/tests/e2e/specs/SingleSelectWithInvalidValue.spec.js @@ -1,39 +1,38 @@ -describe('single select with invalid initial value', () => { +describe("single select with invalid initial value", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('Single select radio with array value without user interaction keep its value', () => { - cy.loadFromJson('single_select_with_invalid_value.json', 0); + it("Single select radio with array value without user interaction keep its value", () => { + cy.loadFromJson("single_select_with_invalid_value.json", 0); // init screen data - cy.setPreviewDataInput({person: []}); - cy.get('[data-cy=mode-preview]').click(); + cy.setPreviewDataInput({ person: [] }); + cy.get("[data-cy=mode-preview]").click(); // Check the data of the screen cy.assertPreviewData({ - person: [], + person: [] }); }); - it('Single select radio with array value after user interaction change to the selected option', () => { - cy.loadFromJson('single_select_with_invalid_value.json', 0); + it("Single select radio with array value after user interaction change to the selected option", () => { + cy.loadFromJson("single_select_with_invalid_value.json", 0); // init screen data - cy.setPreviewDataInput({person: []}); - cy.get('[data-cy=mode-preview]').click(); + cy.setPreviewDataInput({ person: [] }); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy=preview-content] [name=person]').eq(0).click(); - cy.get('[data-cy=preview-content] [name=person]').eq(1).click(); - cy.get('[data-cy=preview-content] [name=person]').eq(0).click(); + cy.get("[data-cy=preview-content] [name=person]").eq(0).click(); + cy.get("[data-cy=preview-content] [name=person]").eq(1).click(); + cy.get("[data-cy=preview-content] [name=person]").eq(0).click(); // Check the data of the screen cy.assertPreviewData({ - person: { - content: 'one', - value: 'one', - }, + person: { + content: "one", + value: "one" + } }); }); }); diff --git a/tests/e2e/specs/Subtotals.spec.js b/tests/e2e/specs/Subtotals.spec.js index a5e40e491..bc4f33f99 100644 --- a/tests/e2e/specs/Subtotals.spec.js +++ b/tests/e2e/specs/Subtotals.spec.js @@ -1,220 +1,251 @@ - -describe('Subtotals implementations', () => { - +describe("Subtotals implementations", () => { beforeEach(() => { - cy.visit('/'); - cy.server(); + cy.visit("/"); }); - it('Simple using calculated properties and defualt values', () => { - cy.loadFromJson('subtotals_with_loops.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=count]').eq(0).type('3'); - cy.get('[data-cy=preview-content] [name=cost]').eq(0).type('123'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(0).should('have.value', '369'); - - cy.get('[data-cy=preview-content] [name=count]').eq(1).type('3'); - cy.get('[data-cy=preview-content] [name=cost]').eq(1).type('4'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(1).should('have.value', '12'); - - cy.get('[data-cy=preview-content] [name=count]').eq(2).type('5'); - cy.get('[data-cy=preview-content] [name=cost]').eq(2).type('6'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(2).should('have.value', '30'); + it("Simple using calculated properties and defualt values", () => { + cy.loadFromJson("subtotals_with_loops.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=count]").eq(0).type("3"); + cy.get("[data-cy=preview-content] [name=cost]").eq(0).type("123"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(0) + .should("have.value", "369"); + + cy.get("[data-cy=preview-content] [name=count]").eq(1).type("3"); + cy.get("[data-cy=preview-content] [name=cost]").eq(1).type("4"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(1) + .should("have.value", "12"); + + cy.get("[data-cy=preview-content] [name=count]").eq(2).type("5"); + cy.get("[data-cy=preview-content] [name=cost]").eq(2).type("6"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(2) + .should("have.value", "30"); // Add a new row cy.get('[data-cy=preview-content] [data-cy="loop-loop-add"]').click(); - cy.get('[data-cy=preview-content] [name=count]').eq(3).type('4'); - cy.get('[data-cy=preview-content] [name=cost]').eq(3).type('5'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(3).should('have.value', '20'); + cy.get("[data-cy=preview-content] [name=count]").eq(3).type("4"); + cy.get("[data-cy=preview-content] [name=cost]").eq(3).type("5"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(3) + .should("have.value", "20"); // Check final result - cy.assertPreviewData( - { - 'loop': [ - { - 'count': '3', - 'cost': '123', - 'subtotal': 369, - }, - { - 'count': '3', - 'cost': '4', - 'subtotal': 12, - }, - { - 'count': '5', - 'cost': '6', - 'subtotal': 30, - }, - { - 'count': '4', - 'cost': '5', - 'subtotal': 20, - }, - ], - 'total': 431, - }); + cy.assertPreviewData({ + loop: [ + { + count: "3", + cost: "123", + subtotal: 369 + }, + { + count: "3", + cost: "4", + subtotal: 12 + }, + { + count: "5", + cost: "6", + subtotal: 30 + }, + { + count: "4", + cost: "5", + subtotal: 20 + } + ], + total: 431 + }); }); - it('Simple using calculated properties and defualt values with Currency Inputs', () => { - cy.loadFromJson('subtotals_with_loops_currency.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=count]').eq(0).type('3'); - cy.get('[data-cy=preview-content] [name=cost]').eq(0).type('123'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(0).should('have.value', '369,00'); - - cy.get('[data-cy=preview-content] [name=count]').eq(1).type('3'); - cy.get('[data-cy=preview-content] [name=cost]').eq(1).type('4'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(1).should('have.value', '12,00'); - - cy.get('[data-cy=preview-content] [name=count]').eq(2).type('5'); - cy.get('[data-cy=preview-content] [name=cost]').eq(2).type('6'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(2).should('have.value', '30,00'); + it("Simple using calculated properties and defualt values with Currency Inputs", () => { + cy.loadFromJson("subtotals_with_loops_currency.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=count]").eq(0).type("3"); + cy.get("[data-cy=preview-content] [name=cost]").eq(0).type("123"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(0) + .should("have.value", "369,00"); + + cy.get("[data-cy=preview-content] [name=count]").eq(1).type("3"); + cy.get("[data-cy=preview-content] [name=cost]").eq(1).type("4"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(1) + .should("have.value", "12,00"); + + cy.get("[data-cy=preview-content] [name=count]").eq(2).type("5"); + cy.get("[data-cy=preview-content] [name=cost]").eq(2).type("6"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(2) + .should("have.value", "30,00"); // Add a new row cy.get('[data-cy=preview-content] [data-cy="loop-loop-add"]').click(); - cy.get('[data-cy=preview-content] [name=count]').eq(3).type('4'); - cy.get('[data-cy=preview-content] [name=cost]').eq(3).type('5'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(3).should('have.value', '20,00'); + cy.get("[data-cy=preview-content] [name=count]").eq(3).type("4"); + cy.get("[data-cy=preview-content] [name=cost]").eq(3).type("5"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(3) + .should("have.value", "20,00"); // Check final result - cy.assertPreviewData( - { - 'loop': [ - { - 'count': 3, - 'cost': 123, - 'subtotal': 369, - }, - { - 'count': 3, - 'cost': 4, - 'subtotal': 12, - }, - { - 'count': 5, - 'cost': 6, - 'subtotal': 30, - }, - { - 'count': 4, - 'cost': 5, - 'subtotal': 20, - }, - ], - 'total': 431, - }); + cy.assertPreviewData({ + loop: [ + { + count: 3, + cost: 123, + subtotal: 369 + }, + { + count: 3, + cost: 4, + subtotal: 12 + }, + { + count: 5, + cost: 6, + subtotal: 30 + }, + { + count: 4, + cost: 5, + subtotal: 20 + } + ], + total: 431 + }); }); - it('Simple using calculated properties and defualt values with Decimal', () => { - cy.loadFromJson('subtotals_with_loops_decimal.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=count]').eq(0).type('3'); - cy.get('[data-cy=preview-content] [name=cost]').eq(0).type('123'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(0).should('have.value', '369'); - - cy.get('[data-cy=preview-content] [name=count]').eq(1).type('3'); - cy.get('[data-cy=preview-content] [name=cost]').eq(1).type('4'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(1).should('have.value', '12'); - - cy.get('[data-cy=preview-content] [name=count]').eq(2).type('5'); - cy.get('[data-cy=preview-content] [name=cost]').eq(2).type('6'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(2).should('have.value', '30'); + it("Simple using calculated properties and defualt values with Decimal", () => { + cy.loadFromJson("subtotals_with_loops_decimal.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=count]").eq(0).type("3"); + cy.get("[data-cy=preview-content] [name=cost]").eq(0).type("123"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(0) + .should("have.value", "369"); + + cy.get("[data-cy=preview-content] [name=count]").eq(1).type("3"); + cy.get("[data-cy=preview-content] [name=cost]").eq(1).type("4"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(1) + .should("have.value", "12"); + + cy.get("[data-cy=preview-content] [name=count]").eq(2).type("5"); + cy.get("[data-cy=preview-content] [name=cost]").eq(2).type("6"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(2) + .should("have.value", "30"); // Add a new row cy.get('[data-cy=preview-content] [data-cy="loop-loop-add"]').click(); - cy.get('[data-cy=preview-content] [name=count]').eq(3).type('4'); - cy.get('[data-cy=preview-content] [name=cost]').eq(3).type('5'); - cy.get('[data-cy=preview-content] [name=subtotal]').eq(3).should('have.value', '20'); + cy.get("[data-cy=preview-content] [name=count]").eq(3).type("4"); + cy.get("[data-cy=preview-content] [name=cost]").eq(3).type("5"); + cy.get("[data-cy=preview-content] [name=subtotal]") + .eq(3) + .should("have.value", "20"); // Check final result - cy.assertPreviewData( - { - 'loop': [ - { - 'count': 3, - 'cost': 123, - 'subtotal': 369, - }, - { - 'count': 3, - 'cost': 4, - 'subtotal': 12, - }, - { - 'count': 5, - 'cost': 6, - 'subtotal': 30, - }, - { - 'count': 4, - 'cost': 5, - 'subtotal': 20, - }, - ], - 'total': 431, - }); + cy.assertPreviewData({ + loop: [ + { + count: 3, + cost: 123, + subtotal: 369 + }, + { + count: 3, + cost: 4, + subtotal: 12 + }, + { + count: 5, + cost: 6, + subtotal: 30 + }, + { + count: 4, + cost: 5, + subtotal: 20 + } + ], + total: 431 + }); }); - it('Using calculated fields', () => { - cy.loadFromJson('subtotasl_calc_props.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=amount]').type('123'); - cy.get('[data-cy=preview-content] [name=quantity]').type('3'); - cy.get('[data-cy=preview-content] [name=total_line]').should('have.value', '$ 369.00 USD'); - - cy.get('[data-cy=preview-content] [name=amount_1]').type('4'); - cy.get('[data-cy=preview-content] [name=quantity_1]').type('3'); - cy.get('[data-cy=preview-content] [name=total_line_1]').should('have.value', '$ 12.00 USD'); + it("Using calculated fields", () => { + cy.loadFromJson("subtotasl_calc_props.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=amount]").type("123"); + cy.get("[data-cy=preview-content] [name=quantity]").type("3"); + cy.get("[data-cy=preview-content] [name=total_line]").should( + "have.value", + "$ 369.00 USD" + ); + + cy.get("[data-cy=preview-content] [name=amount_1]").type("4"); + cy.get("[data-cy=preview-content] [name=quantity_1]").type("3"); + cy.get("[data-cy=preview-content] [name=total_line_1]").should( + "have.value", + "$ 12.00 USD" + ); // Check final result - cy.assertPreviewData( - { - 'quantity': 3, - 'amount': 123, - 'total_line': 369, - 'quantity_1': 3, - 'amount_1': 4, - 'total_line_1': 12, - 'total_total': 381, - }); + cy.assertPreviewData({ + quantity: 3, + amount: 123, + total_line: 369, + quantity_1: 3, + amount_1: 4, + total_line_1: 12, + total_total: 381 + }); }); - it('Using calculated fields 2', () => { - cy.loadFromJson('subtotasl_calc_props_currency.json', 0); - cy.get('[data-cy=mode-preview]').click(); - - cy.get('[data-cy=preview-content] [name=count_1]').type('4'); - cy.get('[data-cy=preview-content] [name=cost_1]').type('3'); - cy.get('[data-cy=preview-content] [name=subtotal_1]').should('have.value', '$ 12.00 USD'); - - cy.get('[data-cy=preview-content] [name=count_2]').type('123'); - cy.get('[data-cy=preview-content] [name=cost_2]').type('3'); - cy.get('[data-cy=preview-content] [name=subtotal_2]').should('have.value', '$ 369.00 USD'); - - cy.get('[data-cy=preview-content] [name=count_3]').type('12'); - cy.get('[data-cy=preview-content] [name=cost_3]').type('2'); - cy.get('[data-cy=preview-content] [name=subtotal_3]').should('have.value', '$ 24.00 USD'); + it("Using calculated fields 2", () => { + cy.loadFromJson("subtotasl_calc_props_currency.json", 0); + cy.get("[data-cy=mode-preview]").click(); + + cy.get("[data-cy=preview-content] [name=count_1]").type("4"); + cy.get("[data-cy=preview-content] [name=cost_1]").type("3"); + cy.get("[data-cy=preview-content] [name=subtotal_1]").should( + "have.value", + "$ 12.00 USD" + ); + + cy.get("[data-cy=preview-content] [name=count_2]").type("123"); + cy.get("[data-cy=preview-content] [name=cost_2]").type("3"); + cy.get("[data-cy=preview-content] [name=subtotal_2]").should( + "have.value", + "$ 369.00 USD" + ); + + cy.get("[data-cy=preview-content] [name=count_3]").type("12"); + cy.get("[data-cy=preview-content] [name=cost_3]").type("2"); + cy.get("[data-cy=preview-content] [name=subtotal_3]").should( + "have.value", + "$ 24.00 USD" + ); // Check final result - cy.assertPreviewData( - { - 'input_1': '', - 'input_2': '', - 'input_3': '', - 'cost_1': 3, - 'count_1': 4, - 'subtotal_1': 12, - 'cost_2': 3, - 'count_2': 123, - 'subtotal_2': 369, - 'cost_3': 2, - 'count_3': 12, - 'subtotal_3': 24, - 'total': 405, - }); + cy.assertPreviewData({ + input_1: "", + input_2: "", + input_3: "", + cost_1: 3, + count_1: 4, + subtotal_1: 12, + cost_2: 3, + count_2: 123, + subtotal_2: 369, + cost_3: 2, + count_3: 12, + subtotal_3: 24, + total: 405 + }); }); }); diff --git a/tests/e2e/specs/Task.spec.js b/tests/e2e/specs/Task.spec.js index 626f1b6f8..596820f9f 100644 --- a/tests/e2e/specs/Task.spec.js +++ b/tests/e2e/specs/Task.spec.js @@ -1,323 +1,389 @@ -import moment from 'moment'; -import Screens from '../fixtures/webentry.json'; -import SingleScreen from '../fixtures/single_line_input.json'; -import InterstitialScreen from '../fixtures/interstitial_screen.json'; - -describe('Task component', () => { - it('In a webentry', () => { - cy.server(); - - cy.visit('/?scenario=WebEntry', { +import moment from "moment"; +import Screens from "../fixtures/webentry.json"; +import SingleScreen from "../fixtures/single_line_input.json"; +import InterstitialScreen from "../fixtures/interstitial_screen.json"; + +describe("Task component", () => { + it("In a webentry", () => { + cy.visit("/?scenario=WebEntry", { onBeforeLoad(win) { // Call some code to initialize the fake server part using MockSocket - cy.stub(win, 'WebSocket').callsFake((url) => ({ + cy.stub(win, "WebSocket").callsFake((url) => ({ url, onclose: null, onopen: null, - close(){}, - send(){}, + close() {}, + send() {} })); - win.Echo = { - - }; - }, + win.Echo = {}; + } }); cy.wait(2000); }); - it('Task inside a Request', () => { - cy.server(); - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', + it("Task inside a Request", () => { + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", { id: 1, - advanceStatus: 'open', - component: 'task-screen', + advanceStatus: "open", + component: "task-screen", created_at: moment().toISOString(), completed_at: moment().toISOString(), - due_at: moment().add(1, 'day').toISOString(), + due_at: moment().add(1, "day").toISOString(), user: { - avatar: '', - fullname: 'Assigned User', + avatar: "", + fullname: "Assigned User" }, screen: Screens.screens[0], process_request: { id: 1, - status: 'ACTIVE', + status: "ACTIVE", user: { - avatar: '', - fullname: 'Requester User', - }, + avatar: "", + fullname: "Requester User" + } }, process: { id: 1, - name: 'Process Name', + name: "Process Name" }, user_request_permission: [{ process_request_id: 1, allowed: true }] } ); - cy.visit('/?scenario=TaskAssigned', { + cy.visit("/?scenario=TaskAssigned", { onBeforeLoad(win) { // setup request-id=1 - const requestIdMeta = win.document.createElement('meta'); - requestIdMeta.setAttribute('name', 'request-id'); - requestIdMeta.setAttribute('content', '1'); + const requestIdMeta = win.document.createElement("meta"); + requestIdMeta.setAttribute("name", "request-id"); + requestIdMeta.setAttribute("content", "1"); win.document.head.appendChild(requestIdMeta); // Call some code to initialize the fake server part using MockSocket - cy.stub(win, 'WebSocket').callsFake((url) => ({ + cy.stub(win, "WebSocket").callsFake((url) => ({ url, onclose: null, onopen: null, - close(){}, - send(){}, + close() {}, + send() {} })); - }, + } }); cy.wait(2000); - cy.get('[data-cy=screen-field-firstname]').should('be.visible'); - cy.get('[data-cy=screen-field-lastname]').should('be.visible'); + cy.get("[data-cy=screen-field-firstname]").should("be.visible"); + cy.get("[data-cy=screen-field-lastname]").should("be.visible"); }); - it('Completes the Task', () => { - cy.server(); - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', + it("Completes the Task", () => { + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", { id: 1, - advanceStatus: 'open', - component: 'task-screen', + advanceStatus: "open", + component: "task-screen", created_at: moment().toISOString(), completed_at: moment().toISOString(), - due_at: moment().add(1, 'day').toISOString(), + due_at: moment().add(1, "day").toISOString(), user: { - avatar: '', - fullname: 'Assigned User', + avatar: "", + fullname: "Assigned User" }, screen: Screens.screens[0], process_request: { id: 1, - status: 'ACTIVE', + status: "ACTIVE", user: { - avatar: '', - fullname: 'Requester User', - }, + avatar: "", + fullname: "Requester User" + } }, process: { id: 1, - name: 'Process Name', + name: "Process Name" }, request_data: { - firstname: 'John', - lastname: 'Doe', + firstname: "John", + lastname: "Doe" }, user_request_permission: [{ process_request_id: 1, allowed: true }] } ); - cy.visit('/?scenario=TaskAssigned', { + cy.visit("/?scenario=TaskAssigned", { onBeforeLoad(win) { // setup request-id=1 - const requestIdMeta = win.document.createElement('meta'); - requestIdMeta.setAttribute('name', 'request-id'); - requestIdMeta.setAttribute('content', '1'); + const requestIdMeta = win.document.createElement("meta"); + requestIdMeta.setAttribute("name", "request-id"); + requestIdMeta.setAttribute("content", "1"); win.document.head.appendChild(requestIdMeta); // Call some code to initialize the fake server part using MockSocket - cy.stub(win, 'WebSocket').callsFake((url) => ({ + cy.stub(win, "WebSocket").callsFake((url) => ({ url, onclose: null, onopen: null, - close(){}, - send(){}, + close() {}, + send() {} })); - cy.stub(win, 'alert').as('windowAlert'); - }, + cy.stub(win, "alert").as("windowAlert"); + } }); cy.wait(2000); - cy.get('.form-group').find('button').click(); - cy.route('PUT', 'http://localhost:8080/api/1.0/tasks/1').then(function() { - cy.get('@windowAlert').should('have.been.calledOnce') - .and('have.been.calledWith', 'Task Completed Successfully') - .then(function() { - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', - { - id: 1, - advanceStatus: 'completed', - status: 'CLOSED', - } - ); - cy.reload(); - }); - }); - cy.get('#tab-form > .card').should('contain.text', 'Task Completed'); + cy.get(".form-group").find("button").click(); + cy.intercept("PUT", "http://localhost:5173/api/1.0/tasks/1").then( + function () { + cy.get("@windowAlert") + .should("have.been.calledOnce") + .and("have.been.calledWith", "Task Completed Successfully") + .then(function () { + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", + { + id: 1, + advanceStatus: "completed", + status: "CLOSED" + } + ); + cy.reload(); + }); + } + ); + cy.get("#tab-form > .card").should("contain.text", "Task Completed"); }); - it('Progresses to the interstitial screen', () => { - cy.server(); - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', + it("Progresses to the interstitial screen", () => { + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", { id: 1, - advanceStatus: 'open', - component: 'task-screen', + advanceStatus: "open", + component: "task-screen", created_at: moment().toISOString(), completed_at: moment().toISOString(), - due_at: moment().add(1, 'day').toISOString(), - status: 'ACTIVE', + due_at: moment().add(1, "day").toISOString(), + status: "ACTIVE", user: { - avatar: '', - fullname: 'Assigned User', + avatar: "", + fullname: "Assigned User" }, screen: Screens.screens[0], process_request: { id: 1, - status: 'ACTIVE', + status: "ACTIVE", user: { - avatar: '', - fullname: 'Requester User', - }, + avatar: "", + fullname: "Requester User" + } }, process: { id: 1, - name: 'Process Name', + name: "Process Name" }, request_data: { - firstname: 'John', - lastname: 'Doe', - }, + firstname: "John", + lastname: "Doe" + } } ); - cy.visit('/?scenario=TaskAssigned', { + cy.visit("/?scenario=TaskAssigned", { onBeforeLoad(win) { // setup request-id=1 - const requestIdMeta = win.document.createElement('meta'); - requestIdMeta.setAttribute('name', 'request-id'); - requestIdMeta.setAttribute('content', '1'); + const requestIdMeta = win.document.createElement("meta"); + requestIdMeta.setAttribute("name", "request-id"); + requestIdMeta.setAttribute("content", "1"); win.document.head.appendChild(requestIdMeta); // Call some code to initialize the fake server part using MockSocket - cy.stub(win, 'WebSocket').callsFake((url) => ({ + cy.stub(win, "WebSocket").callsFake((url) => ({ url, onclose: null, onopen: null, - close(){}, - send(){}, + close() {}, + send() {} })); - cy.stub(win, 'alert').as('windowAlert'); - }, + cy.stub(win, "alert").as("windowAlert"); + } }); cy.wait(2000); - cy.get('.form-group').find('button').click(); - cy.route('PUT', 'http://localhost:8080/api/1.0/tasks/1').then(function() { - cy.get('@windowAlert').should('have.been.calledOnce') - .and('have.been.calledWith', 'Task Completed Successfully') - .then(function() { - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', - { + cy.get(".form-group").find("button").click(); + cy.intercept("PUT", "http://localhost:5173/api/1.0/tasks/1").then( + function () { + cy.get("@windowAlert") + .should("have.been.calledOnce") + .and("have.been.calledWith", "Task Completed Successfully") + .then(function () { + const completedBodyRequest = { id: 1, - advanceStatus: 'completed', - component: 'task-screen', + advanceStatus: "completed", + component: "task-screen", created_at: moment().toISOString(), completed_at: moment().toISOString(), - due_at: moment().add(1, 'day').toISOString(), - status: 'CLOSED', + due_at: moment().add(1, "day").toISOString(), + status: "CLOSED", allow_interstitial: true, interstitial_screen: InterstitialScreen.screens[0], user: { - avatar: '', - fullname: 'Assigned User', + avatar: "", + fullname: "Assigned User" }, + data: [ + { + id: 1, + user_id: 1, + process_id: 1, + process_request_id: 1, + subprocess_request_id: null, + element_id: "node_4", + element_type: "task", + element_name: "Form Task", + status: "ACTIVE", + element_index: 0, + subprocess_start_event_id: null, + completed_at: null, + due_at: "2023-02-18T17:54:15+00:00", + due_notified: 0, + initiated_at: null, + riskchanges_at: "2023-02-17T19:54:15+00:00", + created_at: "2023-02-15T17:54:15+00:00", + updated_at: "2023-02-15T17:54:15+00:00", + version_id: 3, + version_type: "ProcessMaker\\Models\\ScreenVersion", + advanceStatus: "open", + process_request: { + id: 1, + process_id: 1, + process_collaboration_id: null, + user_id: 1, + parent_request_id: null, + participant_id: null, + callable_id: "ProcessId", + status: "ACTIVE", + name: "simple", + errors: null, + completed_at: null, + initiated_at: "2023-02-15T17:53:45+00:00", + created_at: "2023-02-15T17:53:45+00:00", + updated_at: "2023-02-15T17:54:15+00:00", + process_version_id: 7, + signal_events: [] + }, + user: { + id: 1, + email: "admin@processmaker.com", + firstname: "Admin", + lastname: "User", + username: "admin", + status: "ACTIVE", + meta: null, + is_administrator: true, + active_at: "2023-02-15T17:54:05+00:00", + created_at: "2023-02-10T14:03:26+00:00", + updated_at: "2023-02-10T14:03:26+00:00", + manager_id: null, + fullname: "Admin User", + avatar: "" + } + } + ], screen: Screens.screens[0], process_request: { id: 1, - status: 'CLOSED', + status: "CLOSED", user: { - avatar: '', - fullname: 'Requester User', - }, + avatar: "", + fullname: "Requester User" + } }, process: { id: 1, - name: 'Process Name', + name: "Process Name" }, request_data: { - firstname: 'John', - lastname: 'Doe', - }, - } - ); - cy.reload(); - }); - cy.wait(2000); - cy.get('.form-group > :nth-child(1) > div').should('contain.text', 'Please wait'); - }); + firstname: "John", + lastname: "Doe" + } + }; + cy.intercept("GET", "/api/1.0/tasks**", { + body: completedBodyRequest + }); + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", + { body: completedBodyRequest } + ); + cy.reload(); + }); + cy.wait(2000); + cy.get(".form-group > :nth-child(1) > div").should( + "contain.text", + "Please wait" + ); + } + ); }); - it('It updates the PM4ConfigOverrides', () => { - cy.server(); - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', + it("It updates the PM4ConfigOverrides", () => { + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", { id: 1, - advanceStatus: 'open', - component: 'task-screen', + advanceStatus: "open", + component: "task-screen", created_at: moment().toISOString(), completed_at: moment().toISOString(), - due_at: moment().add(1, 'day').toISOString(), - status: 'ACTIVE', + due_at: moment().add(1, "day").toISOString(), + status: "ACTIVE", user: { - avatar: '', - fullname: 'Assigned User', + avatar: "", + fullname: "Assigned User" }, screen: Screens.screens[0], process_request: { id: 1, - status: 'ACTIVE', + status: "ACTIVE", user: { - avatar: '', - fullname: 'Requester User', - }, + avatar: "", + fullname: "Requester User" + } }, process: { id: 1, - name: 'Process Name', + name: "Process Name" }, request_data: { - firstname: 'John', - lastname: 'Doe', - }, + firstname: "John", + lastname: "Doe" + } } ); - cy.visit('/?scenario=TaskAssigned', { + cy.visit("/?scenario=TaskAssigned", { onBeforeLoad(win) { // setup request-id=1 - const requestIdMeta = win.document.createElement('meta'); - requestIdMeta.setAttribute('name', 'request-id'); - requestIdMeta.setAttribute('content', '1'); + const requestIdMeta = win.document.createElement("meta"); + requestIdMeta.setAttribute("name", "request-id"); + requestIdMeta.setAttribute("content", "1"); win.document.head.appendChild(requestIdMeta); win.PM4ConfigOverrides = { - getScreenEndpoint: 'tasks/123/screens', + getScreenEndpoint: "tasks/123/screens" }; // Call some code to initialize the fake server part using MockSocket - cy.stub(win, 'WebSocket').callsFake((url) => ({ + cy.stub(win, "WebSocket").callsFake((url) => ({ url, onclose: null, onopen: null, - close(){}, - send(){}, + close() {}, + send() {} })); - cy.stub(win, 'alert').as('windowAlert'); - }, + cy.stub(win, "alert").as("windowAlert"); + } }); - cy.window().its('PM4ConfigOverrides.getScreenEndpoint').should('equal', 'tasks/1/screens'); + cy.window() + .its("PM4ConfigOverrides.getScreenEndpoint") + .should("equal", "tasks/1/screens"); }); /* DNAT = Display Next Assigned Task parentTask1 parentTask2 @@ -325,74 +391,75 @@ describe('Task component', () => { (DNAT) After childTask1 should redirect to childTask2 */ - it('Task with display next assigned task checked with another pending task in same request should redirect to the next task of same request', () => { - cy.server(); - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', + it("Task with display next assigned task checked with another pending task in same request should redirect to the next task of same request", () => { + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", { id: 1, - advanceStatus: 'open', - component: 'task-screen', + advanceStatus: "open", + component: "task-screen", screen: SingleScreen.screens[0], process_request: { id: 1, - status: 'ACTIVE', - }, + status: "ACTIVE" + } } ); - cy.visit('/?scenario=TaskRedirect', {}); + cy.visit("/?scenario=TaskRedirect", {}); cy.wait(2000); - cy.get('.form-group').find('button').click(); - - cy.route('PUT', 'http://localhost:8080/api/1.0/tasks/1').then(function() { - let responseDataTask1 = { - 'status': 'CLOSED', - 'process_request_id': 2, - 'id': 1, - 'screen': SingleScreen.screens[0], - 'allow_interstitial': true, - 'interstitial_screen': InterstitialScreen.screens[0], - }; - - getTask( - 'http://localhost:8080/api/1.0/tasks/'+responseDataTask1['id']+'?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', - responseDataTask1 - ); - - let responseDataTasks = { - 'status': 'ACTIVE', - 'taskId': 2, - 'process_request_id': 2, - }; - - getTasks( - 'http://localhost:8080/api/1.0/tasks?user_id=1&status=ACTIVE&process_request_id=1&include_sub_tasks=1', - responseDataTasks - ); - - let responseDataTask2 = { - 'status': 'ACTIVE', - 'process_request_id': 2, - 'parent_request_id': 1, - 'taskId': 2, - 'screen': Screens.screens[0], - 'allow_interstitial': false, - 'interstitial_screen': null, - }; - - getTask( - 'http://localhost:8080/api/1.0/tasks/'+responseDataTask2['taskId']+'?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', - responseDataTask2 - ); - - cy.wait(2000); - cy.reload(); - }); + cy.get(".form-group").find("button").click(); - cy.url().should('eq', 'http://localhost:8080/tasks/2/edit'); + cy.intercept("PUT", "http://localhost:5173/api/1.0/tasks/1").then( + function () { + const responseDataTask1 = { + status: "CLOSED", + process_request_id: 2, + id: 1, + screen: SingleScreen.screens[0], + allow_interstitial: true, + interstitial_screen: InterstitialScreen.screens[0] + }; + + getTask( + `http://localhost:5173/api/1.0/tasks/${responseDataTask1.id}?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission`, + responseDataTask1 + ); + + const responseDataTasks = { + status: "ACTIVE", + taskId: 2, + process_request_id: 2 + }; + + getTasks( + "http://localhost:5173/api/1.0/tasks?user_id=1&status=ACTIVE&process_request_id=1&include_sub_tasks=1", + responseDataTasks + ); + + const responseDataTask2 = { + status: "ACTIVE", + process_request_id: 2, + parent_request_id: 1, + taskId: 2, + screen: Screens.screens[0], + allow_interstitial: false, + interstitial_screen: null + }; + + getTask( + `http://localhost:5173/api/1.0/tasks/${responseDataTask2.taskId}?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission`, + responseDataTask2 + ); + + cy.wait(2000); + cy.reload(); + } + ); + + cy.url().should("eq", "http://localhost:5173/tasks/2/edit"); }); /* DNAT = Display Next Assigned Task @@ -400,68 +467,69 @@ describe('Task component', () => { \_______childTask1___scriptTask____childTask2_______/ (DNAT) */ - it('Task with display next assigned task checked in subprocess and no pending task and status closed or open should redirect to parent requests', () => { - cy.server(); - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', + it("Task with display next assigned task checked in subprocess and no pending task and status closed or open should redirect to parent requests", () => { + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", { id: 1, - advanceStatus: 'open', - component: 'task-screen', + advanceStatus: "open", + component: "task-screen", screen: SingleScreen.screens[0], process_request: { id: 1, - status: 'ACTIVE', - }, + status: "ACTIVE" + } } ); - cy.visit('/?scenario=TaskRedirect', {}); + cy.visit("/?scenario=TaskRedirect", {}); cy.wait(2000); - cy.get('.form-group').find('button').click(); - - cy.route('PUT', 'http://localhost:8080/api/1.0/tasks/1').then(function() { - let responseDataTask1 = { - 'status': 'CLOSED', - 'process_request_id': 2, - 'id': 1, - 'screen': SingleScreen.screens[0], - 'allow_interstitial': true, - 'interstitial_screen': InterstitialScreen.screens[0], - 'parent_request_id': 1, - }; - - getTask( - 'http://localhost:8080/api/1.0/tasks/'+responseDataTask1['id']+'?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', - responseDataTask1 - ); - - getTasks( - 'http://localhost:8080/api/1.0/tasks?user_id=1&status=ACTIVE&process_request_id=1&include_sub_tasks=1', - null - ); - - let responseDataTask2 = { - 'status': 'ACTIVE', - 'process_request_id': 2, - 'taskId': 2, - 'screen': Screens.screens[0], - 'allow_interstitial': false, - 'interstitial_screen': null, - }; - - getTask( - 'http://localhost:8080/api/1.0/tasks/'+responseDataTask2['taskId']+'?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', - responseDataTask2 - ); - - cy.wait(2000); - cy.reload(); - }); + cy.get(".form-group").find("button").click(); + + cy.intercept("PUT", "http://localhost:5173/api/1.0/tasks/1").then( + function () { + const responseDataTask1 = { + status: "CLOSED", + process_request_id: 2, + id: 1, + screen: SingleScreen.screens[0], + allow_interstitial: true, + interstitial_screen: InterstitialScreen.screens[0], + parent_request_id: 1 + }; + + getTask( + `http://localhost:5173/api/1.0/tasks/${responseDataTask1.id}?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission`, + responseDataTask1 + ); + + getTasks( + "http://localhost:5173/api/1.0/tasks?user_id=1&status=ACTIVE&process_request_id=1&include_sub_tasks=1", + null + ); + + const responseDataTask2 = { + status: "ACTIVE", + process_request_id: 2, + taskId: 2, + screen: Screens.screens[0], + allow_interstitial: false, + interstitial_screen: null + }; + + getTask( + `http://localhost:5173/api/1.0/tasks/${responseDataTask2.taskId}?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission`, + responseDataTask2 + ); + + cy.wait(2000); + cy.reload(); + } + ); - cy.url().should('eq', 'http://localhost:8080/requests/1'); + cy.url().should("eq", "http://localhost:5173/requests/1"); }); /* DNAT = Display Next Assigned Task @@ -470,73 +538,74 @@ describe('Task component', () => { (DNAT) After childTask1 should redirect to parentTask2 */ - it('Task with display next assigned task checked in different process request should redirect to the next task of parent request', () => { - cy.server(); - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', + it("Task with display next assigned task checked in different process request should redirect to the next task of parent request", () => { + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", { id: 1, - advanceStatus: 'open', - component: 'task-screen', + advanceStatus: "open", + component: "task-screen", screen: SingleScreen.screens[0], process_request: { id: 1, - status: 'ACTIVE', - }, + status: "ACTIVE" + } } ); - cy.visit('/?scenario=TaskRedirect', {}); + cy.visit("/?scenario=TaskRedirect", {}); cy.wait(2000); - cy.get('.form-group').find('button').click(); - - cy.route('PUT', 'http://localhost:8080/api/1.0/tasks/1').then(function() { - let responseDataTask1 = { - 'status': 'CLOSED', - 'process_request_id': 1, - 'id': 1, - 'screen': SingleScreen.screens[0], - 'allow_interstitial': true, - 'interstitial_screen': InterstitialScreen.screens[0], - }; - - getTask( - 'http://localhost:8080/api/1.0/tasks/'+responseDataTask1['id']+'?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', - responseDataTask1 - ); - - let responseDataTasks = { - 'status': 'ACTIVE', - 'taskId': 2, - 'process_request_id': 2, - }; - - getTasks( - 'http://localhost:8080/api/1.0/tasks?user_id=1&status=ACTIVE&process_request_id=1&include_sub_tasks=1', - responseDataTasks - ); - - let responseDataTask2 = { - 'status': 'ACTIVE', - 'process_request_id': 1, - 'taskId': 2, - 'screen': Screens.screens[0], - 'allow_interstitial': false, - 'interstitial_screen': null, - }; - - getTask( - 'http://localhost:8080/api/1.0/tasks/'+responseDataTask2['taskId']+'?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', - responseDataTask2 - ); - - cy.wait(2000); - cy.reload(); - }); + cy.get(".form-group").find("button").click(); + + cy.intercept("PUT", "http://localhost:5173/api/1.0/tasks/1").then( + function () { + const responseDataTask1 = { + status: "CLOSED", + process_request_id: 1, + id: 1, + screen: SingleScreen.screens[0], + allow_interstitial: true, + interstitial_screen: InterstitialScreen.screens[0] + }; + + getTask( + `http://localhost:5173/api/1.0/tasks/${responseDataTask1.id}?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission`, + responseDataTask1 + ); + + const responseDataTasks = { + status: "ACTIVE", + taskId: 2, + process_request_id: 2 + }; + + getTasks( + "http://localhost:5173/api/1.0/tasks?user_id=1&status=ACTIVE&process_request_id=1&include_sub_tasks=1", + responseDataTasks + ); + + const responseDataTask2 = { + status: "ACTIVE", + process_request_id: 1, + taskId: 2, + screen: Screens.screens[0], + allow_interstitial: false, + interstitial_screen: null + }; + + getTask( + `http://localhost:5173/api/1.0/tasks/${responseDataTask2.taskId}?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission`, + responseDataTask2 + ); + + cy.wait(2000); + cy.reload(); + } + ); - cy.url().should('eq', 'http://localhost:8080/tasks/2/edit'); + cy.url().should("eq", "http://localhost:5173/tasks/2/edit"); }); /* DNAT = Display Next Assigned Task @@ -544,48 +613,49 @@ describe('Task component', () => { \_______childTask1_______/ After childTask1 (Not DNAT) should redirect to tasks list */ - it('Task with display next assigned task unchecked should redirect to tasks list', () => { - cy.server(); - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', + it("Task with display next assigned task unchecked should redirect to tasks list", () => { + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", { id: 1, - advanceStatus: 'open', - component: 'task-screen', + advanceStatus: "open", + component: "task-screen", screen: SingleScreen.screens[0], process_request: { id: 1, - status: 'ACTIVE', - }, + status: "ACTIVE" + } } ); - cy.visit('/?scenario=TaskRedirect', {}); + cy.visit("/?scenario=TaskRedirect", {}); cy.wait(2000); - cy.get('.form-group').find('button').click(); - - cy.route('PUT', 'http://localhost:8080/api/1.0/tasks/1').then(function() { - let responseDataTask1 = { - 'status': 'CLOSED', - 'process_request_id': 1, - 'id': 1, - 'screen': SingleScreen.screens[0], - 'allow_interstitial': false, - 'interstitial_screen': null, - }; - - getTask( - 'http://localhost:8080/api/1.0/tasks/'+responseDataTask1['id']+'?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', - responseDataTask1 - ); - - cy.wait(2000); - cy.reload(); - }); + cy.get(".form-group").find("button").click(); + + cy.intercept("PUT", "http://localhost:5173/api/1.0/tasks/1").then( + function () { + const responseDataTask1 = { + status: "CLOSED", + process_request_id: 1, + id: 1, + screen: SingleScreen.screens[0], + allow_interstitial: false, + interstitial_screen: null + }; + + getTask( + `http://localhost:5173/api/1.0/tasks/${responseDataTask1.id}?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission`, + responseDataTask1 + ); + + cy.wait(2000); + cy.reload(); + } + ); - cy.url().should('eq', 'http://localhost:8080/tasks'); + cy.url().should("eq", "http://localhost:5173/tasks"); }); /* DNAT = Display Next Assigned Task @@ -593,53 +663,55 @@ describe('Task component', () => { (DNAT) After parentTask1 and not pending tasks should redirect to same request */ - it('Process without pending task should redirect to request', () => { - cy.server(); - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', + it("Process without pending task should redirect to request", () => { + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", { id: 1, - advanceStatus: 'open', - component: 'task-screen', + advanceStatus: "open", + component: "task-screen", screen: SingleScreen.screens[0], process_request: { id: 1, - status: 'ACTIVE', - }, + status: "ACTIVE" + } } ); - cy.visit('/?scenario=TaskRedirect', {}); + cy.visit("/?scenario=TaskRedirect", {}); cy.wait(2000); - cy.get('.form-group').find('button').click(); + cy.get(".form-group").find("button").click(); - cy.route('PUT', 'http://localhost:8080/api/1.0/tasks/1').then(function() { - let responseDataTask1 = { - 'status': 'CLOSED', - 'process_request_id': 1, - 'id': 1, - 'screen': SingleScreen.screens[0], - 'allow_interstitial': true, - 'interstitial_screen': InterstitialScreen.screens[0], - }; - - getTask( - 'http://localhost:8080/api/1.0/tasks/'+responseDataTask1['id']+'?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', - responseDataTask1 - ); + cy.intercept("PUT", "http://localhost:5173/api/1.0/tasks/1").then( + function () { + const responseDataTask1 = { + status: "CLOSED", + process_request_id: 1, + id: 1, + screen: SingleScreen.screens[0], + allow_interstitial: true, + interstitial_screen: InterstitialScreen.screens[0] + }; - getTasks('http://localhost:8080/api/1.0/tasks?user_id=1&status=ACTIVE&process_request_id=1&include_sub_tasks=1'); + getTask( + `http://localhost:5173/api/1.0/tasks/${responseDataTask1.id}?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission`, + responseDataTask1 + ); - }); + getTasks( + "http://localhost:5173/api/1.0/tasks?user_id=1&status=ACTIVE&process_request_id=1&include_sub_tasks=1" + ); + } + ); - cy.socketEvent('ProcessMaker\\Events\\ProcessUpdated', { + cy.socketEvent("ProcessMaker\\Events\\ProcessUpdated", { requestId: 1, - event: 'ACTIVITY_COMPLETED', + event: "ACTIVITY_COMPLETED" }); - cy.url().should('eq', 'http://localhost:8080/requests/1'); + cy.url().should("eq", "http://localhost:5173/requests/1"); }); /* DNAT = Display Next Assigned Task @@ -648,105 +720,102 @@ describe('Task component', () => { (DNAT) After childTask1 and not pending tasks should redirect to parent Request */ - it('Subprocess without pending task should redirect to parent request', () => { - cy.server(); - cy.route( - 'GET', - 'http://localhost:8080/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', + it("Subprocess without pending task should redirect to parent request", () => { + cy.intercept( + "GET", + "http://localhost:5173/api/1.0/tasks/1?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission", { id: 1, - advanceStatus: 'open', - component: 'task-screen', + advanceStatus: "open", + component: "task-screen", screen: SingleScreen.screens[0], process_request: { id: 2, - status: 'ACTIVE', - parent_request_id: 1, + status: "ACTIVE", + parent_request_id: 1 }, user_request_permission: [{ process_request_id: 2, allowed: true }] } ); - cy.visit('/?scenario=TaskRedirect', {}); + cy.visit("/?scenario=TaskRedirect", {}); cy.wait(2000); - cy.get('.form-group').find('button').click(); - - cy.route('PUT', 'http://localhost:8080/api/1.0/tasks/1').then(function() { - let responseDataTask1 = { - 'status': 'CLOSED', - 'process_request_id': 2, - 'parent_request_id': 3, - 'id': 1, - 'screen': SingleScreen.screens[0], - 'allow_interstitial': true, - 'interstitial_screen': InterstitialScreen.screens[0], - user_request_permission: [{ process_request_id: 3, allowed: true }, { process_request_id: 2, allowed: true }] - }; - - getTask( - 'http://localhost:8080/api/1.0/tasks/'+responseDataTask1['id']+'?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission', - responseDataTask1 - ); - - getTasks('http://localhost:8080/api/1.0/tasks?user_id=1&status=ACTIVE&process_request_id=1&include_sub_tasks=1'); - - cy.wait(2000); - cy.reload(); - }); + cy.get(".form-group").find("button").click(); + + cy.intercept("PUT", "http://localhost:5173/api/1.0/tasks/1").then( + function () { + const responseDataTask1 = { + status: "CLOSED", + process_request_id: 2, + parent_request_id: 3, + id: 1, + screen: SingleScreen.screens[0], + allow_interstitial: true, + interstitial_screen: InterstitialScreen.screens[0], + user_request_permission: [ + { process_request_id: 3, allowed: true }, + { process_request_id: 2, allowed: true } + ] + }; + + getTask( + `http://localhost:5173/api/1.0/tasks/${responseDataTask1.id}?include=data,user,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission`, + responseDataTask1 + ); + + getTasks( + "http://localhost:5173/api/1.0/tasks?user_id=1&status=ACTIVE&process_request_id=1&include_sub_tasks=1" + ); - cy.url().should('eq', 'http://localhost:8080/requests/3'); + cy.wait(2000); + cy.reload(); + } + ); + + cy.url().should("eq", "http://localhost:5173/requests/3"); }); }); function getTask(url, responseData) { - cy.route( - 'GET', - url, - { - id: responseData['id'], - advanceStatus: 'completed', - component: 'task-screen', - status: responseData['status'], - allow_interstitial: responseData['allow_interstitial'], - interstitial_screen: responseData['interstitial_screen'], - screen: responseData['screen'], - process_request: { - id: 1, - parent_request_id: responseData['parent_request_id'], - status: responseData['status'], - }, - user_request_permission: responseData['user_request_permission'] - } - ); + cy.intercept("GET", url, { + id: responseData.id, + advanceStatus: "completed", + component: "task-screen", + status: responseData.status, + allow_interstitial: responseData.allow_interstitial, + interstitial_screen: responseData.interstitial_screen, + screen: responseData.screen, + process_request: { + id: 1, + parent_request_id: responseData.parent_request_id, + status: responseData.status + }, + user_request_permission: responseData.user_request_permission + }); } function getTasks(url, responseData = null) { if (responseData) { - cy.route( - 'GET', - url, - { - data: - [ - { - id: responseData['taskId'], - advanceStatus: 'open', - process_id: 1, - process_request_id: responseData['process_request_id'], - subprocess_request_id: 1, - status: responseData['status'], - completed_at: null, - due_at: moment().add(1, 'day').toISOString(), - due_notified: 0, - process_request: { - id: 1, - status: responseData['status'], - }, - }, - ], - } - ); + cy.intercept("GET", url, { + data: [ + { + id: responseData.taskId, + advanceStatus: "open", + process_id: 1, + process_request_id: responseData.process_request_id, + subprocess_request_id: 1, + status: responseData.status, + completed_at: null, + due_at: moment().add(1, "day").toISOString(), + due_notified: 0, + process_request: { + id: 1, + status: responseData.status + } + } + ] + }); } else { - cy.route('GET', url, {data:[]}); + cy.intercept("GET", url, { data: [] }); } -} \ No newline at end of file +} diff --git a/tests/e2e/specs/TestValidationWithNestedSideEffects.spec.js b/tests/e2e/specs/TestValidationWithNestedSideEffects.spec.js index b54a13bd5..ae1eac527 100644 --- a/tests/e2e/specs/TestValidationWithNestedSideEffects.spec.js +++ b/tests/e2e/specs/TestValidationWithNestedSideEffects.spec.js @@ -1,6 +1,5 @@ describe("test validation with nested side effects", () => { beforeEach(() => { - cy.server(); cy.visit("/"); cy.showValidationOnLoad(); }); diff --git a/tests/e2e/specs/UndoRedo.spec.js b/tests/e2e/specs/UndoRedo.spec.js index 2b456ebbd..32b460273 100644 --- a/tests/e2e/specs/UndoRedo.spec.js +++ b/tests/e2e/specs/UndoRedo.spec.js @@ -1,19 +1,25 @@ -describe('Undo and Redo', () => { - it('Can Undo', () => { - cy.visit('/'); +describe("Undo and Redo", () => { + it("Can Undo", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=toolbar-undo]').click(); - cy.get('[data-cy=screen-drop-zone]').should('contain.text', 'Place your controls here.'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=toolbar-undo]").click(); + cy.get("[data-cy=screen-drop-zone]").should( + "contain.text", + "Place your controls here." + ); }); - it('Can Redo', () => { - cy.visit('/'); + it("Can Redo", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=toolbar-undo]').click(); - cy.get('[data-cy=toolbar-redo]').click(); - cy.get('[data-cy=screen-drop-zone]').should('not.contain.text', 'Place your controls here.'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=toolbar-undo]").click(); + cy.get("[data-cy=toolbar-redo]").click(); + cy.get("[data-cy=screen-drop-zone]").should("not.exist"); }); }); - \ No newline at end of file diff --git a/tests/e2e/specs/ValidationCalcsAndLoop.spec.js b/tests/e2e/specs/ValidationCalcsAndLoop.spec.js index 9969c37a0..c297b81b9 100644 --- a/tests/e2e/specs/ValidationCalcsAndLoop.spec.js +++ b/tests/e2e/specs/ValidationCalcsAndLoop.spec.js @@ -1,80 +1,80 @@ -describe('Validation Calcs properties and loop', () => { +describe("Validation Calcs properties and loop", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('Data is fully accessible from a collection screen', () => { - cy.loadFromJson('FOUR-4853.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Data is fully accessible from a collection screen", () => { + cy.loadFromJson("FOUR-4853.json", 0); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy=preview-data-input]') + cy.get("[data-cy=preview-data-input]") .click() .focused() - .type('{backspace}{backspace}') - .type('{\n"foo": {\n"one": "one",\n"two": "two"\n}\n}'); + .type("{backspace}{backspace}") + .type('{\n"foo": {\n"one": "one",\n"two": "two"'); - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=mode-preview]").click(); cy.get('[data-cy=preview-content] [data-cy="screen-field-foo.two"]') .parent() - .should('contain.text', 'two'); + .should("contain.text", "two"); - cy.get(':nth-child(2) > .form-group > :nth-child(1) > div > p') - .should('contain.text', 'output: one'); + cy.get(":nth-child(2) > .form-group > :nth-child(1) > div > p").should( + "contain.text", + "output: one" + ); }); - it('Calcs working with select list and loop', () => { - cy.loadFromJson('FOUR-5086.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Calcs working with select list and loop", () => { + cy.loadFromJson("FOUR-5086.json", 0); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').selectOption('Don Quijote'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).selectOption("Don Quijote"); - cy.get('[data-cy=preview-content] [data-cy="screen-field-cant"]').type('12'); + cy.get('[data-cy=preview-content] [data-cy="screen-field-cant"]').type( + "12" + ); // Check final result - cy.assertPreviewData( - { - - 'form_select_list_1': - [ - { - 'value': - 'https://www.infobae.com/new-resizer/9gv8XYFq7qmOw86jtRR_u7AlDdI=/420x630/filters:format(jpg):quality(85)/s3.amazonaws.com/arc-wordpress-client-uploads/infobae-wp/wp-content/uploads/2016/07/20201800/mejores-libros-Don-Quijote-sf.jpg', - 'content': - 'Don Quijote', - }, - ], - 'loop_1': - [ - { - 'value': - 'https://www.infobae.com/new-resizer/9gv8XYFq7qmOw86jtRR_u7AlDdI=/420x630/filters:format(jpg):quality(85)/s3.amazonaws.com/arc-wordpress-client-uploads/infobae-wp/wp-content/uploads/2016/07/20201800/mejores-libros-Don-Quijote-sf.jpg', - 'content': - 'Don Quijote', - 'cant': - 12, - 'tot': - 1200, - }, - ], - 'total': - 1200, - }); + cy.assertPreviewData({ + form_select_list_1: [ + { + value: + "https://www.infobae.com/new-resizer/9gv8XYFq7qmOw86jtRR_u7AlDdI=/420x630/filters:format(jpg):quality(85)/s3.amazonaws.com/arc-wordpress-client-uploads/infobae-wp/wp-content/uploads/2016/07/20201800/mejores-libros-Don-Quijote-sf.jpg", + content: "Don Quijote" + } + ], + loop_1: [ + { + value: + "https://www.infobae.com/new-resizer/9gv8XYFq7qmOw86jtRR_u7AlDdI=/420x630/filters:format(jpg):quality(85)/s3.amazonaws.com/arc-wordpress-client-uploads/infobae-wp/wp-content/uploads/2016/07/20201800/mejores-libros-Don-Quijote-sf.jpg", + content: "Don Quijote", + cant: 12, + tot: 1200 + } + ], + total: 1200 + }); }); - it('Calcs working with loop', () => { - cy.loadFromJson('FOUR-5161.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Calcs working with loop", () => { + cy.loadFromJson("FOUR-5161.json", 0); + cy.get("[data-cy=mode-preview]").click(); - cy.get('[data-cy=preview-content] [name=form_checkbox_1]').click(); + cy.get("[data-cy=preview-content] [name=form_checkbox_1]").click(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-color"]').type('red'); + cy.get('[data-cy=preview-content] [data-cy="screen-field-color"]').type( + "red" + ); - cy.get('[data-cy=loop-loop_1-add]').click(); + cy.get("[data-cy=loop-loop_1-add]").click(); - cy.get(':nth-child(2) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > .row > :nth-child(1) > :nth-child(1) > .form-group > [data-cy=screen-field-color]').type('green'); + cy.get( + ":nth-child(2) > .container-fluid > :nth-child(1) > .page > :nth-child(1) > .row > :nth-child(1) > :nth-child(1) > .form-group > [data-cy=screen-field-color]" + ).type("green"); // Check final result cy.assertPreviewData({ diff --git a/tests/e2e/specs/ValidationNestedVariable.spec.js b/tests/e2e/specs/ValidationNestedVariable.spec.js index e6c00fc3c..ad626fca2 100644 --- a/tests/e2e/specs/ValidationNestedVariable.spec.js +++ b/tests/e2e/specs/ValidationNestedVariable.spec.js @@ -1,84 +1,113 @@ -describe('Validate nested variable', () => { +describe("Validate nested variable", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); cy.showValidationOnLoad(); }); - it('Verify validations with nested variable user.properties.form_input_1', () => { + it("Verify validations with nested variable user.properties.form_input_1", () => { // Variable name: user.properties.form_input_1 - cy.loadFromJson('validation_nested_variable.json', 0); + cy.loadFromJson("validation_nested_variable.json", 0); // set init screen test data // cy.setPreviewDataInput({person: []}); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Field is hidden by default - cy.get('[data-cy=preview-content] [name="user.properties.form_input_1"]').should('not.be.visible'); + cy.get( + '[data-cy=preview-content] [name="user.properties.form_input_1"]' + ).should("not.be.visible"); // Should not be required cy.get('[data-cy=preview-content] [name="user.properties.form_input_1"]') .parent() - .should('not.contain.text', 'Field is required'); + .should("not.contain.text", "Field is required"); // Should not be a valid email cy.get('[data-cy=preview-content] [name="user.properties.form_input_1"]') .parent() - .should('not.contain.text', 'Must be a valid email address'); + .should("not.contain.text", "Must be a valid email address"); // When the checkbox is check it should be visible - cy.get('[data-cy=preview-content] [name=form_checkbox_1]').click(); - cy.get('[data-cy=preview-content] [name="user.properties.form_input_1"]').should('be.visible'); + cy.get("[data-cy=preview-content] [name=form_checkbox_1]").click(); + cy.get( + '[data-cy=preview-content] [name="user.properties.form_input_1"]' + ).should("be.visible"); // The field is required cy.get('[data-cy=preview-content] [name="user.properties.form_input_1"]') .parent() - .should('contain.text', 'Field is required'); + .should("contain.text", "Field is required"); // The field should be an email - cy.get('[data-cy=preview-content] [name="user.properties.form_input_1"]').clear().type('invalid email'); + cy.get('[data-cy=preview-content] [name="user.properties.form_input_1"]') + .clear() + .type("invalid email"); cy.get('[data-cy=preview-content] [name="user.properties.form_input_1"]') .parent() - .should('contain.text', 'Must be a valid email address'); + .should("contain.text", "Must be a valid email address"); - cy.get('[data-cy=preview-content] [name="user.properties.form_input_1"]').clear().type('info@processmaker.com'); + cy.get('[data-cy=preview-content] [name="user.properties.form_input_1"]') + .clear() + .type("info@processmaker.com"); }); - it('Verify validations with variable of three levels user.properties.three.form_input_1', () => { + it("Verify validations with variable of three levels user.properties.three.form_input_1", () => { // Variable name: user.properties.form_input_1 - cy.loadFromJson('validation_nested_variable.json', 0); - cy.get('[data-cy=screen-element-container]').eq(1).click(); - cy.get('[data-cy=inspector-name]').clear().type('user.properties.three.form_input_1'); + cy.loadFromJson("validation_nested_variable.json", 0); + cy.get("[data-cy=screen-element-container]").eq(1).click(); + cy.get("[data-cy=inspector-name]") + .clear() + .type("user.properties.three.form_input_1"); // set init screen test data // cy.setPreviewDataInput({person: []}); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Field is hidden by default - cy.get('[data-cy=preview-content] [name="user.properties.three.form_input_1"]').should('not.be.visible'); + cy.get( + '[data-cy=preview-content] [name="user.properties.three.form_input_1"]' + ).should("not.be.visible"); // Should not be required - cy.get('[data-cy=preview-content] [name="user.properties.three.form_input_1"]') + cy.get( + '[data-cy=preview-content] [name="user.properties.three.form_input_1"]' + ) .parent() - .should('not.contain.text', 'Field is required'); + .should("not.contain.text", "Field is required"); // Should not be a valid email - cy.get('[data-cy=preview-content] [name="user.properties.three.form_input_1"]') + cy.get( + '[data-cy=preview-content] [name="user.properties.three.form_input_1"]' + ) .parent() - .should('not.contain.text', 'Must be a valid email address'); + .should("not.contain.text", "Must be a valid email address"); // When the checkbox is check it should be visible - cy.get('[data-cy=preview-content] [name=form_checkbox_1]').click(); - cy.get('[data-cy=preview-content] [name="user.properties.three.form_input_1"]').should('be.visible'); + cy.get("[data-cy=preview-content] [name=form_checkbox_1]").click(); + cy.get( + '[data-cy=preview-content] [name="user.properties.three.form_input_1"]' + ).should("be.visible"); // The field is required - cy.get('[data-cy=preview-content] [name="user.properties.three.form_input_1"]') + cy.get( + '[data-cy=preview-content] [name="user.properties.three.form_input_1"]' + ) .parent() - .should('contain.text', 'Field is required'); + .should("contain.text", "Field is required"); // The field should be an email - cy.get('[data-cy=preview-content] [name="user.properties.three.form_input_1"]').clear().type('invalid email'); - cy.get('[data-cy=preview-content] [name="user.properties.three.form_input_1"]') + cy.get( + '[data-cy=preview-content] [name="user.properties.three.form_input_1"]' + ) + .clear() + .type("invalid email"); + cy.get( + '[data-cy=preview-content] [name="user.properties.three.form_input_1"]' + ) .parent() - .should('contain.text', 'Must be a valid email address'); + .should("contain.text", "Must be a valid email address"); - cy.get('[data-cy=preview-content] [name="user.properties.three.form_input_1"]').clear().type('info@processmaker.com'); + cy.get( + '[data-cy=preview-content] [name="user.properties.three.form_input_1"]' + ) + .clear() + .type("info@processmaker.com"); }); }); diff --git a/tests/e2e/specs/ValidationRules.spec.js b/tests/e2e/specs/ValidationRules.spec.js index 20d466a94..57b5cbb1c 100644 --- a/tests/e2e/specs/ValidationRules.spec.js +++ b/tests/e2e/specs/ValidationRules.spec.js @@ -1,142 +1,135 @@ -import moment from 'moment'; +import moment from "moment"; -describe('Validation Rules', () => { +describe("Validation Rules", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); cy.showValidationOnLoad(); }); - it('Invalid default values', () => { - cy.loadFromJson('validation_rules.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Invalid default values", () => { + cy.loadFromJson("validation_rules.json", 0); + cy.get("[data-cy=mode-preview]").click(); // ACCEPTED CHECKBOX cy.get('[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]') .parent() - .should('contain.text', 'Field must be accepted'); - cy.get('[data-cy=preview-content] [name=form_checkbox_1]').click(); + .should("contain.text", "Field must be accepted"); + cy.get("[data-cy=preview-content] [name=form_checkbox_1]").click(); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]') .parent() - .should('not.contain.text', 'Field must be accepted'); + .should("not.contain.text", "Field must be accepted"); // ACCEPTED INPUT cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_1"]') .parent() - .should('contain.text', 'Field must be accepted'); - cy.get('[data-cy=preview-content] [name=form_input_1]').type('on'); + .should("contain.text", "Field must be accepted"); + cy.get("[data-cy=preview-content] [name=form_input_1]").type("on"); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_1"]') .parent() - .should('not.contain.text', 'Field must be accepted'); + .should("not.contain.text", "Field must be accepted"); // IN LIST cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_2"]') .parent() - .should('contain.text', 'Invalid value'); - cy.get('[data-cy=preview-content] [name=form_input_2]').type('2'); + .should("contain.text", "Invalid value"); + cy.get("[data-cy=preview-content] [name=form_input_2]").type("2"); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_2"]') .parent() - .should('not.contain.text', 'Invalid value'); + .should("not.contain.text", "Invalid value"); // NOT IN LIST - cy.get('[data-cy=preview-content] [name=form_input_3]').type('2'); + cy.get("[data-cy=preview-content] [name=form_input_3]").type("2"); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_3"]') .parent() - .should('contain.text', 'Invalid value'); - cy.get('[data-cy=preview-content] [name=form_input_3]').type('4'); + .should("contain.text", "Invalid value"); + cy.get("[data-cy=preview-content] [name=form_input_3]").type("4"); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_3"]') .parent() - .should('not.contain.text', 'Invalid value'); + .should("not.contain.text", "Invalid value"); // REGEX cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_4"]') .parent() - .should('contain.text', 'Invalid value'); - cy.get('[data-cy=preview-content] [name=form_input_4]').type('Aaa1'); + .should("contain.text", "Invalid value"); + cy.get("[data-cy=preview-content] [name=form_input_4]").type("Aaa1"); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_4"]') .parent() - .should('contain.text', 'Invalid value'); - cy.get('[data-cy=preview-content] [name=form_input_4]') + .should("contain.text", "Invalid value"); + cy.get("[data-cy=preview-content] [name=form_input_4]") .clear() - .type('Abc1'); + .type("Abc1"); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_4"]') .parent() - .should('not.contain.text', 'Invalid value'); + .should("not.contain.text", "Invalid value"); // between - cy.get('[data-cy=preview-content] [name=form_input_5]').type(10); + cy.get("[data-cy=preview-content] [name=form_input_5]").type(10); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_5"]') .parent() - .should('contain.text', 'Must have a value between 1 and 5'); - cy.get('[data-cy=preview-content] [name=form_input_5]') - .clear() - .type(1); + .should("contain.text", "Must have a value between 1 and 5"); + cy.get("[data-cy=preview-content] [name=form_input_5]").clear().type(1); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_5"]') .parent() - .should('not.contain.text', 'Must have a value between 1 and 5'); + .should("not.contain.text", "Must have a value between 1 and 5"); // same - cy.get('[data-cy=preview-content] [name=form_input_6]').type(10); + cy.get("[data-cy=preview-content] [name=form_input_6]").type(10); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_6"]') .parent() - .should('contain.text', 'Must be same as form_input_5'); - cy.get('[data-cy=preview-content] [name=form_input_6]') - .clear() - .type(1); + .should("contain.text", "Must be same as form_input_5"); + cy.get("[data-cy=preview-content] [name=form_input_6]").clear().type(1); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_6"]') .parent() - .should('not.contain.text', 'Must be same as form_input_5'); + .should("not.contain.text", "Must be same as form_input_5"); // same cy.get( - '[data-cy=preview-content] [data-cy=screen-field-form_date_picker_1]' - ) - .should('contain.text', 'Must be equal or before today'); + "[data-cy=preview-content] [data-cy=screen-field-form_date_picker_1]" + ).should("contain.text", "Must be equal or before today"); cy.get( '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"]' ).pickToday(); cy.get( '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"]' - ) - .should('not.contain.text', 'Must be equal or before today'); + ).should("not.contain.text", "Must be equal or before today"); - //submit form valid - cy.get(':nth-child(9) > .form-group > .btn').click(); - cy.on('window:alert', (str) => { - expect(str).to.equal('Preview Form was Submitted'); + // submit form valid + cy.get(":nth-child(9) > .form-group > .btn").click(); + cy.on("window:alert", (str) => { + expect(str).to.equal("Preview Form was Submitted"); }); - cy.on('window:confirm', () => true); + cy.on("window:confirm", () => true); }); - it('Validations should be skipped for readonly fields', () => { + it("Validations should be skipped for readonly fields", () => { // Setup let alert = false; - cy.on('window:alert', msg => alert = msg); - cy.loadFromJson('screen_with_readonly_fields.json', 0); + cy.on("window:alert", (msg) => (alert = msg)); + cy.loadFromJson("screen_with_readonly_fields.json", 0); // In editor: ensure standard required field displays error while readonly required field does not cy.get('[data-cy=editor-content] [name="form_input"]') .parent() - .find('.invalid-feedback') - .should('be.visible'); + .find(".invalid-feedback") + .should("be.visible"); cy.get('[data-cy=editor-content] [name="form_input_readonly"]') .parent() - .find('.invalid-feedback') - .should('be.not.visible'); + .find(".invalid-feedback") + .should("not.exist"); // In preview: ensure standard required field displays error while readonly required field does not - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); cy.get('[data-cy=preview-content] [name="form_input"]') .parent() - .find('.invalid-feedback') - .should('be.visible'); + .find(".invalid-feedback") + .should("be.visible"); cy.get('[data-cy=preview-content] [name="form_input_readonly"]') .parent() - .find('.invalid-feedback') - .should('be.not.visible'); + .find(".invalid-feedback") + .should("not.exist"); // Ensure the form cannot yet be submitted cy.get('[data-cy=preview-content] [name="submit_button"]') @@ -144,217 +137,399 @@ describe('Validation Rules', () => { .then(() => expect(alert).to.equal(false)); // Fill out the required missing field; ensure the form *can* be submitted - cy.get('[data-cy=preview-content] [name="form_input"]') - .type('text'); + cy.get('[data-cy=preview-content] [name="form_input"]').type("text"); cy.get('[data-cy=preview-content] [name="submit_button"]') .click() - .then(() => expect(alert).to.equal('Preview Form was Submitted')); + .then(() => expect(alert).to.equal("Preview Form was Submitted")); }); - it('RequireIf validation must be able to access the _parent\'s variables', () => { - cy.loadFromJson('test_parent_in_validations.json', 0); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name="form_input_1"]').parent().find('.invalid-feedback').should('be.not.visible'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.not.visible'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]').selectOption('YES'); - cy.get('[data-cy=preview-content] [name="form_input_1"]').parent().find('.invalid-feedback').should('be.visible'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.visible'); + it("RequireIf validation must be able to access the _parent's variables", () => { + cy.loadFromJson("test_parent_in_validations.json", 0); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy=preview-content] [name="form_input_1"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_1"]' + ).selectOption("YES"); + cy.get('[data-cy=preview-content] [name="form_input_1"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); }); - it('Date Validations must be able to access the _parent\'s variables', () => { - cy.loadFromJson('test_parent_in_validations.json', 0); + it("Date Validations must be able to access the _parent's variables", () => { + cy.loadFromJson("test_parent_in_validations.json", 0); - const date = moment(new Date()).format('YYYY-MM-DD'); - const dateBefore = moment(new Date()).subtract(1, 'days').format('YYYY-MM-DD'); - const dateAfter = moment(new Date()).add(1, 'days').format('YYYY-MM-DD'); + const date = moment(new Date()).format("YYYY-MM-DD"); + const dateBefore = moment(new Date()) + .subtract(1, "days") + .format("YYYY-MM-DD"); + const dateAfter = moment(new Date()).add(1, "days").format("YYYY-MM-DD"); // Change validation rule to After Date - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').eq(2).click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").eq(2).click(); cy.get('[data-cy="inspector-validation"] [data-cy="remove-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]' + ).click(); cy.get('[data-cy="inspector-validation"] [data-cy="add-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="select-rule"]').selectOption('After Date'); - cy.get('[data-cy="inspector-validation"] [data-cy="save-rule"]:visible').click(); - cy.get('[data-cy="inspector-validation"] [name="Date"]').type('_parent.form_input_1'); - cy.get('[data-cy="inspector-validation"] [data-cy="update-rule"]:visible').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="select-rule"]' + ).selectOption("After Date"); + cy.get( + '[data-cy="inspector-validation"] [data-cy="save-rule"]:visible' + ).click(); + cy.get('[data-cy="inspector-validation"] [name="Date"]').type( + "_parent.form_input_1" + ); + cy.get( + '[data-cy="inspector-validation"] [data-cy="update-rule"]:visible' + ).click(); + cy.get("[data-cy=mode-preview]").click(); cy.get('[data-cy=preview-content] [name="form_input_1"]').type(dateBefore); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.visible'); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); cy.get('[data-cy=preview-content] [name="form_input_2"]').type(date); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.not.visible'); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); // Change validation rule to After or Equal to Date - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').eq(2).click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").eq(2).click(); cy.get('[data-cy="inspector-validation"] [data-cy="remove-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]' + ).click(); cy.get('[data-cy="inspector-validation"] [data-cy="add-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="select-rule"]').selectOption('After or Equal to Date'); - cy.get('[data-cy="inspector-validation"] [data-cy="save-rule"]:visible').click(); - cy.get('[data-cy="inspector-validation"] [name="Date"]').type('_parent.form_input_1'); - cy.get('[data-cy="inspector-validation"] [data-cy="update-rule"]:visible').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="select-rule"]' + ).selectOption("After or Equal to Date"); + cy.get( + '[data-cy="inspector-validation"] [data-cy="save-rule"]:visible' + ).click(); + cy.get('[data-cy="inspector-validation"] [name="Date"]').type( + "_parent.form_input_1" + ); + cy.get( + '[data-cy="inspector-validation"] [data-cy="update-rule"]:visible' + ).click(); + cy.get("[data-cy=mode-preview]").click(); cy.get('[data-cy=preview-content] [name="form_input_1"]').type(dateBefore); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.visible'); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); cy.get('[data-cy=preview-content] [name="form_input_2"]').type(dateBefore); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.not.visible'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').clear().type(date); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.not.visible'); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .clear() + .type(date); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); // Change validation rule to Before date - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').eq(2).click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").eq(2).click(); cy.get('[data-cy="inspector-validation"] [data-cy="remove-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]' + ).click(); cy.get('[data-cy="inspector-validation"] [data-cy="add-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="select-rule"]').selectOption('Before Date'); - cy.get('[data-cy="inspector-validation"] [data-cy="save-rule"]:visible').click(); - cy.get('[data-cy="inspector-validation"] [name="Date"]').type('_parent.form_input_1'); - cy.get('[data-cy="inspector-validation"] [data-cy="update-rule"]:visible').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="select-rule"]' + ).selectOption("Before Date"); + cy.get( + '[data-cy="inspector-validation"] [data-cy="save-rule"]:visible' + ).click(); + cy.get('[data-cy="inspector-validation"] [name="Date"]').type( + "_parent.form_input_1" + ); + cy.get( + '[data-cy="inspector-validation"] [data-cy="update-rule"]:visible' + ).click(); + cy.get("[data-cy=mode-preview]").click(); cy.get('[data-cy=preview-content] [name="form_input_1"]').type(dateAfter); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.visible'); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); cy.get('[data-cy=preview-content] [name="form_input_2"]').type(date); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.not.visible'); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); // Change validation rule to Before or Equal to Date - cy.get('[data-cy=mode-editor]').click(); - cy.get('[data-cy=screen-element-container]').eq(2).click(); + cy.get("[data-cy=mode-editor]").click(); + cy.get("[data-cy=screen-element-container]").eq(2).click(); cy.get('[data-cy="inspector-validation"] [data-cy="remove-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]' + ).click(); cy.get('[data-cy="inspector-validation"] [data-cy="add-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="select-rule"]').selectOption('Before or Equal to Date'); - cy.get('[data-cy="inspector-validation"] [data-cy="save-rule"]:visible').click(); - cy.get('[data-cy="inspector-validation"] [name="Date"]').type('_parent.form_input_1'); - cy.get('[data-cy="inspector-validation"] [data-cy="update-rule"]:visible').click(); - cy.get('[data-cy=mode-preview]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="select-rule"]' + ).selectOption("Before or Equal to Date"); + cy.get( + '[data-cy="inspector-validation"] [data-cy="save-rule"]:visible' + ).click(); + cy.get('[data-cy="inspector-validation"] [name="Date"]').type( + "_parent.form_input_1" + ); + cy.get( + '[data-cy="inspector-validation"] [data-cy="update-rule"]:visible' + ).click(); + cy.get("[data-cy=mode-preview]").click(); cy.get('[data-cy=preview-content] [name="form_input_1"]').type(dateAfter); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.visible'); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); cy.get('[data-cy=preview-content] [name="form_input_2"]').type(dateAfter); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.not.visible'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').clear().type(date); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.not.visible'); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .clear() + .type(date); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); }); - it('RequireUnless must be able to access the _parent\'s variables', () => { - cy.loadFromJson('test_parent_in_validations.json', 0); + it("RequireUnless must be able to access the _parent's variables", () => { + cy.loadFromJson("test_parent_in_validations.json", 0); // Change validation rule to Required Unless - cy.get('[data-cy=screen-element-container]').eq(2).click(); + cy.get("[data-cy=screen-element-container]").eq(2).click(); cy.get('[data-cy="inspector-validation"] [data-cy="remove-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]' + ).click(); cy.get('[data-cy="inspector-validation"] [data-cy="add-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="select-rule"]').selectOption('Required Unless'); - cy.get('[data-cy="inspector-validation"] [data-cy="save-rule"]:visible').click(); - cy.get('[data-cy="inspector-validation"] input[name="variable-name"]').type('_parent.form_input_1'); - cy.get('[data-cy="inspector-validation"] input[name="variable-value"]').type('abc'); - cy.get('[data-cy="inspector-validation"] [data-cy="update-rule"]:visible').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.visible'); - cy.get('[data-cy=preview-content] [name="form_input_1"]').type('abc'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.not.visible'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').type('abc'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.not.visible'); + cy.get( + '[data-cy="inspector-validation"] [data-cy="select-rule"]' + ).selectOption("Required Unless"); + cy.get( + '[data-cy="inspector-validation"] [data-cy="save-rule"]:visible' + ).click(); + cy.get('[data-cy="inspector-validation"] input[name="variable-name"]').type( + "_parent.form_input_1" + ); + cy.get( + '[data-cy="inspector-validation"] input[name="variable-value"]' + ).type("abc"); + cy.get( + '[data-cy="inspector-validation"] [data-cy="update-rule"]:visible' + ).click(); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); + cy.get('[data-cy=preview-content] [name="form_input_1"]').type("abc"); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); + cy.get('[data-cy=preview-content] [name="form_input_2"]').type("abc"); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); }); - it('SameAs must be able to access the _parent\'s variables', () => { - cy.loadFromJson('test_parent_in_validations.json', 0); + it("SameAs must be able to access the _parent's variables", () => { + cy.loadFromJson("test_parent_in_validations.json", 0); // Change validation rule to Same - cy.get('[data-cy=screen-element-container]').eq(2).click(); + cy.get("[data-cy=screen-element-container]").eq(2).click(); cy.get('[data-cy="inspector-validation"] [data-cy="remove-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]' + ).click(); cy.get('[data-cy="inspector-validation"] [data-cy="add-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="select-rule"]').selectOption('Same'); - cy.get('[data-cy="inspector-validation"] [data-cy="save-rule"]:visible').click(); - cy.get('[data-cy="inspector-validation"] input[name="variable-name"]').type('_parent.form_input_1'); - cy.get('[data-cy="inspector-validation"] [data-cy="update-rule"]:visible').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name="form_input_1"]').type('abc'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.visible'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').type('abc'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.not.visible'); + cy.get( + '[data-cy="inspector-validation"] [data-cy="select-rule"]' + ).selectOption("Same"); + cy.get( + '[data-cy="inspector-validation"] [data-cy="save-rule"]:visible' + ).click(); + cy.get('[data-cy="inspector-validation"] input[name="variable-name"]').type( + "_parent.form_input_1" + ); + cy.get( + '[data-cy="inspector-validation"] [data-cy="update-rule"]:visible' + ).click(); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy=preview-content] [name="form_input_1"]').type("abc"); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); + cy.get('[data-cy=preview-content] [name="form_input_2"]').type("abc"); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); }); - it('Access to Request _parent variables', () => { - cy.loadFromJson('test_parent_in_validations.json', 0); - cy.setPreviewDataInput({_parent: {user_name: 'from_parent_request'}}); + it("Access to Request _parent variables", () => { + cy.loadFromJson("test_parent_in_validations.json", 0); + cy.setPreviewDataInput({ _parent: { user_name: "from_parent_request" } }); // Change validation rule to Same (input 1) - cy.get('[data-cy=screen-element-container]').eq(1).click(); + cy.get("[data-cy=screen-element-container]").eq(1).click(); cy.get('[data-cy="inspector-validation"] [data-cy="remove-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]' + ).click(); cy.get('[data-cy="inspector-validation"] [data-cy="add-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="select-rule"]').selectOption('Same'); - cy.get('[data-cy="inspector-validation"] [data-cy="save-rule"]:visible').click(); - cy.get('[data-cy="inspector-validation"] input[name="variable-name"]').type('_parent.user_name'); - cy.get('[data-cy="inspector-validation"] [data-cy="update-rule"]:visible').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="select-rule"]' + ).selectOption("Same"); + cy.get( + '[data-cy="inspector-validation"] [data-cy="save-rule"]:visible' + ).click(); + cy.get('[data-cy="inspector-validation"] input[name="variable-name"]').type( + "_parent.user_name" + ); + cy.get( + '[data-cy="inspector-validation"] [data-cy="update-rule"]:visible' + ).click(); // Change validation rule to Same (input 1 inside loop) - cy.get('[data-cy=screen-element-container]').eq(2).click(); + cy.get("[data-cy=screen-element-container]").eq(2).click(); cy.get('[data-cy="inspector-validation"] [data-cy="remove-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]').click(); + cy.get( + '[data-cy="inspector-validation"] [data-cy="confirm-delete-rule"]' + ).click(); cy.get('[data-cy="inspector-validation"] [data-cy="add-rule"]').click(); - cy.get('[data-cy="inspector-validation"] [data-cy="select-rule"]').selectOption('Same'); - cy.get('[data-cy="inspector-validation"] [data-cy="save-rule"]:visible').click(); - cy.get('[data-cy="inspector-validation"] input[name="variable-name"]').type('_parent._parent.user_name'); - cy.get('[data-cy="inspector-validation"] [data-cy="update-rule"]:visible').click(); - - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name="form_input_1"]').parent().find('.invalid-feedback').should('be.visible'); - cy.get('[data-cy=preview-content] [name="form_input_1"]').type('abc'); - cy.get('[data-cy=preview-content] [name="form_input_1"]').parent().find('.invalid-feedback').should('be.visible'); - cy.get('[data-cy=preview-content] [name="form_input_1"]').clear().type('from_parent_request'); - cy.get('[data-cy=preview-content] [name="form_input_1"]').parent().find('.invalid-feedback').should('be.not.visible'); - - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.visible'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').type('abc'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.visible'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').clear().type('from_parent_request'); - cy.get('[data-cy=preview-content] [name="form_input_2"]').parent().find('.invalid-feedback').should('be.not.visible'); + cy.get( + '[data-cy="inspector-validation"] [data-cy="select-rule"]' + ).selectOption("Same"); + cy.get( + '[data-cy="inspector-validation"] [data-cy="save-rule"]:visible' + ).click(); + cy.get('[data-cy="inspector-validation"] input[name="variable-name"]').type( + "_parent._parent.user_name" + ); + cy.get( + '[data-cy="inspector-validation"] [data-cy="update-rule"]:visible' + ).click(); + + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy=preview-content] [name="form_input_1"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); + cy.get('[data-cy=preview-content] [name="form_input_1"]').type("abc"); + cy.get('[data-cy=preview-content] [name="form_input_1"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); + cy.get('[data-cy=preview-content] [name="form_input_1"]') + .clear() + .type("from_parent_request"); + cy.get('[data-cy=preview-content] [name="form_input_1"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); + + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); + cy.get('[data-cy=preview-content] [name="form_input_2"]').type("abc"); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("be.visible"); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .clear() + .type("from_parent_request"); + cy.get('[data-cy=preview-content] [name="form_input_2"]') + .parent() + .find(".invalid-feedback") + .should("not.exist"); }); - it('Required IF with boolean values', () => { - cy.loadFromJson('required_if_with_checkbox.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Required IF with boolean values", () => { + cy.loadFromJson("required_if_with_checkbox.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Check box 1 - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]').click(); - cy.shouldHaveValidationErrors('screen-field-form_input_2'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]' + ).click(); + cy.shouldHaveValidationErrors("screen-field-form_input_2"); // Uncheck box 1 - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]').click(); - cy.shouldNotHaveValidationErrors('screen-field-form_input_2'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]' + ).click(); + cy.shouldNotHaveValidationErrors("screen-field-form_input_2"); // Check box 1 - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]').click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]' + ).click(); // Fill name - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_2"]').clear().type('test'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_2'); + cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_2"]') + .clear() + .type("test"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_2"); }); - it('Required Unless with boolean values', () => { - cy.loadFromJson('required_unless_with_checkbox.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Required Unless with boolean values", () => { + cy.loadFromJson("required_unless_with_checkbox.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Check box 1 - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]').click(); - cy.shouldHaveValidationErrors('screen-field-form_input_2'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]' + ).click(); + cy.shouldHaveValidationErrors("screen-field-form_input_2"); // Uncheck box 1 - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]').click(); - cy.shouldNotHaveValidationErrors('screen-field-form_input_2'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]' + ).click(); + cy.shouldNotHaveValidationErrors("screen-field-form_input_2"); // Check box 1 - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]').click(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_checkbox_1"]' + ).click(); // Fill name cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_2"]') .clear() - .type('test'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_2'); + .type("test"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_2"); }); }); diff --git a/tests/e2e/specs/ValidationRulesAdvanced.spec.js b/tests/e2e/specs/ValidationRulesAdvanced.spec.js index cb6bcd6ba..d4fa15777 100644 --- a/tests/e2e/specs/ValidationRulesAdvanced.spec.js +++ b/tests/e2e/specs/ValidationRulesAdvanced.spec.js @@ -1,98 +1,120 @@ - -describe('Validation Rules (Advanced test)', () => { +describe("Validation Rules (Advanced test)", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); cy.showValidationOnLoad(); }); - it('Verify all validation rules within loops', () => { - cy.loadFromJson('validation rules loop.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Verify all validation rules within loops", () => { + cy.loadFromJson("validation rules loop.json", 0); + cy.get("[data-cy=mode-preview]").click(); - fillInputText('screen-field-form_input_1', 0, '1'); + fillInputText("screen-field-form_input_1", 0, "1"); - fillInputText('screen-field-form_input_2', 0, 'abc'); + fillInputText("screen-field-form_input_2", 0, "abc"); - fillInputText('screen-field-form_input_3', 0, '123'); + fillInputText("screen-field-form_input_3", 0, "123"); - fillInputText('screen-field-form_input_4', 0, '10'); + fillInputText("screen-field-form_input_4", 0, "10"); - fillInputText('screen-field-Email', 0, 'john.doe@example.com'); + fillInputText("screen-field-Email", 0, "john.doe@example.com"); - fillInputText('screen-field-form_input_6', 0, '2020-10-10'); + fillInputText("screen-field-form_input_6", 0, "2020-10-10"); - fillInputText('screen-field-form_input_7', 0, '8'); + fillInputText("screen-field-form_input_7", 0, "8"); - fillInputText('screen-field-form_input_8', 0, '12345'); + fillInputText("screen-field-form_input_8", 0, "12345"); - fillInputText('screen-field-form_input_15', 0, 'john.doe@example.com'); - fillInputText('screen-field-form_input_16', 0, 'john.doe@example.com'); + fillInputText("screen-field-form_input_15", 0, "john.doe@example.com"); + fillInputText("screen-field-form_input_16", 0, "john.doe@example.com"); - fillInputText('screen-field-form_input_5', 0, 'https://www.example.com'); + fillInputText("screen-field-form_input_5", 0, "https://www.example.com"); - fillInputText('screen-field-form_input_9', 0, '123'); + fillInputText("screen-field-form_input_9", 0, "123"); - fillInputText('screen-field-form_input_10', 0, '8'); + fillInputText("screen-field-form_input_10", 0, "8"); - fillInputText('screen-field-form_input_11', 0, 'x'); + fillInputText("screen-field-form_input_11", 0, "x"); - fillInputText('screen-field-Required', 0, 'ok'); + fillInputText("screen-field-Required", 0, "ok"); - fillInputText('screen-field-form_input_14', 0, 'paola'); - fillInputText('screen-field-form_input_13', 0, 'paola'); + fillInputText("screen-field-form_input_14", 0, "paola"); + fillInputText("screen-field-form_input_13", 0, "paola"); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]').selectOption('one'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]' + ).selectOption("one"); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"]').pickToday(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]').pickTomorrow(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_3"]').pickToday(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_4"]').pickYesterday(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_5"]').pickToday(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_6"]').pickTomorrow(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_7"]').pickToday(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_8"]').pickYesterday(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"]' + ).pickToday(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_2"]' + ).pickTomorrow(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_3"]' + ).pickToday(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_4"]' + ).pickYesterday(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_5"]' + ).pickToday(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_6"]' + ).pickTomorrow(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_7"]' + ).pickToday(); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_date_picker_8"]' + ).pickYesterday(); shouldNotHaveValidationErrors(); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]').selectOption('two'); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_select_list_2"]' + ).selectOption("two"); shouldHaveValidationErrors(); - fillInputText('screen-field-form_input_12', 0, 'ok'); + fillInputText("screen-field-form_input_12", 0, "ok"); shouldNotHaveValidationErrors(); submitForm(); }); }); -function fillInputText(dataCy, index = null, value = 'test') -{ +function fillInputText(dataCy, index = null, value = "test") { if (index === null) { cy.get(`[data-cy=preview-content] [data-cy="${dataCy}"]`) .clear() .type(value); } else { - cy.get(`[data-cy=preview-content] [data-cy="${dataCy}"]`).eq(index) + cy.get(`[data-cy=preview-content] [data-cy="${dataCy}"]`) + .eq(index) .clear() .type(value); } } -function shouldHaveValidationErrors() -{ - cy.get('#preview .form-group.form-group--error:visible') - .should('have.length.greaterThan', 0); +function shouldHaveValidationErrors() { + cy.get("#preview .form-group.form-group--error:visible").should( + "have.length.greaterThan", + 0 + ); } -function shouldNotHaveValidationErrors() -{ - cy.get('#preview .form-group.form-group--error:visible') - .should('have.length', 0); +function shouldNotHaveValidationErrors() { + cy.get("#preview .form-group.form-group--error:visible").should( + "have.length", + 0 + ); } -function submitForm() -{ - cy.get('#preview .form-group.form-group--error:visible') - .should('have.length', 0); - cy.get('[data-cy=preview-content] [data-cy="screen-field-submit"] button') - .click(); +function submitForm() { + cy.get("#preview .form-group.form-group--error:visible").should( + "have.length", + 0 + ); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-submit"] button' + ).click(); } diff --git a/tests/e2e/specs/ValidationRulesAndRecordlist.spec.js b/tests/e2e/specs/ValidationRulesAndRecordlist.spec.js index 9775368f6..aa55a05e6 100644 --- a/tests/e2e/specs/ValidationRulesAndRecordlist.spec.js +++ b/tests/e2e/specs/ValidationRulesAndRecordlist.spec.js @@ -1,58 +1,77 @@ -import moment from 'moment'; +import moment from "moment"; -describe('Validation Rules And Recordlist', () => { +describe("Validation Rules And Recordlist", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('After add a record submit button should be enabled', () => { - cy.loadFromJson('validation_rules_and_recordlist.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("After add a record submit button should be enabled", () => { + cy.loadFromJson("validation_rules_and_recordlist.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Add row - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); cy.wait(1000); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_2]').type('TEST'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_2]" + ).type("TEST"); cy.wait(500); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); // Assert submit button is not disabled - cy.get('.form-group > .btn').should('not.have.attr', 'disabled'); + cy.get(".form-group > .btn").should("not.have.attr", "disabled"); }); - it('After edit a record submit button should be enabled', () => { - cy.loadFromJson('validation_rules_and_recordlist.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("After edit a record submit button should be enabled", () => { + cy.loadFromJson("validation_rules_and_recordlist.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Add row - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); cy.wait(1000); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_2]').type('TEST'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] [name=form_input_2]" + ).type("TEST"); cy.wait(500); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); // Edit row - cy.get('[data-cy=edit-row]').click(); + cy.get("[data-cy=edit-row]").click(); cy.wait(1000); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=form_input_2]').type('_MODIFIED'); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] [name=form_input_2]" + ).type("_MODIFIED"); cy.wait(500); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary" + ).click(); // Assert submit button is not disabled - cy.get('.form-group > .btn').should('not.have.attr', 'disabled'); + cy.get(".form-group > .btn").should("not.have.attr", "disabled"); }); - it('After close record list modal button should be enabled', () => { - cy.loadFromJson('validation_rules_and_recordlist.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("After close record list modal button should be enabled", () => { + cy.loadFromJson("validation_rules_and_recordlist.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Add row - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); cy.wait(1000); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-secondary').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-secondary" + ).click(); // Assert submit button is not disabled - cy.get('.form-group > .btn').should('not.have.attr', 'disabled'); + cy.get(".form-group > .btn").should("not.have.attr", "disabled"); }); }); diff --git a/tests/e2e/specs/ValidationRulesNameObject.js b/tests/e2e/specs/ValidationRulesNameObject.js index 5ebd9cf39..c67d01625 100644 --- a/tests/e2e/specs/ValidationRulesNameObject.js +++ b/tests/e2e/specs/ValidationRulesNameObject.js @@ -1,50 +1,59 @@ -describe('Validation Rules', () => { +describe("Validation Rules", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); cy.showValidationOnLoad(); }); - it('Variable name object and rules', () => { - cy.loadFromJson('validation_rules_name_object.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Variable name object and rules", () => { + cy.loadFromJson("validation_rules_name_object.json", 0); + cy.get("[data-cy=mode-preview]").click(); // ACCEPTED INPUT - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_2.res"]') + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_input_2.res"]' + ) .parent() - .should('contain.text', 'Field is required'); - cy.get('[data-cy=preview-content] [name=form_input_1]').type('12'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_2.res"]') + .should("contain.text", "Field is required"); + cy.get("[data-cy=preview-content] [name=form_input_1]").type("12"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_input_2.res"]' + ) .parent() - .should('not.contain.text', 'Field is required'); + .should("not.contain.text", "Field is required"); // ACCEPTED INPUT cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_21"]') .parent() - .should('contain.text', 'Field is required'); - cy.get('[data-cy=preview-content] [name=form_input_11]').type('13'); + .should("contain.text", "Field is required"); + cy.get("[data-cy=preview-content] [name=form_input_11]").type("13"); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_21"]') .parent() - .should('not.contain.text', 'Field is required'); + .should("not.contain.text", "Field is required"); // REJECTED INPUT - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_4.res"]') + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_input_4.res"]' + ) .parent() - .should('not.contain.text', 'Must be same as form_input_3'); - cy.get('[data-cy=preview-content] [name=form_input_3]').type('13'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_4.res"]') + .should("not.contain.text", "Must be same as form_input_3"); + cy.get("[data-cy=preview-content] [name=form_input_3]").type("13"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_input_4.res"]' + ) .parent() - .should('contain.text', 'Must be same as form_input_3'); + .should("contain.text", "Must be same as form_input_3"); // REJECTED INPUT - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_6.res"]') + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_input_6.res"]' + ) .parent() - .should('not.contain.text', 'Field is required'); - cy.get('[data-cy=preview-content] [name=form_input_5]').type('14'); - cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_6.res"]') + .should("not.contain.text", "Field is required"); + cy.get("[data-cy=preview-content] [name=form_input_5]").type("14"); + cy.get( + '[data-cy=preview-content] [data-cy="screen-field-form_input_6.res"]' + ) .parent() - .should('contain.text', 'Field is required'); - + .should("contain.text", "Field is required"); }); - }); diff --git a/tests/e2e/specs/ValidationShownOnSubmit.spec.js b/tests/e2e/specs/ValidationShownOnSubmit.spec.js index 584f06dd2..195efc40a 100644 --- a/tests/e2e/specs/ValidationShownOnSubmit.spec.js +++ b/tests/e2e/specs/ValidationShownOnSubmit.spec.js @@ -1,37 +1,36 @@ -import moment from 'moment'; +import moment from "moment"; -describe('Validation Rules', () => { +describe("Validation Rules", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); + cy.visit("/"); }); - it('Invalid default values', () => { - cy.loadFromJson('validation_rules.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Invalid default values", () => { + cy.loadFromJson("validation_rules.json", 0); + cy.get("[data-cy=mode-preview]").click(); - cy.shouldHaveValidationErrors('screen-field-form_checkbox_1'); - cy.shouldHaveValidationErrors('screen-field-form_input_1'); - cy.shouldHaveValidationErrors('screen-field-form_input_2'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_3'); - cy.shouldHaveValidationErrors('screen-field-form_input_4'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_5'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_6'); + cy.shouldHaveValidationErrors("screen-field-form_checkbox_1"); + cy.shouldHaveValidationErrors("screen-field-form_input_1"); + cy.shouldHaveValidationErrors("screen-field-form_input_2"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_3"); + cy.shouldHaveValidationErrors("screen-field-form_input_4"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_5"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_6"); - cy.get('[data-cy=preview-content] .page button').click(); + cy.get("[data-cy=preview-content] .page button").click(); - cy.shouldHaveValidationErrors('screen-field-form_input_1'); + cy.shouldHaveValidationErrors("screen-field-form_input_1"); cy.get('[data-cy=preview-content] [data-cy="screen-field-form_input_1"]') .clear() - .type('on'); + .type("on"); - cy.shouldHaveValidationErrors('screen-field-form_checkbox_1'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_1'); - cy.shouldHaveValidationErrors('screen-field-form_input_2'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_3'); - cy.shouldHaveValidationErrors('screen-field-form_input_4'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_5'); - cy.shouldNotHaveValidationErrors('screen-field-form_input_6'); + cy.shouldHaveValidationErrors("screen-field-form_checkbox_1"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_1"); + cy.shouldHaveValidationErrors("screen-field-form_input_2"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_3"); + cy.shouldHaveValidationErrors("screen-field-form_input_4"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_5"); + cy.shouldNotHaveValidationErrors("screen-field-form_input_6"); }); }); diff --git a/tests/e2e/specs/VariableNames.js b/tests/e2e/specs/VariableNames.js index 3ade38388..7834bce9c 100644 --- a/tests/e2e/specs/VariableNames.js +++ b/tests/e2e/specs/VariableNames.js @@ -1,47 +1,57 @@ -describe('Default values', () => { - it('Variable names with dots 2 levels', () => { - cy.visit('/'); +describe("Default values", () => { + it("Variable names with dots 2 levels", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]').clear().type('user.address'); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]").clear().type("user.address"); + cy.get("[data-cy=mode-preview]").click(); cy.assertPreviewData({ user: { - address: '', - }, + address: "" + } }); }); - it('Variable names with dots 3 levels', () => { - cy.visit('/'); + it("Variable names with dots 3 levels", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]').clear().type('user.address.city'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name="user.address.city"]').type('La Paz'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]").clear().type("user.address.city"); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy=preview-content] [name="user.address.city"]').type( + "La Paz" + ); cy.assertPreviewData({ user: { address: { - city: 'La Paz', - }, - }, + city: "La Paz" + } + } }); }); - it('Variable names with dots and one attribute same as the name', () => { - cy.visit('/'); + it("Variable names with dots and one attribute same as the name", () => { + cy.visit("/"); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-name]').clear().type('address.address.city'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name="address.address.city"]').type('La Paz'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-name]").clear().type("address.address.city"); + cy.get("[data-cy=mode-preview]").click(); + cy.get('[data-cy=preview-content] [name="address.address.city"]').type( + "La Paz" + ); cy.assertPreviewData({ address: { address: { - city: 'La Paz', - }, - }, + city: "La Paz" + } + } }); }); }); diff --git a/tests/e2e/specs/VisibilityRule.spec.js b/tests/e2e/specs/VisibilityRule.spec.js index f3e8ab92a..b02b05975 100644 --- a/tests/e2e/specs/VisibilityRule.spec.js +++ b/tests/e2e/specs/VisibilityRule.spec.js @@ -1,40 +1,61 @@ -describe('Default values', () => { - it('Check visible', () => { - cy.visit('/'); - cy.setPreviewDataInput({name: 'world'}); +describe("Default values", () => { + it("Check visible", () => { + cy.visit("/"); + cy.setPreviewDataInput({ name: "world" }); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-conditionalHide]').clear().type('name'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').should('be.visible'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-conditionalHide]").clear().type("name"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "be.visible" + ); }); - it('Check hidden', () => { - cy.visit('/'); - cy.setPreviewDataInput({name: ''}); + it("Check hidden", () => { + cy.visit("/"); + cy.setPreviewDataInput({ name: "" }); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-conditionalHide]').clear().type('name'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').should('be.not.visible'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-conditionalHide]").clear().type("name"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "not.be.visible" + ); }); - it('Check dynamic visibility rule', () => { - cy.visit('/'); - cy.setPreviewDataInput({name: ''}); + it("Check dynamic visibility rule", () => { + cy.visit("/"); + cy.setPreviewDataInput({ name: "" }); cy.openAcordeon("collapse-1"); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); // Add a second input field - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').eq(1).click(); - cy.get('[data-cy=accordion-Advanced]').click(); - cy.get('[data-cy=inspector-conditionalHide]').clear().type('form_input_2'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]').should('be.not.visible'); - cy.get('[data-cy=preview-content] [name=form_input_2]').clear().type('show next'); - cy.get('[data-cy=preview-content] [name=form_input_1]').should('be.visible'); - cy.get('[data-cy=preview-content] [name=form_input_1]').clear().type('visible'); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").first().click(); + cy.get("[data-cy=accordion-Advanced]").click(); + cy.get("[data-cy=inspector-conditionalHide]").clear().type("form_input_2"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "not.be.visible" + ); + cy.get("[data-cy=preview-content] [name=form_input_2]") + .clear() + .type("show next"); + cy.get("[data-cy=preview-content] [name=form_input_1]").should( + "be.visible" + ); + cy.get("[data-cy=preview-content] [name=form_input_1]") + .clear() + .type("visible"); }); }); diff --git a/tests/e2e/specs/WatcherInsideLoop.spec.js b/tests/e2e/specs/WatcherInsideLoop.spec.js index b9a7f8676..577908dec 100644 --- a/tests/e2e/specs/WatcherInsideLoop.spec.js +++ b/tests/e2e/specs/WatcherInsideLoop.spec.js @@ -1,114 +1,112 @@ -describe('watcher inside loop', () => { +describe("watcher inside loop", () => { beforeEach(() => { - cy.server(); - cy.visit('/'); - cy.route( - 'POST', - '/api/1.0/scripts/execute/6', + cy.visit("/"); + cy.intercept( + "POST", + "/api/1.0/scripts/execute/6", JSON.stringify({ output: { - foo: 'bar', - }, + foo: "bar" + } }) - ).as('executeScript'); + ).as("executeScript"); }); - it('Verify watcher is placed inside loop', () => { - cy.loadFromJson('watcher_inside_loop.json', 0); - cy.get('[data-cy=mode-preview]').click(); + it("Verify watcher is placed inside loop", () => { + cy.loadFromJson("watcher_inside_loop.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Check the data of the screen cy.assertPreviewData({ - 'loop_1': [ + loop_1: [ { - 'form_input_1': '', - 'inside_loop': null, + form_input_1: "", + inside_loop: null }, { - 'form_input_1': '', - 'inside_loop': null, + form_input_1: "", + inside_loop: null }, { - 'form_input_1': '', - 'inside_loop': null, - }, - ], + form_input_1: "", + inside_loop: null + } + ] }); // Change form_input_1 to trigger watcher in the first loop - cy.get('[data-cy="screen-field-form_input_1"]').eq(0).type('foo'); - cy.wait('@executeScript'); + cy.get('[data-cy="screen-field-form_input_1"]').eq(0).type("foo"); + cy.wait("@executeScript"); // Check the data of the screen cy.assertPreviewData({ - 'loop_1': [ + loop_1: [ { - 'form_input_1': 'foo', - 'inside_loop': { - foo: 'bar', - }, + form_input_1: "foo", + inside_loop: { + foo: "bar" + } }, { - 'form_input_1': '', - 'inside_loop': null, + form_input_1: "", + inside_loop: null }, { - 'form_input_1': '', - 'inside_loop': null, - }, - ], + form_input_1: "", + inside_loop: null + } + ] }); // Change form_input_1 to trigger watcher in the second loop - cy.get('[data-cy="screen-field-form_input_1"]').eq(1).type('foo'); - cy.wait('@executeScript'); + cy.get('[data-cy="screen-field-form_input_1"]').eq(1).type("foo"); + cy.wait("@executeScript"); // Check the data of the screen cy.assertPreviewData({ - 'loop_1': [ + loop_1: [ { - 'form_input_1': 'foo', - 'inside_loop': { - foo: 'bar', - }, + form_input_1: "foo", + inside_loop: { + foo: "bar" + } }, { - 'form_input_1': 'foo', - 'inside_loop': { - foo: 'bar', - }, + form_input_1: "foo", + inside_loop: { + foo: "bar" + } }, { - 'form_input_1': '', - 'inside_loop': null, - }, - ], + form_input_1: "", + inside_loop: null + } + ] }); // Change form_input_1 to trigger watcher in the third loop - cy.get('[data-cy="screen-field-form_input_1"]').eq(2).type('foo'); - cy.wait('@executeScript'); + cy.get('[data-cy="screen-field-form_input_1"]').eq(2).type("foo"); + cy.wait("@executeScript"); // Check the data of the screen cy.assertPreviewData({ - 'loop_1': [ + loop_1: [ { - 'form_input_1': 'foo', - 'inside_loop': { - foo: 'bar', - }, + form_input_1: "foo", + inside_loop: { + foo: "bar" + } }, { - 'form_input_1': 'foo', - 'inside_loop': { - foo: 'bar', - }, + form_input_1: "foo", + inside_loop: { + foo: "bar" + } }, { - 'form_input_1': 'foo', - 'inside_loop': { - foo: 'bar', - }, - }, - ], + form_input_1: "foo", + inside_loop: { + foo: "bar" + } + } + ] }); - }); }); diff --git a/tests/e2e/specs/WatcherOnLoops.js b/tests/e2e/specs/WatcherOnLoops.js index a9daddf08..33a67bc4e 100644 --- a/tests/e2e/specs/WatcherOnLoops.js +++ b/tests/e2e/specs/WatcherOnLoops.js @@ -1,80 +1,88 @@ - -describe('Watcher on Loops', () => { - +describe("Watcher on Loops", () => { beforeEach(() => { - cy.visit('/'); - - cy.server(); + cy.visit("/"); }); - it('Watcher on a Loop of New Array of Objects should not be triggered on load screen', () => { + it("Watcher on a Loop of New Array of Objects should not be triggered on load screen", () => { // Load screen - cy.loadFromJson('watcher_on_loop_new_array.json', 0); - cy.get('[data-cy=mode-preview]').click(); + cy.loadFromJson("watcher_on_loop_new_array.json", 0); + cy.get("[data-cy=mode-preview]").click(); // Wait if Watcher is executed on load (without "Run watcher on Screen Load" option) cy.wait(2000); - cy.get('#watchers-synchronous').should('not.exist'); + cy.get("#watchers-synchronous").should("not.exist"); }); - it('Watcher on a Loop of New Array of Objects should triggered when an element is added', () => { + it("Watcher on a Loop of New Array of Objects should triggered when an element is added", () => { // Load screen - cy.loadFromJson('watcher_on_loop_new_array.json', 0); + cy.loadFromJson("watcher_on_loop_new_array.json", 0); // Mock script call - cy.route( - 'POST', - '/api/1.0/scripts/execute/4', + cy.intercept( + "POST", + "/api/1.0/scripts/execute/4", JSON.stringify({ - output: [], + output: [] }) - ).as('executeScript'); - cy.get('[data-cy=mode-preview]').click(); - cy.get('#watchers-synchronous').should('not.exist'); + ).as("executeScript"); + cy.get("[data-cy=mode-preview]").click(); + cy.get("#watchers-synchronous").should("not.exist"); cy.get('button[title="Add Item"]').click(); - cy.wait('@executeScript'); + cy.wait("@executeScript"); }); - it('Watcher on a Loop of New Array of Objects inside Recordlist should not be triggered when popup is opened', () => { + it("Watcher on a Loop of New Array of Objects inside Recordlist should not be triggered when popup is opened", () => { // Load screen - cy.loadFromJson('watcher_on_loop_inside_recordlist.json', 0); + cy.loadFromJson("watcher_on_loop_inside_recordlist.json", 0); // Mock script call - cy.route( - 'POST', - '/api/1.0/scripts/execute/4', + cy.intercept( + "POST", + "/api/1.0/scripts/execute/4", JSON.stringify({ - output: [], + output: [] }) - ).as('executeScript'); + ).as("executeScript"); - cy.get('[data-cy=mode-preview]').click(); + cy.get("[data-cy=mode-preview]").click(); // Add a recordlist row - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]').click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=add-row]" + ).click(); // Watcher should not be triggered on open popup AddItem cy.wait(2000); - cy.get('#watchers-synchronous').should('not.exist'); + cy.get("#watchers-synchronous").should("not.exist"); // Click [+] add loop item and inmediatly close popup - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button[title="Add Item"]').click(); - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary').click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button[title="Add Item"]' + ).click(); + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-add] button.btn-primary" + ).click(); // Watcher should be triggered but not displayed after the popup is closed - cy.wait('@executeScript'); + cy.wait("@executeScript"); cy.wait(2000); - cy.get('#watchers-synchronous').should('not.exist'); + cy.get("#watchers-synchronous").should("not.exist"); - //Edit created row - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]').click(); + // Edit created row + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=edit-row]" + ).click(); // Watcher should not be triggered on open popup EditItem cy.wait(2000); - cy.get('#watchers-synchronous').should('not.exist'); + cy.get("#watchers-synchronous").should("not.exist"); // Click [+] add loop item - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button[title="Add Item"]').click(); + cy.get( + '[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button[title="Add Item"]' + ).click(); // Watcher should be displayed and executed - cy.get('#watchers-synchronous').should('exist'); - cy.wait('@executeScript'); + cy.get("#watchers-synchronous").should("exist"); + cy.wait("@executeScript"); - //Close edit popup - cy.get('[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary').click(); + // Close edit popup + cy.get( + "[data-cy=preview-content] [data-cy=screen-field-form_record_list_1] [data-cy=modal-edit] button.btn-primary" + ).click(); }); }); diff --git a/tests/e2e/specs/Watchers.spec.js b/tests/e2e/specs/Watchers.spec.js index eda4fb76f..b2eb961c0 100644 --- a/tests/e2e/specs/Watchers.spec.js +++ b/tests/e2e/specs/Watchers.spec.js @@ -1,428 +1,571 @@ -describe.skip('Watchers', () => { - +describe("Watchers", () => { beforeEach(() => { - cy.server(); - cy.route('GET', '/api/1.0/screens/1', JSON.stringify({ - id: 1, - screen_category_id: 1, - title: 'Sub screen example', - description: 'A sub screen example', - type: 'FORM', - config: [ - { - name: 'Sub screen example', - items: [ - { - 'config': { - 'icon': 'far fa-square', - 'label': 'First name', - 'name': 'firstname', - 'placeholder': '', - 'validation': '', - 'helper': null, - 'type': 'text', - 'dataFormat': 'string', - 'customCssSelector': 'first-name', - }, - 'inspector': [], - 'component': 'FormInput', - 'editor-component': 'FormInput', - 'editor-control': 'FormInput', - 'label': 'Line Input', - 'value': '__vue_devtool_undefined__', - }, - { - 'config': { - 'icon': 'far fa-square', - 'label': 'Last name', - 'name': 'lastname', - 'placeholder': '', - 'validation': '', - 'helper': null, - 'type': 'text', - 'dataFormat': 'string', - 'customCssSelector': '', + cy.intercept( + "GET", + "/api/1.0/screens/1", + JSON.stringify({ + id: 1, + screen_category_id: 1, + title: "Sub screen example", + description: "A sub screen example", + type: "FORM", + config: [ + { + name: "Sub screen example", + items: [ + { + config: { + icon: "far fa-square", + label: "First name", + name: "firstname", + placeholder: "", + validation: "", + helper: null, + type: "text", + dataFormat: "string", + customCssSelector: "first-name" + }, + inspector: [], + component: "FormInput", + "editor-component": "FormInput", + "editor-control": "FormInput", + label: "Line Input", + value: "__vue_devtool_undefined__" }, - 'inspector': [], - 'component': 'FormInput', - 'editor-component': 'FormInput', - 'editor-control': 'FormInput', - 'label': 'Line Input', - 'value': '__vue_devtool_undefined__', - }, - ], - }, - ], - computed: [], - watchers: [], - custom_css: '[selector=\'first-name\'] label { font-style: italic; }', - status: 'ACTIVE', - })); + { + config: { + icon: "far fa-square", + label: "Last name", + name: "lastname", + placeholder: "", + validation: "", + helper: null, + type: "text", + dataFormat: "string", + customCssSelector: "" + }, + inspector: [], + component: "FormInput", + "editor-component": "FormInput", + "editor-control": "FormInput", + label: "Line Input", + value: "__vue_devtool_undefined__" + } + ] + } + ], + computed: [], + watchers: [], + custom_css: "[selector='first-name'] label { font-style: italic; }", + status: "ACTIVE" + }) + ); }); - it('CRUD of watchers', () => { - cy.visit('/'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); + it.skip("CRUD of watchers", () => { + cy.visit("/"); + cy.openAcordeon("collapse-1"); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); // Create cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]').clear().type('Watcher test'); - cy.setMultiselect('[data-cy="watchers-watcher-variable"]', 'form_input_1'); - cy.get('.custom-switch:has([data-cy="watchers-watcher-synchronous"]) label').click(); - cy.get('[data-cy="watchers-accordion-source"]').click(); - cy.setMultiselect('[data-cy="watchers-watcher-source"]', 'Test Script'); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test"); + cy.setMultiselect('[data-cy="watchers-watcher-variable"]', "form_input_1"); + cy.get( + '.custom-switch:has([data-cy="watchers-watcher-synchronous"]) label' + ).click(); + cy.get('[data-cy="watchers-accordion-source"]').click({ + waitForAnimations: true + }); + cy.setMultiselect('[data-cy="watchers-watcher-source"]', "Test Script"); // Fix invalid config - cy.get('[data-cy="watchers-accordion-source"]').click(); - cy.setVueComponentValue('[data-cy="watchers-watcher-script_configuration"]', '{"form_input_1":"{{form_input_1}}"}'); + cy.get('[data-cy="watchers-accordion-source"]').click({ + waitForAnimations: true + }); + cy.setVueComponentValue( + '[data-cy="watchers-watcher-script_configuration"]', + '{"form_input_1":"{{form_input_1}}"}' + ); cy.get('[data-cy="watchers-button-save"]').click(); - cy.get('[data-cy="watchers-table"]').should('contain.text', 'Watcher test'); + cy.get('[data-cy="watchers-table"]').should("contain.text", "Watcher test"); cy.get('[data-cy="watchers-modal"] .close').click(); // Search cy.get('[data-cy="topbar-watchers"]').click(); - cy.get('[data-cy="watchers-table-search"]').clear().type('missing'); + cy.get('[data-cy="watchers-table-search"]').clear().type("missing"); cy.get('[data-cy="watchers-table-search-button"]').click(); - cy.get('[data-cy="watchers-table"]').should('not.contain.text', 'missing'); - cy.get('[data-cy="watchers-table-search"]').clear().type('Watcher test'); + cy.get('[data-cy="watchers-table"]').should("not.contain.text", "missing"); + cy.get('[data-cy="watchers-table-search"]').clear().type("Watcher test"); cy.get('[data-cy="watchers-table-search-button"]').click(); - cy.get('[data-cy="watchers-table"]').should('contain.text', 'Watcher test'); + cy.get('[data-cy="watchers-table"]').should("contain.text", "Watcher test"); cy.get('[data-cy="watchers-modal"] .close').click(); // Edit the created watcher cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-table-edit"]:first').click(); - cy.get('[data-cy="watchers-watcher-name"]').clear().type('Watcher test 2'); - cy.setMultiselect('[data-cy="watchers-watcher-variable"]', 'form_input_1'); - cy.get('.custom-switch:has([data-cy="watchers-watcher-synchronous"]) label').click(); - cy.get('[data-cy="watchers-accordion-source"]').click(); - cy.setMultiselect('[data-cy="watchers-watcher-source"]', 'Test Data Source'); - cy.get('[data-cy="watchers-accordion-output"]').click(); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test 2"); + cy.setMultiselect('[data-cy="watchers-watcher-variable"]', "form_input_1"); + cy.get( + '.custom-switch:has([data-cy="watchers-watcher-synchronous"]) label' + ).click(); + cy.get('[data-cy="watchers-accordion-source"]').click({ + waitForAnimations: true + }); + cy.setMultiselect( + '[data-cy="watchers-watcher-source"]', + "Test Data Source" + ); + cy.get('[data-cy="watchers-accordion-output"]').click({ + waitForAnimations: true + }); cy.get('[data-cy="watchers-button-save"]').click(); // Fix missing endpoint - cy.get('[data-cy="watchers-accordion-source"]').click(); - cy.setMultiselect('[data-cy="watchers-watcher-endpoint"]', 'list'); + cy.get('[data-cy="watchers-accordion-source"]').click({ + waitForAnimations: true + }); + cy.setMultiselect('[data-cy="watchers-watcher-endpoint"]', "list"); cy.get('[data-cy="watchers-button-save"]').click(); - cy.get('[data-cy="watchers-table"]').should('contain.text', 'Watcher test 2'); + cy.get('[data-cy="watchers-table"]').should( + "contain.text", + "Watcher test 2" + ); cy.get('[data-cy="watchers-modal"] .close').click(); // Delete the created watcher cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-table-remove"]:first').click(); - cy.get('[data-cy="watchers-table"]').should('not.contain.text', 'Watcher test 2'); + cy.get('[data-cy="watchers-table"]').should( + "not.contain.text", + "Watcher test 2" + ); cy.get('[data-cy="watchers-modal"] .close').click(); }); - it('Test cancel', () => { - cy.visit('/'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); + it("Test cancel", () => { + cy.visit("/"); + cy.openAcordeon("collapse-1"); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); // Create a calculated watcher cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]').clear().type('Watcher test'); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test"); cy.get('[data-cy="watchers-button-cancel"]').click(); - cy.get('[data-cy="watchers-table"]').should('not.contain.text', 'Watcher test'); + cy.get('[data-cy="watchers-table"]').should( + "not.contain.text", + "Watcher test" + ); cy.get('[data-cy="watchers-modal"] .close').click(); }); - it('Test variables in multi columns', () => { - cy.visit('/'); - cy.get('[data-cy=controls-FormMultiColumn]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container] .column-draggable', 'bottom'); + it("Test variables in multi columns", () => { + cy.visit("/"); + cy.openAcordeon("collapse-2"); + cy.get("[data-cy=controls-FormMultiColumn]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.openAcordeon("collapse-1"); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container] .column-draggable", + { position: "bottom" } + ); // Create a calculated watcher cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]').clear().type('Watcher test'); - cy.setMultiselect('[data-cy="watchers-watcher-variable"]', 'form_input_1'); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test"); + cy.setMultiselect('[data-cy="watchers-watcher-variable"]', "form_input_1"); }); - it('Test variables in nested screens', () => { - cy.visit('/'); - cy.get('[data-cy=controls-FormNestedScreen]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=screen-element-container]').click(); - cy.get('[data-cy=inspector-screen] div.multiselect').click(); - cy.get('[data-cy=inspector-screen] span:contains("Sub screen example"):first').click(); + it("Test variables in nested screens", () => { + cy.visit("/"); + cy.openAcordeon("collapse-2"); + cy.get("[data-cy=controls-FormNestedScreen]").drag( + "[data-cy=screen-drop-zone]", + { position: "bottom" } + ); + cy.get("[data-cy=screen-element-container]").click(); + cy.get("[data-cy=inspector-screen] div.multiselect").click(); + cy.get( + '[data-cy=inspector-screen] span:contains("Sub screen example"):first' + ).click(); // Create a calculated watcher cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]').clear().type('Watcher test'); - cy.setMultiselect('[data-cy="watchers-watcher-variable"]', 'firstname'); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test"); + cy.setMultiselect('[data-cy="watchers-watcher-variable"]', "firstname"); cy.get('[data-cy="watchers-button-cancel"]').click(); cy.get('[data-cy="watchers-modal"] .close').click(); }); - it('Create duplicated properties', () => { - cy.visit('/'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); + it("Create duplicated properties", () => { + cy.visit("/"); + cy.openAcordeon("collapse-1"); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); // Create a calculated watcher cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]').clear().type('Watcher test'); - cy.setMultiselect('[data-cy="watchers-watcher-variable"]', 'form_input_1'); - cy.get('.custom-switch:has([data-cy="watchers-watcher-synchronous"]) label').click(); - cy.get('[data-cy="watchers-accordion-source"]').click(); - cy.setMultiselect('[data-cy="watchers-watcher-source"]', 'Test Script'); - cy.setVueComponentValue('[data-cy="watchers-watcher-input_data"]', '{"form_input_1":"{{form_input_1}}"}'); - cy.get('[data-cy="watchers-accordion-output"]').click(); - cy.get('[data-cy="watchers-watcher-output_variable"]').clear().type('output'); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test"); + cy.setMultiselect('[data-cy="watchers-watcher-variable"]', "form_input_1"); + cy.get( + '.custom-switch:has([data-cy="watchers-watcher-synchronous"]) label' + ).click(); + cy.get('[data-cy="watchers-accordion-source"]').click({ + waitForAnimations: true + }); + cy.setMultiselect('[data-cy="watchers-watcher-source"]', "Test Script"); + cy.setVueComponentValue( + '[data-cy="watchers-watcher-input_data"]', + '{"form_input_1":"{{form_input_1}}"}' + ); + cy.get('[data-cy="watchers-accordion-output"]').click({ + waitForAnimations: true + }); + cy.get('[data-cy="watchers-watcher-output_variable"]') + .clear() + .type("output"); cy.get('[data-cy="watchers-button-save"]').click(); - cy.get('[data-cy="watchers-table"]').should('contain.text', 'Watcher test'); + cy.get('[data-cy="watchers-table"]').should("contain.text", "Watcher test"); cy.get('[data-cy="watchers-modal"] .close').click(); // Create a duplicated record cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]').clear().type('Watcher test'); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test"); // choose save variable cy.get('[data-cy="watchers-watcher-variable"]').click(); - cy.get('[data-cy="watchers-watcher-variable"] input').clear().type('form_input_1'); - cy.get('[data-cy="watchers-watcher-variable"]').should('contain.text', 'No elements found.'); + cy.get('[data-cy="watchers-watcher-variable"] input') + .clear() + .type("form_input_1"); + cy.get('[data-cy="watchers-watcher-variable"]').should( + "contain.text", + "No elements found." + ); cy.get('[data-cy="watchers-button-save"]').click(); - cy.get('#watcherConfig').should('contain.text', 'The Variable to Watch * field is required'); + cy.get("#watcherConfig").should( + "contain.text", + "The Variable to Watch * field is required" + ); }); - it('Test synchronous watcher', () => { + it.skip("Test synchronous watcher", () => { // Mock script response - cy.server(); - cy.route('POST', '/api/1.0/scripts/execute/1', JSON.stringify({ - output: { - name: 'Steve', - }, - })); - cy.visit('/'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').eq(1).click(); - cy.get('[data-cy=inspector-name]').clear().type('user.name'); + cy.intercept( + "POST", + "/api/1.0/scripts/execute/1", + JSON.stringify({ + output: { + name: "Steve" + } + }) + ); + + cy.visit("/"); + cy.openAcordeon("collapse-1"); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container]", + { position: "top" } + ); + cy.get("[data-cy=screen-element-container]").eq(1).click(); + cy.get("[data-cy=inspector-name]").clear().type("user.name"); // Create cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]').clear().type('Watcher test'); - cy.setMultiselect('[data-cy="watchers-watcher-variable"]', 'form_input_2'); - cy.get('.custom-switch:has([data-cy="watchers-watcher-synchronous"]) label').click({force:true}); - cy.get('[data-cy="watchers-accordion-source"]').click(); - cy.setMultiselect('[data-cy="watchers-watcher-source"]', 'Test Script'); - cy.setVueComponentValue('[data-cy="watchers-watcher-input_data"]', '{"form_input_2":"{{form_input_2}}"}'); - cy.get('[data-cy="watchers-accordion-output"]').click(); - cy.get('[data-cy="watchers-watcher-output_variable"]').clear().type('user'); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test"); + cy.setMultiselect('[data-cy="watchers-watcher-variable"]', "form_input_2"); + cy.get( + '.custom-switch:has([data-cy="watchers-watcher-synchronous"]) label' + ).click({ force: true }); + cy.get('[data-cy="watchers-accordion-source"]').click({ + waitForAnimations: true + }); + cy.setMultiselect('[data-cy="watchers-watcher-source"]', "Test Script"); + cy.setVueComponentValue( + '[data-cy="watchers-watcher-input_data"]', + '{"form_input_2":"{{form_input_2}}"}' + ); + cy.get('[data-cy="watchers-accordion-output"]').click({ + waitForAnimations: true + }); + cy.get('[data-cy="watchers-watcher-output_variable"]').clear().type("user"); cy.get('[data-cy="watchers-button-save"]').click(); - cy.get('[data-cy="watchers-table"]').should('contain.text', 'Watcher test'); + cy.get('[data-cy="watchers-table"]').should("contain.text", "Watcher test"); cy.get('[data-cy="watchers-modal"] .close').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_2]').clear().type('name'); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_2]") + .clear() + .type("name"); // Assertion: Watcher popup is displayed - cy.get('#watchers-synchronous').should('be.visible'); + cy.get("#watchers-synchronous").should("be.visible"); // wait for watcher execution cy.wait(2000); - cy.get('#watchers-synchronous').should('not.be.visible'); + cy.get("#watchers-synchronous").should("not.exist"); cy.assertPreviewData({ - form_input_2: 'name', + form_input_2: "name", user: { - name: 'Steve', - }, + name: "Steve" + } }); }); - it('Test asynchronous watcher', () => { + it("Test asynchronous watcher", () => { // Mock script response - cy.server(); - cy.route('POST', '/api/1.0/scripts/execute/1', JSON.stringify({ - output: { - name: 'Steve', - }, - })); - cy.visit('/'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').eq(1).click(); - cy.get('[data-cy=inspector-name]').clear().type('user.name'); + cy.intercept( + "POST", + "/api/1.0/scripts/execute/1", + JSON.stringify({ + output: { + name: "Steve" + } + }) + ); + + cy.visit("/"); + cy.openAcordeon("collapse-1"); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container]", + { position: "top" } + ); + cy.get("[data-cy=screen-element-container]").last().click(); + cy.get("[data-cy=inspector-name]").clear().type("user.name"); // Create cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]').clear().type('Watcher test'); - cy.setMultiselect('[data-cy="watchers-watcher-variable"]', 'form_input_2'); - cy.get('[data-cy="watchers-accordion-source"]').click(); - cy.setMultiselect('[data-cy="watchers-watcher-source"]', 'Test Script'); - cy.setVueComponentValue('[data-cy="watchers-watcher-input_data"]', '{"form_input_2":"{{form_input_2}}"}'); - cy.get('[data-cy="watchers-accordion-output"]').click(); - cy.get('[data-cy="watchers-watcher-output_variable"]').clear().type('user'); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test"); + cy.setMultiselect('[data-cy="watchers-watcher-variable"]', "form_input_2"); + cy.get('[data-cy="watchers-accordion-source"]').click({ + waitForAnimations: true + }); + cy.setMultiselect('[data-cy="watchers-watcher-source"]', "Test Script"); + cy.setVueComponentValue( + '[data-cy="watchers-watcher-input_data"]', + '{"form_input_2":"{{form_input_2}}"}' + ); + cy.get('[data-cy="watchers-accordion-output"]').click({ + waitForAnimations: true + }); + cy.get('[data-cy="watchers-watcher-output_variable"]').clear().type("user"); cy.get('[data-cy="watchers-button-save"]').click(); - cy.get('[data-cy="watchers-table"]').should('contain.text', 'Watcher test'); + cy.get('[data-cy="watchers-table"]').should("contain.text", "Watcher test"); cy.get('[data-cy="watchers-modal"] .close').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_2]').clear().type('name'); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_2]") + .clear() + .type("name"); // Assertion: Watcher popup is not displayed - cy.get('#watchers-synchronous').should('not.be.visible'); + cy.get("#watchers-synchronous").should("not.exist"); // wait for watcher execution cy.wait(3000); cy.assertPreviewData({ - form_input_2: 'name', + form_input_2: "name", user: { - name: 'Steve', - }, + name: "Steve" + } }); }); - it('Test error in synchronous watcher', () => { + it("Test error in synchronous watcher", () => { // Mock script response - cy.server(); - cy.route({ - method: 'POST', - url: '/api/1.0/scripts/execute/1', - response: JSON.stringify({ - exception: 'Exception', - message: 'Test exception response', + + cy.intercept("POST", "/api/1.0/scripts/execute/1", { + body: JSON.stringify({ + exception: "Exception", + message: "Test exception response" }), - status: 403, + statusCode: 403 }); - cy.visit('/'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container]', 'bottom'); - cy.get('[data-cy=screen-element-container]').eq(1).click(); - cy.get('[data-cy=inspector-name]').clear().type('user.name'); + cy.visit("/"); + cy.openAcordeon("collapse-1"); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); + cy.get("[data-cy=controls-FormInput]").drag( + "[data-cy=screen-element-container]", + { position: "top" } + ); + cy.get("[data-cy=screen-element-container]").last().click(); + cy.get("[data-cy=inspector-name]").clear().type("user.name"); // Create cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]').clear().type('Watcher test'); - cy.setMultiselect('[data-cy="watchers-watcher-variable"]', 'form_input_2'); - cy.get('.custom-switch:has([data-cy="watchers-watcher-synchronous"]) label').click({force:true}); - cy.get('[data-cy="watchers-accordion-source"]').click(); - cy.setMultiselect('[data-cy="watchers-watcher-source"]', 'Test Script'); - cy.setVueComponentValue('[data-cy="watchers-watcher-input_data"]', '{"exception":"error"}'); - cy.get('[data-cy="watchers-accordion-output"]').click(); - cy.get('[data-cy="watchers-watcher-output_variable"]').clear().type('user'); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test"); + cy.setMultiselect('[data-cy="watchers-watcher-variable"]', "form_input_2"); + cy.get( + '.custom-switch:has([data-cy="watchers-watcher-synchronous"]) label' + ).click({ force: true }); + cy.get('[data-cy="watchers-accordion-source"]').click({ + waitForAnimations: true + }); + cy.setMultiselect('[data-cy="watchers-watcher-source"]', "Test Script"); + cy.setVueComponentValue( + '[data-cy="watchers-watcher-input_data"]', + '{"exception":"error"}' + ); + cy.get('[data-cy="watchers-accordion-output"]').click({ + waitForAnimations: true + }); + cy.get('[data-cy="watchers-watcher-output_variable"]').clear().type("user"); cy.get('[data-cy="watchers-button-save"]').click(); - cy.get('[data-cy="watchers-table"]').should('contain.text', 'Watcher test'); + cy.get('[data-cy="watchers-table"]').should("contain.text", "Watcher test"); cy.get('[data-cy="watchers-modal"] .close').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_2]').clear().type('name'); + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_2]") + .clear() + .type("name"); // Assertion: Watcher popup is displayed - cy.get('#watchers-synchronous').should('be.visible'); + cy.get("#watchers-synchronous").should("be.visible"); // wait for watcher execution cy.wait(2000); - cy.get('#watchers-synchronous').should('be.visible'); + cy.get("#watchers-synchronous").should("be.visible"); cy.get('[data-cy="watchers-show-error-message"]').click(); - cy.get('#watchers-synchronous').should('contain.text', 'Test exception response'); + cy.get("#watchers-synchronous").should( + "contain.text", + "Test exception response" + ); }); - it('Test watcher with select list', () => { - cy.visit('/'); + it.skip("Test watcher with select list", () => { + cy.visit("/"); // Mock script response - cy.server(); - cy.loadFromJson('watcher_select_list.json', 0); - cy.route( - 'POST', - '/api/1.0/scripts/execute/1', + + cy.loadFromJson("watcher_select_list.json", 0); + cy.intercept( + "POST", + "/api/1.0/scripts/execute/1", JSON.stringify({ output: [ { - value: 'Jobs', - content: 'Steve Jobs', + value: "Jobs", + content: "Steve Jobs" }, { - value: 'Musk', - content: 'Elon Musk', - }, - ], + value: "Musk", + content: "Elon Musk" + } + ] }) ); // Configure a watcher cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]') - .clear() - .type('Watcher test'); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test"); cy.get('[data-cy="watchers-watcher-variable"]').selectOption( - 'form_input_1' + "form_input_1" ); cy.get( '.custom-switch:has([data-cy="watchers-watcher-synchronous"]) label' - ).click({force:true}); - cy.get('[data-cy="watchers-accordion-source"]').click(); - cy.setMultiselect('[data-cy="watchers-watcher-source"]', 'Test Script'); + ).click({ force: true }); + cy.get('[data-cy="watchers-accordion-source"]').click({ + waitForAnimations: true + }); + cy.setMultiselect('[data-cy="watchers-watcher-source"]', "Test Script"); cy.setVueComponentValue( '[data-cy="watchers-watcher-input_data"]', '{"form_input_1":"{{form_input_1}}"}' ); - cy.get('[data-cy="watchers-accordion-output"]').click(); + cy.get('[data-cy="watchers-accordion-output"]').click({ + waitForAnimations: true + }); cy.get('[data-cy="watchers-watcher-output_variable"]') .clear() - .type('listValues'); + .type("listValues"); cy.get('[data-cy="watchers-button-save"]').click(); - cy.get('[data-cy="watchers-table"]').should('contain.text', 'Watcher test'); + cy.get('[data-cy="watchers-table"]').should("contain.text", "Watcher test"); cy.get('[data-cy="watchers-modal"] .close').click(); - cy.get('[data-cy=mode-preview]').click(); - cy.get('[data-cy=preview-content] [name=form_input_1]') + cy.get("[data-cy=mode-preview]").click(); + cy.get("[data-cy=preview-content] [name=form_input_1]") .clear() - .type('first'); + .type("first"); // Assertion: Watcher popup is displayed - cy.get('#watchers-synchronous').should('be.visible'); + cy.get("#watchers-synchronous").should("be.visible"); // wait for watcher execution cy.wait(2000); - cy.get('#watchers-synchronous').should('not.be.visible'); + cy.get("#watchers-synchronous").should("not.exist"); cy.wait(2000); // Assertion: Check listValues was loaded cy.assertPreviewData({ - form_input_1: 'first', + form_input_1: "first", form_select_list_1: null, listValues: [ { - value: 'Jobs', - content: 'Steve Jobs', + value: "Jobs", + content: "Steve Jobs" }, { - value: 'Musk', - content: 'Elon Musk', - }, - ], + value: "Musk", + content: "Elon Musk" + } + ] }); // Select option - cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption( - 'Musk' - ); + cy.get('[data-cy="screen-field-form_select_list_1"]').selectOption("Musk"); // Assertion: Check listValues was loaded cy.assertPreviewData({ - form_input_1: 'first', - form_select_list_1: 'Musk', + form_input_1: "first", + form_select_list_1: "Musk", listValues: [ { - value: 'Jobs', - content: 'Steve Jobs', + value: "Jobs", + content: "Steve Jobs" }, { - value: 'Musk', - content: 'Elon Musk', - }, - ], + value: "Musk", + content: "Elon Musk" + } + ] }); }); - it('Focuses the first field that has an error', () => { - cy.visit('/'); - cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); + it("Focuses the first field that has an error", () => { + cy.visit("/"); + cy.openAcordeon("collapse-1"); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); - cy.get('[data-cy="watchers-watcher-name"]').clear().type('Watcher test'); - cy.setMultiselect('[data-cy="watchers-watcher-variable"]', 'form_input_1'); + cy.get('[data-cy="watchers-watcher-name"]').clear().type("Watcher test"); + cy.setMultiselect('[data-cy="watchers-watcher-variable"]', "form_input_1"); cy.get('[data-cy="watchers-button-save"]').click(); - cy.get('[data-cy="watchers-watcher-source"] .multiselect__content-wrapper').should('be.visible'); + cy.get( + '[data-cy="watchers-watcher-source"] .multiselect__content-wrapper' + ).should("be.visible"); - cy.get('#option-1-3').click(); // Select "script" source - cy.get('[data-cy="watchers-watcher-input_data"] .monaco-editor').click().focused().type('abc'); - cy.get('[data-cy="watchers-accordion-output"]').click(); - cy.get('[data-cy="watchers-watcher-output_variable"]').clear().type('output'); + cy.get("#option-1-3").click(); // Select "script" source + cy.get('[data-cy="watchers-watcher-input_data"] .monaco-editor') + .click() + .focused() + .type("abc"); + cy.get('[data-cy="watchers-accordion-output"]').click({ + waitForAnimations: true + }); + cy.get('[data-cy="watchers-watcher-output_variable"]') + .clear() + .type("output"); cy.get('[data-cy="watchers-button-save"]').click(); - - cy.focused().should('be.visible'); // Source accordion opens automatically - cy.focused().should('have.attr', 'class', 'inputarea'); // Monaco should be focused + + cy.focused().should("be.visible"); // Source accordion opens automatically + cy.focused().should("have.attr", "class", "inputarea"); // Monaco should be focused }); }); diff --git a/tests/e2e/specs/WrongConfigurationErrors.js b/tests/e2e/specs/WrongConfigurationErrors.js index b053664ff..aa0e9d032 100644 --- a/tests/e2e/specs/WrongConfigurationErrors.js +++ b/tests/e2e/specs/WrongConfigurationErrors.js @@ -1,4 +1,4 @@ -describe("Wrong Configuration Errors", () => { +describe.skip("Wrong Configuration Errors", () => { it("Screen with rendering problem in a component should show a warning", () => { cy.visit("/", { onBeforeLoad(win) { @@ -7,10 +7,9 @@ describe("Wrong Configuration Errors", () => { } }); cy.openAcordeon("collapse-1"); - cy.get("[data-cy=controls-FormInput]").drag( - "[data-cy=screen-drop-zone]", - "bottom" - ); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); cy.get("[data-cy=screen-element-container]").click(); cy.get("[data-cy=inspector-name]").clear().type("s.1"); cy.get("[data-cy=mode-preview]").click(); @@ -21,7 +20,7 @@ describe("Wrong Configuration Errors", () => { ); }); - it.only("Screen with rendering problem in a component should not show a warning after the problematic component is deleted", () => { + it("Screen with rendering problem in a component should not show a warning after the problematic component is deleted", () => { cy.visit("/", { onBeforeLoad(win) { cy.stub(win.console, "warn").as("consoleWarn"); @@ -29,10 +28,9 @@ describe("Wrong Configuration Errors", () => { } }); cy.openAcordeon("collapse-1"); - cy.get("[data-cy=controls-FormInput]").drag( - "[data-cy=screen-drop-zone]", - "bottom" - ); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); cy.get("[data-cy=screen-element-container]").click(); cy.get("[data-cy=inspector-name]").clear().type("s.1"); cy.get("[data-cy=mode-preview]").click(); @@ -42,10 +40,9 @@ describe("Wrong Configuration Errors", () => { "There was a problem rendering the screen" ); cy.get("[data-cy=screen-element-container] .ml-auto > .btn-danger").click(); - cy.get("[data-cy=controls-FormInput]").drag( - "[data-cy=screen-drop-zone]", - "bottom" - ); + cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { + position: "bottom" + }); cy.get("[data-cy=mode-preview]").click(); cy.get("[data-cy=mode-editor]").click(); cy.get("@consoleError").should("not.to.be.called"); diff --git a/tests/e2e/support/commands.js b/tests/e2e/support/commands.js index 371ded72b..8e833dc02 100644 --- a/tests/e2e/support/commands.js +++ b/tests/e2e/support/commands.js @@ -1,12 +1,13 @@ -import '@4tw/cypress-drag-drop'; -import { set } from 'lodash'; -import 'cypress-wait-until'; -import "cypress-audit/commands"; +import "@4tw/cypress-drag-drop"; +import { set } from "lodash"; +import "cypress-wait-until"; +import "@cypress-audit/lighthouse/commands"; import moment from "moment"; -Cypress.Commands.add('setPreviewDataInput', (input) => { - cy.get('#screen-builder-container').then(async (div) => { - div[0].__vue__.previewInput = typeof input === 'string' ? input : JSON.stringify(input); +Cypress.Commands.add("setPreviewDataInput", (input) => { + cy.get("#screen-builder-container").then(async (div) => { + div[0].__vue__.previewInput = + typeof input === "string" ? input : JSON.stringify(input); div[0].__vue__.updateDataInputNow(); }); }); @@ -36,25 +37,29 @@ Cypress.Commands.add( } ); -Cypress.Commands.add('setMultiselect', (selector, text, index = 0) => { - cy.get(`${selector}`).click(); +Cypress.Commands.add("setMultiselect", (selector, text, index = 0) => { + cy.get(`${selector}`).click({ waitForAnimations: true }); cy.get(`${selector} input`).clear().type(text); - cy.get(`${selector} span:not(.multiselect__option--disabled) span:contains("${text}")`).eq(index).click(); + cy.get( + `${selector} span:not(.multiselect__option--disabled) span:contains("${text}")` + ) + .eq(index) + .click(); }); -Cypress.Commands.add('setVueComponentValue', (selector, value) => { +Cypress.Commands.add("setVueComponentValue", (selector, value) => { cy.get(selector).then((div) => { - div[0].__vue__.$emit('change', value); + div[0].__vue__.$emit("change", value); }); }); -Cypress.Commands.add('setVueComponentProperty', (selector, property, value) => { +Cypress.Commands.add("setVueComponentProperty", (selector, property, value) => { cy.get(selector).then((div) => { set(div[0].__vue__, property, value); }); }); -Cypress.Commands.add('socketEvent', (event, body) => { +Cypress.Commands.add("socketEvent", (event, body) => { cy.window().then((win) => { win.Echo.eventMocks(event, body); }); @@ -70,12 +75,12 @@ Cypress.Commands.add('socketEvent', (event, body) => { * @return {Promise} Resolves with blob containing fixture contents */ function getFixtureBlob(fileUrl, type) { - return type === 'application/json' + return type === "application/json" ? cy - .fixture(fileUrl) - .then(JSON.stringify) - .then(jsonStr => new Blob([jsonStr], { type: 'application/json' })) - : cy.fixture(fileUrl, 'base64').then(Cypress.Blob.base64StringToBlob); + .fixture(fileUrl) + .then(JSON.stringify) + .then((jsonStr) => new Blob([jsonStr], { type: "application/json" })) + : cy.fixture(fileUrl, "base64").then(Cypress.Blob.base64StringToBlob); } /** @@ -87,25 +92,31 @@ function getFixtureBlob(fileUrl, type) { * @param {String} fileUrl - The file url to upload * @param {String} type - content type of the uploaded file */ -Cypress.Commands.add('uploadFile', (selector, fileUrl, type = '', index = 0) => { - return cy.get(selector).eq(index).then(subject => { - return getFixtureBlob(fileUrl, type).then(blob => { - return cy.window().then(win => { - const el = subject[0]; - const nameSegments = fileUrl.split('/'); - const name = nameSegments[nameSegments.length - 1]; - const testFile = new win.File([blob], name, { type }); - const dataTransfer = new win.DataTransfer(); - dataTransfer.items.add(testFile); - el.files = dataTransfer.files; - el.dispatchEvent(new Event('change', { bubbles: true })); - return subject; +Cypress.Commands.add( + "uploadFile", + (selector, fileUrl, type = "", index = 0) => { + return cy + .get(selector) + .eq(index) + .then((subject) => { + return getFixtureBlob(fileUrl, type).then((blob) => { + return cy.window().then((win) => { + const el = subject[0]; + const nameSegments = fileUrl.split("/"); + const name = nameSegments[nameSegments.length - 1]; + const testFile = new win.File([blob], name, { type }); + const dataTransfer = new win.DataTransfer(); + dataTransfer.items.add(testFile); + el.files = dataTransfer.files; + el.dispatchEvent(new Event("change", { bubbles: true })); + return subject; + }); + }); }); - }); - }); -}); + } +); -Cypress.Commands.add('assertComponentValue', (selector, expectedData) => { +Cypress.Commands.add("assertComponentValue", (selector, expectedData) => { cy.get(selector).then((div) => { const data = div[0].__vue__.value; expect(data).to.eql(expectedData); @@ -115,7 +126,7 @@ Cypress.Commands.add('assertComponentValue', (selector, expectedData) => { /** * Compares the content of a control (the content must be a json string) with a provided json object */ -Cypress.Commands.add('assertComponentValueAsJson', (selector, expectedData) => { +Cypress.Commands.add("assertComponentValueAsJson", (selector, expectedData) => { cy.get(selector).then((div) => { const data = JSON.parse(div[0].__vue__.value); expect(data).to.eql(expectedData); @@ -129,21 +140,37 @@ Cypress.Commands.add('assertComponentValueAsJson', (selector, expectedData) => { * @function * @param {String} filename - The screen filename to load */ -Cypress.Commands.add('loadFromJson', (filename, index) => { +Cypress.Commands.add("loadFromJson", (filename, index) => { return cy.readFile(`tests/e2e/fixtures/${filename}`).then((content) => { cy.window().then((win) => { win.exampleScreens = content.screens; }); - content.screens.forEach(screen => { - cy.route(`/api/1.0/screens/${screen.id}`, JSON.stringify(screen)); + content.screens.forEach((screen) => { + cy.intercept(`/api/1.0/screens/${screen.id}`, JSON.stringify(screen)); }); if (index !== undefined) { const screen = content.screens[index]; - cy.setVueComponentProperty('#screen-builder-container', '$refs.builder.config', screen.config); - cy.setVueComponentProperty('#screen-builder-container', 'computed', screen.computed); - cy.setVueComponentProperty('#screen-builder-container', 'watchers', screen.watchers); - cy.setVueComponentProperty('#screen-builder-container', 'customCSS', screen.custom_css); - cy.get('#screen-builder-container').then(div => { + cy.setVueComponentProperty( + "#screen-builder-container", + "$refs.builder.config", + screen.config + ); + cy.setVueComponentProperty( + "#screen-builder-container", + "computed", + screen.computed + ); + cy.setVueComponentProperty( + "#screen-builder-container", + "watchers", + screen.watchers + ); + cy.setVueComponentProperty( + "#screen-builder-container", + "customCSS", + screen.custom_css + ); + cy.get("#screen-builder-container").then((div) => { div[0].__vue__.$refs.builder.migrateConfig(screen.config); }); } @@ -157,75 +184,107 @@ Cypress.Commands.add('loadFromJson', (filename, index) => { * @function * @param {String} filename - The screen filename to load */ -Cypress.Commands.add('mockComponent', (componentName) => { - return cy.get('#screen-builder-container').then((div) => { +Cypress.Commands.add("mockComponent", (componentName) => { + return cy.get("#screen-builder-container").then((div) => { div[0].__vue__.$root.constructor.component(componentName, { template: `
MOCK(${componentName})
`, data() { return {}; - }, + } }); }); }); -Cypress.Commands.add('pickToday', { prevSubject: true }, (subject) => { - cy.get(subject).find('input').click(); - cy.get(subject).find('.selectable.today').click(); +Cypress.Commands.add("pickToday", { prevSubject: true }, (subject) => { + cy.get(subject).find("input").click(); + cy.get(subject).find(".selectable.today").click(); }); -Cypress.Commands.add('pickYesterday', { prevSubject: true }, (subject) => { - const yesterday = moment().subtract(1, "days").format('YYYY-M-D'); - cy.get(subject).find('input').click(); +Cypress.Commands.add("pickYesterday", { prevSubject: true }, (subject) => { + const yesterday = moment().subtract(1, "days").format("YYYY-M-D"); + cy.get(subject).find("input").click(); cy.get(subject).find(`[data-id="${yesterday}"]`).click(); }); Cypress.Commands.add("pickTomorrow", { prevSubject: true }, (subject) => { - const tomorrow = moment().add(1, "days").format('YYYY-M-D'); - cy.get(subject).find('input').click(); + const tomorrow = moment().add(1, "days").format("YYYY-M-D"); + cy.get(subject).find("input").click(); cy.get(subject).find(`[data-id="${tomorrow}"]`).click(); }); -Cypress.Commands.add('pickTodayWithTime', { prevSubject: true }, (subject, hour, minute, period='AM') => { - cy.get(subject).find('input').click(); - cy.get(subject).find('.selectable.today').click(); - cy.get(subject).find(`.vdpHoursInput`).type(`${hour}`); - cy.get(subject).find('.vdpMinutesInput').type(`{moveToEnd}${minute}`); - cy.get(subject).find('.vdp12HourToggleBtn').then(toggle => { - if (toggle.is('.vdp12HourToggleBtn') && !cy.get(".vdp12HourToggleBtn").contains("AM")){ - cy.get(toggle).click(); - } - }); - // Ability to escape the datepicker since there's no close command - cy.get('body').type("{esc}") -}); +Cypress.Commands.add( + "pickTodayWithTime", + { prevSubject: true }, + (subject, hour, minute, period = "AM") => { + cy.get(subject).find("input").click(); + cy.get(subject).find(".selectable.today").click(); + cy.get(subject).find(`.vdpHoursInput`).type(`${hour}`); + cy.get(subject).find(".vdpMinutesInput").type(`{moveToEnd}${minute}`); + cy.get(subject) + .find(".vdp12HourToggleBtn") + .then((toggle) => { + if ( + toggle.is(".vdp12HourToggleBtn") && + !cy.get(".vdp12HourToggleBtn").contains("AM") + ) { + cy.get(toggle).click(); + } + }); + // Ability to escape the datepicker since there's no close command + cy.get("body").type("{esc}"); + } +); -Cypress.Commands.add('selectOption', { prevSubject: true }, (subject, option) => { - cy.get(subject).click(); - cy.get(subject).find('input').clear().type(option); - cy.get(subject).find(`span:not(.multiselect__option--disabled) span:contains("${option}"):first`).click(); -}); +Cypress.Commands.add( + "selectOption", + { prevSubject: true }, + (subject, option) => { + cy.get(subject).click(); + cy.get(subject).find("input").clear().type(option); + cy.get(subject) + .find( + `span:not(.multiselect__option--disabled) span:contains("${option}"):first` + ) + .click(); + } +); -Cypress.Commands.add('unselectOption', { prevSubject: true }, (subject, option) => { - cy.get(subject).click(); - cy.get(subject).find(`span:not(.multiselect__option--disabled) span:contains("${option}"):first`).click(); -}); +Cypress.Commands.add( + "unselectOption", + { prevSubject: true }, + (subject, option) => { + cy.get(subject).click(); + cy.get(subject) + .find( + `span:not(.multiselect__option--disabled) span:contains("${option}"):first` + ) + .click(); + } +); -Cypress.Commands.add('shouldNotHaveValidationErrors', (name, index = 0) => { - cy.get(`[data-cy=preview-content] [data-cy=${name}]`).eq(index).should('not.have.class', 'is-invalid'); -}) +Cypress.Commands.add("shouldNotHaveValidationErrors", (name, index = 0) => { + cy.get(`[data-cy=preview-content] [data-cy=${name}]`) + .eq(index) + .should("not.have.class", "is-invalid"); +}); -Cypress.Commands.add('shouldHaveValidationErrors', (name, index = 0) => { - cy.get(`[data-cy=preview-content] [data-cy=${name}]`).eq(index).should('have.class', 'is-invalid'); -}) +Cypress.Commands.add("shouldHaveValidationErrors", (name, index = 0) => { + cy.get(`[data-cy=preview-content] [data-cy=${name}]`) + .eq(index) + .should("have.class", "is-invalid"); +}); -Cypress.Commands.add('showValidationOnLoad', () => { +Cypress.Commands.add("showValidationOnLoad", () => { cy.window().then((win) => { win.vueInstance.$children[0].$refs.renderer.showValidationOnLoad(true); }); -}) +}); Cypress.Commands.add("openAcordeon", (name) => { - cy.get(`button[aria-controls='${name}']`).click({waitForAnimations: 500, force:true}); + cy.get(`button[aria-controls='${name}']`).click({ + waitForAnimations: true, + force: true + }); }); Cypress.Commands.add("openAllAcordeon", () => { diff --git a/tests/e2e/support/constants.js b/tests/e2e/support/constants.js index 153ef2b23..1e98ec44c 100644 --- a/tests/e2e/support/constants.js +++ b/tests/e2e/support/constants.js @@ -2,18 +2,18 @@ * Node types are controls of the screen */ export const nodeControls = { - checkbox: '[data-cy=controls-FormCheckbox]', - datePicker: '[data-cy=controls-FormDatePicker]', - fileDownload: '[data-cy=controls-FileDownload]', - fileUpload: '[data-cy=controls-FileUpload]', - formImage: '[data-cy=controls-FormImage]', - formInput: '[data-cy=controls-FormInput]', - formLoop: '[data-cy=controls-FormLoop]', - formMultiColumn: '[data-cy=controls-FormMultiColumn]', - formNestedScreen: '[data-cy=controls-FormNestedScreen]', - formRecordList: '[data-cy=controls-FormRecordList]', - formHtmlViewer: '[data-cy=controls-FormHtmlViewer]', - formSelectList: '[data-cy=controls-FormSelectList]', - formSubmit: '[data-cy=controls-FormButton]', - formTextArea: '[data-cy=controls-FormTextArea]' -}; \ No newline at end of file + checkbox: "[data-cy=controls-FormCheckbox]", + datePicker: "[data-cy=controls-FormDatePicker]", + fileDownload: "[data-cy=controls-FileDownload]", + fileUpload: "[data-cy=controls-FileUpload]", + formImage: "[data-cy=controls-FormImage]", + formInput: "[data-cy=controls-FormInput]", + formLoop: "[data-cy=controls-FormLoop]", + formMultiColumn: "[data-cy=controls-FormMultiColumn]", + formNestedScreen: "[data-cy=controls-FormNestedScreen]", + formRecordList: "[data-cy=controls-FormRecordList]", + formHtmlViewer: "[data-cy=controls-FormHtmlViewer]", + formSelectList: "[data-cy=controls-FormSelectList]", + formSubmit: "[data-cy=controls-FormButton]", + formTextArea: "[data-cy=controls-FormTextArea]" +}; diff --git a/tests/e2e/support/e2e.js b/tests/e2e/support/e2e.js new file mode 100644 index 000000000..5ba1d9628 --- /dev/null +++ b/tests/e2e/support/e2e.js @@ -0,0 +1 @@ +import "@cypress/code-coverage/support"; diff --git a/tests/e2e/support/index.js b/tests/e2e/support/index.js index 11acccdc1..90bdf7c26 100644 --- a/tests/e2e/support/index.js +++ b/tests/e2e/support/index.js @@ -1,2 +1,2 @@ -import './commands'; -import '@cypress/code-coverage/support'; +import "./commands"; +import "./e2e"; diff --git a/tests/e2e/support/utils.js b/tests/e2e/support/utils.js index 0b42e4e01..113ca1a4a 100644 --- a/tests/e2e/support/utils.js +++ b/tests/e2e/support/utils.js @@ -1,4 +1,4 @@ -import {nodeControls} from './constants'; +import path from "path"; /** * This method is responsible to add a control inside the screen @@ -18,8 +18,10 @@ export function addControl(controlName) { * @return nothing returns */ export function addControlInsideLoop(numLoop, control) { - cy.get(control).drag('[data-cy=screen-element-container] .column-draggable div'); - cy.get('[data-cy=screen-element-container]').last().click(); + cy.get(control).drag( + "[data-cy=screen-element-container] .column-draggable div" + ); + cy.get("[data-cy=screen-element-container]").last().click(); } /** @@ -27,9 +29,9 @@ export function addControlInsideLoop(numLoop, control) { * @return nothing returns */ export function previewScreen() { - cy.get('[data-cy="mode-preview"]').should('be.visible'); + cy.get('[data-cy="mode-preview"]').should("be.visible"); cy.get('[data-cy="mode-preview"]').click(); - cy.get('[id="showDataInput"]').should('be.visible'); + cy.get('[id="showDataInput"]').should("be.visible"); } /** @@ -37,9 +39,12 @@ export function previewScreen() { * @return nothing returns */ export function previewScreenWebMobile(mode) { - let selectorMode = '[data-cy="device-screen-mode-button"]'.replace('mode',mode); - cy.get(selectorMode).should('be.visible').click(); - cy.get(selectorMode).should('have.class', 'btn btn-secondary'); + const selectorMode = '[data-cy="device-screen-mode-button"]'.replace( + "mode", + mode + ); + cy.get(selectorMode).should("be.visible").click(); + cy.get(selectorMode).should("have.class", "btn btn-secondary"); } /** @@ -49,10 +54,15 @@ export function previewScreenWebMobile(mode) { * @return nothing returns */ export function addControlInsideTable(numColumn, control) { - let column = '[data-cy=screen-element-container] >* div[class^= "column-draggable"]:nth-child(numColumn)' - .replace('numColumn',numColumn); - cy.get(control).drag('[data-cy=screen-element-container] >* div[class^= "column-draggable"]:nth-child(2)'); - cy.get('[data-cy=screen-element-container]').last().click(); + const column = + '[data-cy=screen-element-container] >* div[class^= "column-draggable"]:nth-child(numColumn)'.replace( + "numColumn", + numColumn + ); + cy.get(control).drag( + '[data-cy=screen-element-container] >* div[class^= "column-draggable"]:nth-child(2)' + ); + cy.get("[data-cy=screen-element-container]").last().click(); } /** @@ -60,9 +70,9 @@ export function addControlInsideTable(numColumn, control) { * @return nothing returns */ export function goToDesigner() { - cy.get('[data-cy="mode-editor"]').should('be.visible'); + cy.get('[data-cy="mode-editor"]').should("be.visible"); cy.get('[data-cy="mode-editor"]').click(); - cy.get('[id="screen-container"]').should('be.visible'); + cy.get('[id="screen-container"]').should("be.visible"); } /** @@ -72,14 +82,38 @@ export function goToDesigner() { * @param attempts: it is not change * @return nothing returns */ -export function waitUntilElementIsVisible(selector, maxAttempts=10, attempts=0){ +export function waitUntilElementIsVisible( + selector, + maxAttempts = 10, + attempts = 0 +) { if (attempts > maxAttempts) { throw new Error("Timed out waiting for report to be generated"); } cy.wait(500); - cy.get('body').then($body => { - if ($body.find(selector).length <= 0) { - waitUntilElementIsVisible(selector, maxAttempts, attempts+1); - } - }); -} \ No newline at end of file + cy.get("body").then(($body) => { + if ($body.find(selector).length <= 0) { + waitUntilElementIsVisible(selector, maxAttempts, attempts + 1); + } + }); +} + +export const validateImage = (downloadedFilename) => { + const downloadsFolder = Cypress.config("downloadsFolder"); + + if (!downloadedFilename) { + throw new Error("Filename wasn't provided"); + } + + const filename = path.join(downloadsFolder, downloadedFilename); + + // ensure the file has been saved before trying to parse it + cy.readFile(filename, "binary", { timeout: 15000 }).should((buffer) => { + // by having length assertion we ensure the file has text + // since we don't know when the browser finishes writing it to disk + + // Tip: use expect() form to avoid dumping binary contents + // of the buffer into the Command Log + expect(buffer.length).to.be.gt(1000); + }); +}; diff --git a/vite.config.js b/vite.config.js index fd8c6794f..75c30d238 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,6 +3,7 @@ import vue from "@vitejs/plugin-vue2"; import monacoEditorPlugin from "vite-plugin-monaco-editor"; import { resolve } from "path"; import { viteCommonjs } from "@originjs/vite-plugin-commonjs"; +import istanbulPlugin from "vite-plugin-istanbul"; const libraryName = "VueFormBuilder"; const monacoLanguages = ["editorWorkerService", "typescript", "css", "json"]; @@ -16,7 +17,13 @@ export default defineConfig({ vue(), // https://github.com/vdesjs/vite-plugin-monaco-editor/issues/21 monacoEditorPlugin({ languageWorkers: monacoLanguages }), - viteCommonjs() + viteCommonjs(), + istanbulPlugin({ + include: "src/**", + exclude: ["node_modules", "test/"], + extension: [".js", ".ts", ".vue"], + requireEnv: true + }) ], resolve: { alias: [ @@ -75,7 +82,7 @@ export default defineConfig({ }, server: { watch: { - ignored: ["coverage"] + ignored: ["**/coverage/**", "**/.nyc-output/**"] } } });