diff --git a/client/cypress/e2e/_2makePendingSnapshot.cy.ts b/client/cypress/e2e/_2makePendingSnapshot.cy.ts index a1b96c0ee4..5a08ab5ac0 100644 --- a/client/cypress/e2e/_2makePendingSnapshot.cy.ts +++ b/client/cypress/e2e/_2makePendingSnapshot.cy.ts @@ -1,9 +1,6 @@ -import axios from 'axios'; - import { mockCoinPricesServer, visitWithLoader } from 'cypress/utils/e2e'; -import { QUERY_KEYS } from 'src/api/queryKeys'; +import { mutateAsyncMakeSnapshot } from 'cypress/utils/moveTime'; import { IS_ONBOARDING_ALWAYS_VISIBLE, IS_ONBOARDING_DONE } from 'src/constants/localStorageKeys'; -import env from 'src/env'; import { ROOT_ROUTES } from 'src/routes/RootRoutes/routes'; // In E2E snapshotter is disabled. Before the first test can be run, pending snapshot needs to be done. @@ -27,20 +24,12 @@ describe('Make pending snapshot', () => { it('make pending snapshot', () => { cy.window().then(async win => { - const isDecisionWindowOpen = win.clientReactQuery.getQueryData( - QUERY_KEYS.isDecisionWindowOpen, - ); - - if (!isDecisionWindowOpen) { - expect(true).to.be.true; - return; - } - cy.wrap(null).then(() => { - axios.post(`${env.serverEndpoint}snapshots/pending`).then(() => { - cy.get('[data-test=SyncView]', { timeout: 60000 }).should('not.exist'); + return mutateAsyncMakeSnapshot(win, 'pending').then(str => { + expect(str).to.eq(true); }); }); + cy.get('[data-test=SyncView]', { timeout: 60000 }).should('not.exist'); }); }); }); diff --git a/client/cypress/e2e/project.cy.ts b/client/cypress/e2e/project.cy.ts index 87e44a94d0..987d29ed04 100644 --- a/client/cypress/e2e/project.cy.ts +++ b/client/cypress/e2e/project.cy.ts @@ -150,15 +150,16 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight }) => }); beforeEach(() => { + cy.intercept('GET', '**/ipfs/**', req => { + req.destroy(); + }); + mockCoinPricesServer(); localStorage.setItem(IS_ONBOARDING_DONE, 'true'); visitWithLoader(ROOT_ROUTES.projects.absolute); }); it('entering project view shows Toast with info about IPFS failure when all providers fail', () => { - cy.intercept('GET', '**/ipfs/**', req => { - req.destroy(); - }); cy.get('[data-test=Toast--ipfsMessage').should('be.visible'); }); diff --git a/client/cypress/utils/moveTime.ts b/client/cypress/utils/moveTime.ts index e8ca436043..c5e810b3a1 100644 --- a/client/cypress/utils/moveTime.ts +++ b/client/cypress/utils/moveTime.ts @@ -26,7 +26,7 @@ const mutateAsyncMoveToDecisionWindowClosed = (cypressWindow: Cypress.AUTWindow) }); }); -const mutateAsyncMakeSnapshot = ( +export const mutateAsyncMakeSnapshot = ( cypressWindow: Cypress.AUTWindow, type: 'finalized' | 'pending', ): Promise => diff --git a/client/package.json b/client/package.json index c5b734185c..af7ee80f83 100644 --- a/client/package.json +++ b/client/package.json @@ -113,7 +113,7 @@ "vite-plugin-html-config": "^1.0.11" }, "resolutions": { - "**/cypress": "12.17.3" + "**/cypress": "13.8.1" }, "engines": { "node": ">= 16.13.0 <17.0.0" diff --git a/client/synpress.config.ts b/client/synpress.config.ts index 3d6311a099..780da56f26 100644 --- a/client/synpress.config.ts +++ b/client/synpress.config.ts @@ -29,6 +29,7 @@ export default defineConfig({ }, supportFile: 'cypress/support/index.ts', }, + video: true, viewportHeight: 1080, viewportWidth: 1920, }); diff --git a/client/yarn.lock b/client/yarn.lock index 68e34b8693..de7e41a9d8 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -958,10 +958,10 @@ js-yaml "4.1.0" nyc "15.1.0" -"@cypress/request@^2.88.11": - version "2.88.12" - resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.12.tgz#ba4911431738494a85e93fb04498cb38bc55d590" - integrity sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA== +"@cypress/request@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@cypress/request/-/request-3.0.1.tgz#72d7d5425236a2413bd3d8bb66d02d9dc3168960" + integrity sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -976,7 +976,7 @@ json-stringify-safe "~5.0.1" mime-types "~2.1.19" performance-now "^2.1.0" - qs "~6.10.3" + qs "6.10.4" safe-buffer "^5.1.2" tough-cookie "^4.1.3" tunnel-agent "^0.6.0" @@ -3179,11 +3179,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== -"@types/node@^16.18.39": - version "16.18.78" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.78.tgz#3d97264128712f2eb59f1f8456bcfc5d56d8105c" - integrity sha512-2poPMDdsGfvhcLmgJZ85QrIfN6z3PijYRMiV0FWIEUiQW/t/lzH7BEm4vN+HMhjZXbtIKssMcAxTcgu4Rm83YA== - "@types/prettier@^2.6.1": version "2.7.3" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" @@ -4930,7 +4925,7 @@ buffer@6.0.3, buffer@^6.0.3, buffer@~6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -buffer@^5.2.1, buffer@^5.5.0, buffer@^5.6.0: +buffer@^5.2.1, buffer@^5.5.0, buffer@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -5574,20 +5569,19 @@ cypress-wait-until@^2.0.1: resolved "https://registry.yarnpkg.com/cypress-wait-until/-/cypress-wait-until-2.0.1.tgz#69c575c7207d83e4ae023e2aaecf2b66148c9fc0" integrity sha512-+IyVnYNiaX1+C+V/LazrJWAi/CqiwfNoRSrFviECQEyolW1gDRy765PZosL2alSSGK8V10Y7BGfOQyZUDgmnjQ== -cypress@*, cypress@12.17.3: - version "12.17.3" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.3.tgz#1e2b19037236fc60e4a4b3a14f0846be17a1fc0e" - integrity sha512-/R4+xdIDjUSLYkiQfwJd630S81KIgicmQOLXotFxVXkl+eTeVO+3bHXxdi5KBh/OgC33HWN33kHX+0tQR/ZWpg== +cypress@*, cypress@12.17.3, cypress@13.8.1: + version "13.8.1" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.8.1.tgz#f558e51b770a409e2360031bbd36c3f4fb3f2db4" + integrity sha512-Uk6ovhRbTg6FmXjeZW/TkbRM07KPtvM5gah1BIMp4Y2s+i/NMxgaLw0+PbYTOdw1+egE0FP3mWRiGcRkjjmhzA== dependencies: - "@cypress/request" "^2.88.11" + "@cypress/request" "^3.0.0" "@cypress/xvfb" "^1.2.4" - "@types/node" "^16.18.39" "@types/sinonjs__fake-timers" "8.1.1" "@types/sizzle" "^2.3.2" arch "^2.2.0" blob-util "^2.0.2" bluebird "^3.7.2" - buffer "^5.6.0" + buffer "^5.7.1" cachedir "^2.3.0" chalk "^4.1.0" check-more-types "^2.24.0" @@ -5605,7 +5599,7 @@ cypress@*, cypress@12.17.3: figures "^3.2.0" fs-extra "^9.1.0" getos "^3.2.1" - is-ci "^3.0.0" + is-ci "^3.0.1" is-installed-globally "~0.4.0" lazy-ass "^1.6.0" listr2 "^3.8.3" @@ -5614,6 +5608,7 @@ cypress@*, cypress@12.17.3: 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" @@ -8448,7 +8443,7 @@ is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-ci@^3.0.0: +is-ci@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.1.tgz#db6ecbed1bd659c43dac0f45661e7674103d1867" integrity sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ== @@ -11081,6 +11076,13 @@ qrcode@1.5.3, qrcode@^1.5.1: pngjs "^5.0.0" yargs "^15.3.1" +qs@6.10.4: + version "6.10.4" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.4.tgz#6a3003755add91c0ec9eacdc5f878b034e73f9e7" + integrity sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g== + dependencies: + side-channel "^1.0.4" + qs@6.11.0: version "6.11.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" @@ -11095,13 +11097,6 @@ qs@^6.10.3: dependencies: side-channel "^1.0.4" -qs@~6.10.3: - version "6.10.5" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.5.tgz#974715920a80ff6a262264acd2c7e6c2a53282b4" - integrity sha512-O5RlPh0VFtR78y79rgcgKK4wbAI0C5zGVLztOIdpWX6ep368q5Hv6XRxDvXuZ9q3C6v+e3n8UfZZJw7IIG27eQ== - dependencies: - side-channel "^1.0.4" - query-string@7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.3.tgz#a1cf90e994abb113a325804a972d98276fe02328"