From 5bc861b5ecd3ef79328918ab6c17a5f7fc416795 Mon Sep 17 00:00:00 2001 From: Joe Tsang <30622993+jtsang586@users.noreply.github.com> Date: Wed, 30 Nov 2022 12:32:01 +0000 Subject: [PATCH] chore(cypress-11): upgrade to cypress 11.2 (#2251) * chore: upgrade to cypress 11.2 * fix: update grep tags --- apps/console-lite-e2e/cypress.config.js | 2 +- apps/console-lite-e2e/index.d.ts | 20 +++++++++ apps/console-lite-e2e/src/support/index.js | 2 +- apps/console-lite-e2e/tsconfig.json | 4 +- apps/explorer-e2e/cypress.config.js | 2 +- apps/explorer-e2e/src/support/index.js | 2 +- apps/explorer-e2e/tsconfig.json | 2 +- .../tsconfig.json | 2 +- apps/stats-e2e/cypress.config.js | 2 +- apps/stats-e2e/tsconfig.json | 2 +- apps/token-e2e/cypress.config.js | 2 +- apps/token-e2e/src/support/index.js | 2 +- apps/token-e2e/tsconfig.json | 2 +- apps/trading-e2e/cypress.config.js | 2 +- apps/trading-e2e/src/index.d.ts | 20 +++++++++ apps/trading-e2e/src/support/index.js | 2 +- apps/trading-e2e/tsconfig.json | 2 +- package.json | 4 +- yarn.lock | 42 +++++++++---------- 19 files changed, 78 insertions(+), 40 deletions(-) create mode 100644 apps/console-lite-e2e/index.d.ts create mode 100644 apps/trading-e2e/src/index.d.ts diff --git a/apps/console-lite-e2e/cypress.config.js b/apps/console-lite-e2e/cypress.config.js index 4c265f78a..b1d8da6a5 100644 --- a/apps/console-lite-e2e/cypress.config.js +++ b/apps/console-lite-e2e/cypress.config.js @@ -4,7 +4,7 @@ module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { - require('cypress-grep/src/plugin')(config); + require('@cypress/grep/src/plugin')(config); return config; }, baseUrl: 'http://localhost:4200', diff --git a/apps/console-lite-e2e/index.d.ts b/apps/console-lite-e2e/index.d.ts new file mode 100644 index 000000000..0ef79cee8 --- /dev/null +++ b/apps/console-lite-e2e/index.d.ts @@ -0,0 +1,20 @@ +/// + +declare namespace Cypress { + // specify additional properties in the TestConfig object + // in our case we will add "tags" property + interface SuiteConfigOverrides { + /** + * List of tags for this test + * @example a single tag + * it('logs in', { tags: '@smoke' }, () => { ... }) + * @example multiple tags + * it('works', { tags: ['@smoke', '@slow'] }, () => { ... }) + */ + tags?: string | string[]; + } + + interface Cypress { + grep?: (grep?: string, tags?: string, burn?: string) => void; + } +} diff --git a/apps/console-lite-e2e/src/support/index.js b/apps/console-lite-e2e/src/support/index.js index b4d89db70..c83554b56 100644 --- a/apps/console-lite-e2e/src/support/index.js +++ b/apps/console-lite-e2e/src/support/index.js @@ -17,7 +17,7 @@ import '@vegaprotocol/cypress'; import 'cypress-real-events/support'; // Import commands.js using ES2015 syntax: import './commands'; -import registerCypressGrep from 'cypress-grep'; +import registerCypressGrep from '@cypress/grep'; import { aliasQuery } from '@vegaprotocol/cypress'; registerCypressGrep(); diff --git a/apps/console-lite-e2e/tsconfig.json b/apps/console-lite-e2e/tsconfig.json index 49606e324..aaa5b821f 100644 --- a/apps/console-lite-e2e/tsconfig.json +++ b/apps/console-lite-e2e/tsconfig.json @@ -7,7 +7,7 @@ "allowSyntheticDefaultImports": true, "outDir": "../../dist/out-tsc", "allowJs": true, - "types": ["cypress", "node", "cypress-real-events", "cypress-grep"] + "types": ["cypress", "node", "cypress-real-events", "@cypress/grep"] }, - "include": ["src/**/*.ts", "src/**/*.js", "./declaration.d.ts"] + "include": ["src/**/*.ts", "src/**/*.js", "./declaration.d.ts", "index.d.ts"] } diff --git a/apps/explorer-e2e/cypress.config.js b/apps/explorer-e2e/cypress.config.js index 0ad8c33b8..94f67efec 100644 --- a/apps/explorer-e2e/cypress.config.js +++ b/apps/explorer-e2e/cypress.config.js @@ -5,7 +5,7 @@ module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { - require('cypress-grep/src/plugin')(config); + require('@cypress/grep/src/plugin')(config); return config; }, baseUrl: 'http://localhost:3000', diff --git a/apps/explorer-e2e/src/support/index.js b/apps/explorer-e2e/src/support/index.js index b0db2b56f..f465bb877 100644 --- a/apps/explorer-e2e/src/support/index.js +++ b/apps/explorer-e2e/src/support/index.js @@ -15,5 +15,5 @@ import '@vegaprotocol/cypress'; import './common.functions.js'; -import registerCypressGrep from 'cypress-grep'; +import registerCypressGrep from '@cypress/grep'; registerCypressGrep(); diff --git a/apps/explorer-e2e/tsconfig.json b/apps/explorer-e2e/tsconfig.json index a1c55b9af..61bebe3a0 100644 --- a/apps/explorer-e2e/tsconfig.json +++ b/apps/explorer-e2e/tsconfig.json @@ -4,7 +4,7 @@ "jsx": "react-jsx", "sourceMap": false, "outDir": "../../dist/out-tsc", - "types": ["cypress", "node", "cypress-grep"], + "types": ["cypress", "node", "@cypress/grep"], "allowJs": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, diff --git a/apps/liquidity-provision-dashboard-e2e/tsconfig.json b/apps/liquidity-provision-dashboard-e2e/tsconfig.json index 577c13271..0c7a3b3ae 100644 --- a/apps/liquidity-provision-dashboard-e2e/tsconfig.json +++ b/apps/liquidity-provision-dashboard-e2e/tsconfig.json @@ -6,7 +6,7 @@ "allowSyntheticDefaultImports": true, "outDir": "../../dist/out-tsc", "allowJs": true, - "types": ["cypress", "node", "cypress-real-events", "cypress-grep"] + "types": ["cypress", "node", "cypress-real-events", "@cypress/grep"] }, "include": ["src/**/*.ts", "src/**/*.js"] } diff --git a/apps/stats-e2e/cypress.config.js b/apps/stats-e2e/cypress.config.js index d9a8ed447..ca0f53e7f 100644 --- a/apps/stats-e2e/cypress.config.js +++ b/apps/stats-e2e/cypress.config.js @@ -4,7 +4,7 @@ module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { - require('cypress-grep/src/plugin')(config); + require('@cypress/grep/src/plugin')(config); return config; }, baseUrl: 'http://localhost:3010', diff --git a/apps/stats-e2e/tsconfig.json b/apps/stats-e2e/tsconfig.json index 0285eeffa..6b19c9191 100644 --- a/apps/stats-e2e/tsconfig.json +++ b/apps/stats-e2e/tsconfig.json @@ -7,7 +7,7 @@ "allowSyntheticDefaultImports": true, "outDir": "../../dist/out-tsc", "allowJs": true, - "types": ["cypress", "node", "cypress-grep"] + "types": ["cypress", "node", "@cypress/grep"] }, "include": ["src/**/*.ts", "src/**/*.js"] } diff --git a/apps/token-e2e/cypress.config.js b/apps/token-e2e/cypress.config.js index 692d5dbd6..d030f6937 100644 --- a/apps/token-e2e/cypress.config.js +++ b/apps/token-e2e/cypress.config.js @@ -5,7 +5,7 @@ module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { - require('cypress-grep/src/plugin')(config); + require('@cypress/grep/src/plugin')(config); return config; }, baseUrl: 'http://localhost:4210', diff --git a/apps/token-e2e/src/support/index.js b/apps/token-e2e/src/support/index.js index 59a6e87b4..d4860d34a 100644 --- a/apps/token-e2e/src/support/index.js +++ b/apps/token-e2e/src/support/index.js @@ -6,7 +6,7 @@ import './governance.functions.js'; import './wallet-eth.functions.js'; import './wallet-teardown.functions.js'; import './wallet-vega.functions.js'; -import registerCypressGrep from 'cypress-grep'; +import registerCypressGrep from '@cypress/grep'; import { aliasQuery } from '@vegaprotocol/cypress'; registerCypressGrep(); diff --git a/apps/token-e2e/tsconfig.json b/apps/token-e2e/tsconfig.json index 0285eeffa..6b19c9191 100644 --- a/apps/token-e2e/tsconfig.json +++ b/apps/token-e2e/tsconfig.json @@ -7,7 +7,7 @@ "allowSyntheticDefaultImports": true, "outDir": "../../dist/out-tsc", "allowJs": true, - "types": ["cypress", "node", "cypress-grep"] + "types": ["cypress", "node", "@cypress/grep"] }, "include": ["src/**/*.ts", "src/**/*.js"] } diff --git a/apps/trading-e2e/cypress.config.js b/apps/trading-e2e/cypress.config.js index 3253aa08e..873a3f840 100644 --- a/apps/trading-e2e/cypress.config.js +++ b/apps/trading-e2e/cypress.config.js @@ -16,7 +16,7 @@ module.exports = defineConfig({ }, e2e: { setupNodeEvents(on, config) { - require('cypress-grep/src/plugin')(config); + require('@cypress/grep/src/plugin')(config); return config; }, baseUrl: 'http://localhost:4200', diff --git a/apps/trading-e2e/src/index.d.ts b/apps/trading-e2e/src/index.d.ts new file mode 100644 index 000000000..0ef79cee8 --- /dev/null +++ b/apps/trading-e2e/src/index.d.ts @@ -0,0 +1,20 @@ +/// + +declare namespace Cypress { + // specify additional properties in the TestConfig object + // in our case we will add "tags" property + interface SuiteConfigOverrides { + /** + * List of tags for this test + * @example a single tag + * it('logs in', { tags: '@smoke' }, () => { ... }) + * @example multiple tags + * it('works', { tags: ['@smoke', '@slow'] }, () => { ... }) + */ + tags?: string | string[]; + } + + interface Cypress { + grep?: (grep?: string, tags?: string, burn?: string) => void; + } +} diff --git a/apps/trading-e2e/src/support/index.js b/apps/trading-e2e/src/support/index.js index ebdd2d345..d018c38cd 100644 --- a/apps/trading-e2e/src/support/index.js +++ b/apps/trading-e2e/src/support/index.js @@ -1,6 +1,6 @@ import '@vegaprotocol/cypress'; import 'cypress-real-events/support'; -import registerCypressGrep from 'cypress-grep'; +import registerCypressGrep from '@cypress/grep'; import { addMockTradingPage } from './trading'; registerCypressGrep(); addMockTradingPage(); diff --git a/apps/trading-e2e/tsconfig.json b/apps/trading-e2e/tsconfig.json index 60d3f6c26..bd897e98c 100644 --- a/apps/trading-e2e/tsconfig.json +++ b/apps/trading-e2e/tsconfig.json @@ -5,7 +5,7 @@ "sourceMap": false, "outDir": "../../dist/out-tsc", "allowJs": true, - "types": ["cypress", "node", "cypress-real-events", "cypress-grep"], + "types": ["cypress", "node", "cypress-real-events", "@cypress/grep"], "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, diff --git a/package.json b/package.json index 2ac840259..c3df1e365 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "@babel/preset-typescript": "7.12.13", "@commitlint/cli": "^16.2.4", "@commitlint/config-conventional": "^16.2.4", + "@cypress/grep": "^3.1.0", "@ethersproject/experimental": "^5.6.0", "@graphql-codegen/cli": "^2.11.8", "@graphql-codegen/near-operation-file-preset": "^2.4.1", @@ -144,8 +145,7 @@ "autoprefixer": "10.4.8", "babel-jest": "27.5.1", "babel-loader": "8.1.0", - "cypress": "^10.2.0", - "cypress-grep": "^3.0.3", + "cypress": "^11.2.0", "cypress-real-events": "^1.7.1", "dotenv": "^16.0.1", "eslint": "8.15.0", diff --git a/yarn.lock b/yarn.lock index e3302d770..12a9044f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -501,7 +501,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.1.3", "@babel/parser@^7.12.13", "@babel/parser@^7.14.0", "@babel/parser@^7.16.5", "@babel/parser@^7.16.8": +"@babel/parser@^7.1.0", "@babel/parser@^7.1.3", "@babel/parser@^7.12.13", "@babel/parser@^7.14.0", "@babel/parser@^7.16.8": version "7.19.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.4.tgz#03c4339d2b8971eb3beca5252bafd9b9f79db3dc" integrity sha512-qpVT7gtuOLjWeDTKLkJ6sryqLliBaFpAtGeqw5cs5giLldvh+Ch0plqnUMKoVAUS6ZEueQQiZV+p5pxtPitEsA== @@ -511,6 +511,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.3.tgz#5358cf62e380cf69efcb87a7bb922ff88bfac6e2" integrity sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg== +"@babel/parser@^7.16.5": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.5.tgz#7f3c7335fe417665d929f34ae5dceae4c04015e8" + integrity sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" @@ -1750,6 +1755,15 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" +"@cypress/grep@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@cypress/grep/-/grep-3.1.0.tgz#d055fd63a9dd59326020af90e2fe56610ea89ec6" + integrity sha512-ZSAwUyEw7e7Lu4KhjQLZrJDnzA04awqikj7ZcPHr+oW4wDpiVscn7VEZ/P/WRC1fBydUoZ5e24aFEPxXmKCreg== + dependencies: + debug "^4.3.2" + find-test-names "^1.19.0" + globby "^11.0.4" + "@cypress/request@^2.88.10": version "2.88.10" resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.10.tgz#b66d76b07f860d3a4b8d7a0604d020c662752cce" @@ -11102,24 +11116,15 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A== -cypress-grep@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/cypress-grep/-/cypress-grep-3.0.3.tgz#fb79b26a30333ce75f512b52824bc3b288f90919" - integrity sha512-N7AErz9HJavM0+l59ktRa0Ix9/kljp59eXYqW/JuuYQg2xaa4LsWxk93KPwXeaaEyPvWcrABEgXNSxFe1L/qCQ== - dependencies: - debug "4.3.1" - find-test-names "^1.17.2" - globby "^11.0.4" - cypress-real-events@^1.7.1: version "1.7.1" resolved "https://registry.yarnpkg.com/cypress-real-events/-/cypress-real-events-1.7.1.tgz#8f430d67c29ea4f05b9c5b0311780120cbc9b935" integrity sha512-/Bg15RgJ0SYsuXc6lPqH08x19z6j2vmhWN4wXfJqm3z8BTAFiK2MvipZPzxT8Z0jJP0q7kuniWrLIvz/i/8lCQ== -cypress@^10.2.0: - version "10.10.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.10.0.tgz#fd671297b2ca3e64dfffd55fe3857c388cfbb695" - integrity sha512-bU8r44x1NIYAUNNXt3CwJpLOVth7HUv2hUhYCxZmgZ1IugowDvuHNpevnoZRQx1KKOEisLvIJW+Xen5Pjn41pg== +cypress@^11.2.0: + version "11.2.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-11.2.0.tgz#63edef8c387b687066c5493f6f0ad7b9ced4b2b7" + integrity sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA== dependencies: "@cypress/request" "^2.88.10" "@cypress/xvfb" "^1.2.4" @@ -11420,13 +11425,6 @@ debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, d dependencies: ms "2.1.2" -debug@4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" @@ -13112,7 +13110,7 @@ find-root@^1.1.0: resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== -find-test-names@^1.17.2: +find-test-names@^1.19.0: version "1.21.0" resolved "https://registry.yarnpkg.com/find-test-names/-/find-test-names-1.21.0.tgz#fe0d0bdd7e8ad9df6b5e0f08986e982654fc4417" integrity sha512-yYcl4X2U1maVXCktO24e9K7qs1uDqDTQWe51gso6JgK2iinRbNyHKrb43/LQTit8/SteA2qODqPkapgeuSdzZw==