Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Cypress version 10.0 (big migration) #654

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require("./cypress/plugins")(on, config);
},
baseUrl: "http://localhost:3000",
specPattern: "./cypress/integration/**/**/",
supportFile: false,
video: true,
screenshotOnRunFailure: true,
watchForFileChanges: false,
},
});
5 changes: 0 additions & 5 deletions cypress/fixtures/example.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import moment from "moment";

import { TrustedCirclesPage } from "../page-object/TrustedCirclesPage";
import { TrustedCirclesPage } from "../../page-object/TrustedCirclesPage";

const trustedCirclesPage = new TrustedCirclesPage();
const currentTime = moment().unix();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Random } from "@cosmjs/crypto";
import { Bech32 } from "@cosmjs/encoding";
import moment from "moment";

import { TrustedCirclesPage } from "../../page-object/TrustedCirclesPage";
import { TrustedCirclesPage } from "../../../page-object/TrustedCirclesPage";

const trustedCirclesPage = new TrustedCirclesPage();
const currentTime = moment().unix();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TMarketPage } from "../../page-object/TMarketPage";
import { TrustedCirclesPage } from "../../page-object/TrustedCirclesPage";
import { TMarketPage } from "../../../page-object/TMarketPage";
import { TrustedCirclesPage } from "../../../page-object/TrustedCirclesPage";

const trustedCirclesPage = new TrustedCirclesPage();
const tMarketPage = new TMarketPage();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import moment from "moment";

import { TrustedCirclesPage } from "../../page-object/TrustedCirclesPage";
import { TrustedCirclesPage } from "../../../page-object/TrustedCirclesPage";

const trustedCirclesPage = new TrustedCirclesPage();
const currentTime = moment().unix();
Expand Down
12 changes: 0 additions & 12 deletions cypress/localhost-config.json

This file was deleted.

29 changes: 1 addition & 28 deletions cypress/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.ts can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/**
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
const browserify = require("@cypress/browserify-preprocessor");
const cucumber = require("cypress-cucumber-preprocessor").default;
const resolve = require("resolve");
Expand All @@ -25,15 +7,6 @@ module.exports = (on, config) => {
...browserify.defaultOptions,
typescript: resolve.sync("typescript", { baseDir: config.projectRoot }),
};
on("file:preprocessor", cucumber(options));

on("task", {
log(message) {
console.log(message);

return null;
},
});
on("file:preprocessor", cucumber(options));
};

export {};
2 changes: 1 addition & 1 deletion cypress/steps-definition/TrustedCircles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ And("I select Whitelist Pair option", () => {
And("I select Trading Pair from drop down", () => {
cy.get(trustedCirclesPage.getDialogHeaderName()).should("contain.text", "Whitelist Pair");
cy.get(trustedCirclesPage.getDialogStepActiveNumber()).should("have.text", "2");
cy.wait(4000) //Wait to finishing fetch (probably bug)
cy.wait(4000); //Wait to finishing fetch (probably bug)
cy.get(trustedCirclesPage.getProposalOptionDropDown()).click();
cy.get(trustedCirclesPage.getFirstItemFromDropDown()).click();
});
Expand Down
1 change: 1 addition & 0 deletions cypress/support/index.ts → cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

// Import commands.ts using ES2015 syntax:
import "./commands";
import "@testing-library/cypress/add-commands";

// Alternatively you can use CommonJS syntax:
// require('./commands')
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.0.2",
"@types/ledgerhq__hw-transport-webusb": "^4.70.1",
"@types/node": "^16.11.6",
"@types/node": "^17.0.42",
"@types/react": "^17.0.33",
"@types/react-burger-menu": "^2.8.2",
"@types/react-dom": "^17.0.10",
Expand Down Expand Up @@ -62,11 +62,13 @@
},
"devDependencies": {
"@cypress/browserify-preprocessor": "^3.0.2",
"@testing-library/cypress": "^8.0.2",
"@cypress/webpack-preprocessor": "^5.12.0",
"@testing-library/cypress": "^8.0.3",
"axios": "^0.26.1",
"cypress": "^9.5.4",
"cypress": "^10.1.0",
"cypress-cucumber-preprocessor": "^4.3.1",
"firebase-tools": "^10.7.0",
"resolve": "^1.22.0",
"ts-proto": "^1.110.4",
"wait-on": "^6.0.1"
},
Expand All @@ -91,15 +93,16 @@
"compile": "tsc",
"format": "prettier --write --loglevel warn \"./src/**/*.ts{,x}\" --ignore-path \"./.custom-prettierignore\"",
"proto": "./scripts/proto/get-proto.sh && ./scripts/proto/codegen.sh && prettier --write --loglevel warn \"./src/codec/**/*.ts\"",
"cy:open:local": "cypress open --config-file cypress/localhost-config.json",
"cy:local": "yarn start:local & wait-on http://localhost:3000 && cypress run --browser chrome --config-file cypress/localhost-config.json --spec 'cypress/integration/volumeTests/**.ts', 'cypress/integration/exchangeTokens.feature'"
"cy:open:local": "cypress open",
"cy:local": "yarn start:local & wait-on http://localhost:3000 && e2e run --browser chrome --spec 'cypress/integration/volumeTests/**.ts', 'cypress/integration/exchangeTokens.feature'"
},
"browserslist": [
"last 2 chrome versions",
"last 2 firefox versions",
"last 2 safari versions"
],
"cypress-cucumber-preprocessor": {
"step_definitions": "cypress/steps-definition/"
"nonGlobalStepDefinitions": false,
"step_definitions": "./cypress/steps-definition/"
}
}
39 changes: 29 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2707,6 +2707,15 @@
tunnel-agent "^0.6.0"
uuid "^8.3.2"

"@cypress/webpack-preprocessor@^5.12.0":
version "5.12.0"
resolved "https://registry.yarnpkg.com/@cypress/webpack-preprocessor/-/webpack-preprocessor-5.12.0.tgz#231f6c86423237e17eaf12ce6193d4b67290b852"
integrity sha512-D/eLKKlgx6c/307FaCmjZGjFA64G29aA8KcCy6WqpNK/bSnRdPquMW2plemIsT/B80TK2DDKzZX/H3FcS41ZDA==
dependencies:
bluebird "3.7.1"
debug "^4.3.2"
lodash "^4.17.20"

"@cypress/xvfb@^1.2.4":
version "1.2.4"
resolved "https://registry.yarnpkg.com/@cypress/xvfb/-/xvfb-1.2.4.tgz#2daf42e8275b39f4aa53c14214e557bd14e7748a"
Expand Down Expand Up @@ -3509,10 +3518,10 @@
dependencies:
defer-to-connect "^1.0.1"

"@testing-library/cypress@^8.0.2":
version "8.0.2"
resolved "https://registry.yarnpkg.com/@testing-library/cypress/-/cypress-8.0.2.tgz#b13f0ff2424dec4368b6670dfbfb7e43af8eefc9"
integrity sha512-KVdm7n37sg/A4e3wKMD4zUl0NpzzVhx06V9Tf0hZHZ7nrZ4yFva6Zwg2EFF1VzHkEfN/ahUzRtT1qiW+vuWnJw==
"@testing-library/cypress@^8.0.3":
version "8.0.3"
resolved "https://registry.yarnpkg.com/@testing-library/cypress/-/cypress-8.0.3.tgz#24ab34df34d7896866603ade705afbdd186e273c"
integrity sha512-nY2YaSbmuPo5k6kL0iLj/pGPPfka3iwb3kpTx8QN/vOCns92Saz9wfACqB8FJzcR7+lfA4d5HUOWqmTddBzczg==
dependencies:
"@babel/runtime" "^7.14.6"
"@testing-library/dom" "^8.1.0"
Expand Down Expand Up @@ -3748,7 +3757,7 @@
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40"
integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==

"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@^16.11.6":
"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0":
version "16.11.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae"
integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==
Expand All @@ -3763,6 +3772,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.10.tgz#774f43868964f3cfe4ced1f5417fe15818a4eaea"
integrity sha512-6iihJ/Pp5fsFJ/aEDGyvT4pHGmCpq7ToQ/yf4bl5SbVAvwpspYJ+v3jO7n8UyjhQVHTy+KNszOozDdv+O6sovQ==

"@types/node@^17.0.42":
version "17.0.42"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.42.tgz#d7e8f22700efc94d125103075c074396b5f41f9b"
integrity sha512-Q5BPGyGKcvQgAMbsr7qEGN/kIPN6zZecYYABeTDBizOsau+2NMdSVTar9UQw21A2+JyA2KRNDYaYrPB0Rpk2oQ==

"@types/normalize-package-data@^2.4.0":
version "2.4.1"
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301"
Expand Down Expand Up @@ -5311,6 +5325,11 @@ blob-util@^2.0.2:
resolved "https://registry.yarnpkg.com/blob-util/-/blob-util-2.0.2.tgz#3b4e3c281111bb7f11128518006cdc60b403a1eb"
integrity sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==

[email protected]:
version "3.7.1"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.1.tgz#df70e302b471d7473489acf26a93d63b53f874de"
integrity sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==

bluebird@^3.4.1, bluebird@^3.5.5, bluebird@^3.7.2:
version "3.7.2"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
Expand Down Expand Up @@ -7233,10 +7252,10 @@ cypress-cucumber-preprocessor@^4.3.1:
minimist "^1.2.5"
through "^2.3.8"

cypress@^9.5.4:
version "9.5.4"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.5.4.tgz#49d9272f62eba12f2314faf29c2a865610e87550"
integrity sha512-6AyJAD8phe7IMvOL4oBsI9puRNOWxZjl8z1lgixJMcgJ85JJmyKeP6uqNA0dI1z14lmJ7Qklf2MOgP/xdAqJ/Q==
cypress@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.1.0.tgz#6514a26c721822a02bc194e9a7f72c3142aea174"
integrity sha512-aQ4JVZVib4Xd9FZW8IRZfKelUvqF4y5A+oUbNvn8TlsBmEfIg3m5Xd6Mt6PVU/jHiVJ9Psl905B3ZPnrDcmyuQ==
dependencies:
"@cypress/request" "^2.88.10"
"@cypress/xvfb" "^1.2.4"
Expand Down Expand Up @@ -16111,7 +16130,7 @@ [email protected]:
is-core-module "^2.0.0"
path-parse "^1.0.6"

resolve@^1.1.4, resolve@^1.3.3, resolve@^1.4.0:
resolve@^1.1.4, resolve@^1.22.0, resolve@^1.3.3, resolve@^1.4.0:
version "1.22.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198"
integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==
Expand Down