test: update to latest Cypress version (10.2.0) (#655)

* test: update to latest Cypress version (10.2.0)

* fix: cypress error on simple trading app
This commit is contained in:
Joe Tsang 2022-06-28 19:07:31 +01:00 committed by GitHub
parent 6f9f94229e
commit 46803ce619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 141 additions and 185 deletions

View File

@ -0,0 +1,26 @@
const { defineConfig } = require('cypress');
const setupNodeEvents = require('./src/plugins/index.js');
module.exports = defineConfig({
projectId: 'et4snf',
e2e: {
setupNodeEvents,
baseUrl: 'http://localhost:3000',
fileServerFolder: '.',
fixturesFolder: false,
specPattern: '**/*.feature',
excludeSpecPattern: '**/*.js',
modifyObstructiveCode: false,
supportFile: './src/support/index.ts',
video: true,
videosFolder: '../../dist/cypress/apps/explorer-e2e/videos',
screenshotsFolder: '../../dist/cypress/apps/explorer-e2e/screenshots',
chromeWebSecurity: false,
},
env: {
environment: 'CUSTOM',
tsConfig: 'tsconfig.json',
TAGS: 'not @todo and not @ignore and not @manual',
},
});

View File

@ -1,21 +0,0 @@
{
"baseUrl": "http://localhost:3000",
"projectId": "et4snf",
"fileServerFolder": ".",
"fixturesFolder": false,
"pluginsFile": "./src/plugins/index.js",
"testFiles": "*.{ts,feature,features}",
"ignoreTestFiles": "**/*.js",
"integrationFolder": "./src/integration",
"modifyObstructiveCode": false,
"supportFile": "./src/support/index.ts",
"video": true,
"videosFolder": "../../dist/cypress/apps/explorer-e2e/videos",
"screenshotsFolder": "../../dist/cypress/apps/explorer-e2e/screenshots",
"chromeWebSecurity": false,
"env": {
"environment": "CUSTOM",
"tsConfig": "tsconfig.json",
"TAGS": "not @todo and not @ignore and not @manual"
}
}

View File

@ -6,7 +6,7 @@
"e2e": { "e2e": {
"executor": "@nrwl/cypress:cypress", "executor": "@nrwl/cypress:cypress",
"options": { "options": {
"cypressConfig": "apps/explorer-e2e/cypress.json", "cypressConfig": "apps/explorer-e2e/cypress.config.js",
"devServerTarget": "explorer:serve" "devServerTarget": "explorer:serve"
}, },
"configurations": { "configurations": {

View File

@ -0,0 +1,18 @@
const { defineConfig } = require('cypress');
module.exports = defineConfig({
projectId: 'et4snf',
e2e: {
baseUrl: 'http://localhost:4200',
fileServerFolder: '.',
fixturesFolder: false,
specPattern: './src/integration/*.ts',
excludeSpecPattern: '**/*.js',
modifyObstructiveCode: false,
supportFile: './src/support/index.ts',
video: true,
videosFolder: '../../dist/cypress/apps/explorer-e2e/videos',
screenshotsFolder: '../../dist/cypress/apps/explorer-e2e/screenshots',
chromeWebSecurity: false,
},
});

View File

@ -1,16 +0,0 @@
{
"baseUrl": "http://localhost:4200",
"fileServerFolder": ".",
"testFiles": "*.{ts,feature,features}",
"ignoreTestFiles": "**/*.js",
"fixturesFolder": "./src/fixtures",
"integrationFolder": "./src/integration",
"modifyObstructiveCode": false,
"supportFile": "./src/support/index.ts",
"pluginsFile": false,
"video": true,
"videosFolder": "../../dist/cypress/apps/simple-trading-app-e2e/videos",
"screenshotsFolder": "../../dist/cypress/apps/simple-trading-app-e2e/screenshots",
"chromeWebSecurity": false,
"projectId": "et4snf"
}

View File

@ -6,7 +6,7 @@
"e2e": { "e2e": {
"executor": "@nrwl/cypress:cypress", "executor": "@nrwl/cypress:cypress",
"options": { "options": {
"cypressConfig": "apps/simple-trading-app-e2e/cypress.json", "cypressConfig": "apps/simple-trading-app-e2e/cypress.config.js",
"devServerTarget": "simple-trading-app:serve" "devServerTarget": "simple-trading-app:serve"
}, },
"configurations": { "configurations": {

View File

@ -0,0 +1,18 @@
const { defineConfig } = require('cypress');
module.exports = defineConfig({
projectId: 'et4snf',
e2e: {
baseUrl: 'http://localhost:3010',
fileServerFolder: '.',
fixturesFolder: false,
specPattern: './src/integration/*.ts',
excludeSpecPattern: '**/*.js',
modifyObstructiveCode: false,
supportFile: './src/support/index.ts',
video: true,
videosFolder: '../../dist/cypress/apps/explorer-e2e/videos',
screenshotsFolder: '../../dist/cypress/apps/explorer-e2e/screenshots',
chromeWebSecurity: false,
},
});

View File

@ -1,14 +0,0 @@
{
"baseUrl": "http://localhost:3010",
"projectId": "et4snf",
"fileServerFolder": ".",
"fixturesFolder": "./src/fixtures",
"integrationFolder": "./src/integration",
"modifyObstructiveCode": false,
"supportFile": "./src/support/index.ts",
"pluginsFile": false,
"video": true,
"videosFolder": "../../dist/cypress/apps/stats-e2e/videos",
"screenshotsFolder": "../../dist/cypress/apps/stats-e2e/screenshots",
"chromeWebSecurity": false
}

View File

@ -6,7 +6,7 @@
"e2e": { "e2e": {
"executor": "@nrwl/cypress:cypress", "executor": "@nrwl/cypress:cypress",
"options": { "options": {
"cypressConfig": "apps/stats-e2e/cypress.json", "cypressConfig": "apps/stats-e2e/cypress.config.js",
"devServerTarget": "stats:serve" "devServerTarget": "stats:serve"
}, },
"configurations": { "configurations": {

View File

@ -0,0 +1,17 @@
const { defineConfig } = require('cypress');
module.exports = defineConfig({
projectId: 'et4snf',
e2e: {
baseUrl: 'http://localhost:4210',
fileServerFolder: '.',
fixturesFolder: false,
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
modifyObstructiveCode: false,
supportFile: './src/support/index.ts',
video: true,
videosFolder: '../../dist/cypress/apps/explorer-e2e/videos',
screenshotsFolder: '../../dist/cypress/apps/explorer-e2e/screenshots',
chromeWebSecurity: false,
},
});

View File

@ -1,14 +0,0 @@
{
"baseUrl": "http://localhost:4210",
"projectId": "et4snf",
"fileServerFolder": ".",
"fixturesFolder": "./src/fixtures",
"integrationFolder": "./src/integration",
"modifyObstructiveCode": false,
"supportFile": "./src/support/index.ts",
"pluginsFile": false,
"video": true,
"videosFolder": "../../dist/cypress/apps/token-e2e/videos",
"screenshotsFolder": "../../dist/cypress/apps/token-e2e/screenshots",
"chromeWebSecurity": false
}

View File

@ -6,7 +6,7 @@
"e2e": { "e2e": {
"executor": "@nrwl/cypress:cypress", "executor": "@nrwl/cypress:cypress",
"options": { "options": {
"cypressConfig": "apps/token-e2e/cypress.json", "cypressConfig": "apps/token-e2e/cypress.config.js",
"devServerTarget": "token:serve" "devServerTarget": "token:serve"
}, },
"configurations": { "configurations": {

View File

@ -1,6 +1,6 @@
import navigation from '../../locators/navigation.locators'; import navigation from '../locators/navigation.locators';
import home from '../../locators/home.locators'; import home from '../locators/home.locators';
import vegaToken from '../../data/vegaToken.json'; import vegaToken from '../data/vegaToken.json';
context('Home Page - verify elements on page', function () { context('Home Page - verify elements on page', function () {
before('visit token home page', function () { before('visit token home page', function () {

View File

@ -0,0 +1,48 @@
const { defineConfig } = require('cypress');
module.exports = defineConfig({
component: {
baseUrl: 'http://localhost:4200',
fileServerFolder: '.',
fixturesFolder: false,
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
supportFile: './src/support/index.ts',
video: true,
videosFolder: '../../dist/cypress/apps/trading-e2e/videos',
screenshotsFolder: '../../dist/cypress/apps/trading-e2e/screenshots',
chromeWebSecurity: false,
projectId: 'et4snf',
defaultCommandTimeout: 10000,
},
e2e: {
baseUrl: 'http://localhost:4200',
fileServerFolder: '.',
fixturesFolder: false,
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
supportFile: './src/support/index.ts',
video: true,
videosFolder: '../../dist/cypress/apps/trading-e2e/videos',
screenshotsFolder: '../../dist/cypress/apps/trading-e2e/screenshots',
chromeWebSecurity: false,
projectId: 'et4snf',
defaultCommandTimeout: 10000,
},
env: {
TRADING_TEST_VEGA_WALLET_NAME: 'UI_Trading_Test',
ETHEREUM_PROVIDER_URL:
'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
VEGA_PUBLIC_KEY:
'47836c253520d2661bf5bed6339c0de08fd02cf5d4db0efee3b4373f20c7d278',
VEGA_PUBLIC_KEY2:
'1a18cdcaaa4f44a57b35a4e9b77e0701c17a476f2b407620f8c17371740cf2e4',
TRUNCATED_VEGA_PUBLIC_KEY: '47836c…c7d278',
TRUNCATED_VEGA_PUBLIC_KEY2: '1a18cd…0cf2e4',
ETHEREUM_WALLET_ADDRESS: '0x265Cc6d39a1B53d0d92068443009eE7410807158',
ETHERSCAN_URL: 'https://ropsten.etherscan.io',
tsConfig: 'tsconfig.json',
TAGS: 'not @todo and not @ignore and not @manual',
TRADING_TEST_VEGA_WALLET_PASSPHRASE: '123',
ETH_WALLET_MNEMONIC:
'ugly gallery notice network true range brave clarify flat logic someone chunk',
},
});

View File

@ -1,31 +0,0 @@
{
"baseUrl": "http://localhost:4200",
"fileServerFolder": ".",
"fixturesFolder": false,
"pluginsFile": "./src/plugins/index.js",
"testFiles": "*.{ts,feature,features}",
"ignoreTestFiles": "**/*.js",
"integrationFolder": "./src/integration",
"modifyObstructiveCode": false,
"supportFile": "./src/support/index.ts",
"video": true,
"videosFolder": "../../dist/cypress/apps/trading-e2e/videos",
"screenshotsFolder": "../../dist/cypress/apps/trading-e2e/screenshots",
"chromeWebSecurity": false,
"projectId": "et4snf",
"defaultCommandTimeout": 10000,
"env": {
"TRADING_TEST_VEGA_WALLET_NAME": "UI_Trading_Test",
"ETHEREUM_PROVIDER_URL": "https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8",
"VEGA_PUBLIC_KEY": "47836c253520d2661bf5bed6339c0de08fd02cf5d4db0efee3b4373f20c7d278",
"VEGA_PUBLIC_KEY2": "1a18cdcaaa4f44a57b35a4e9b77e0701c17a476f2b407620f8c17371740cf2e4",
"TRUNCATED_VEGA_PUBLIC_KEY": "47836c…c7d278",
"TRUNCATED_VEGA_PUBLIC_KEY2": "1a18cd…0cf2e4",
"ETHEREUM_WALLET_ADDRESS": "0x265Cc6d39a1B53d0d92068443009eE7410807158",
"ETHERSCAN_URL": "https://ropsten.etherscan.io",
"tsConfig": "tsconfig.json",
"TAGS": "not @todo and not @ignore and not @manual",
"TRADING_TEST_VEGA_WALLET_PASSPHRASE": "123",
"ETH_WALLET_MNEMONIC": "ugly gallery notice network true range brave clarify flat logic someone chunk"
}
}

View File

@ -6,7 +6,7 @@
"e2e": { "e2e": {
"executor": "@nrwl/cypress:cypress", "executor": "@nrwl/cypress:cypress",
"options": { "options": {
"cypressConfig": "apps/trading-e2e/cypress.json", "cypressConfig": "apps/trading-e2e/cypress.config.js",
"devServerTarget": "trading:serve" "devServerTarget": "trading:serve"
}, },
"configurations": { "configurations": {

View File

@ -1,75 +0,0 @@
/// <reference types="cypress" />
const webpackPreprocessor = require('@cypress/webpack-preprocessor');
const webpack = require('webpack');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const nodeExternals = require('webpack-node-externals');
/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
on(
'file:preprocessor',
webpackPreprocessor({
webpackOptions: {
resolve: {
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx'],
plugins: [
new TsconfigPathsPlugin({
configFile: config.env.tsConfig,
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx'],
}),
],
fallback: {
path: require.resolve('path-browserify'),
},
},
module: {
rules: [
{
test: /\.([jt])sx?$/,
loader: 'ts-loader',
exclude: [/node_modules/],
options: {
configFile: config.env.tsConfig,
// https://github.com/TypeStrong/ts-loader/pull/685
experimentalWatchApi: true,
transpileOnly: true,
},
},
{
test: /\.feature$/,
use: [
{
loader: 'cypress-cucumber-preprocessor/loader',
},
],
},
{
test: /\.features$/,
use: [
{
loader: 'cypress-cucumber-preprocessor/lib/featuresLoader',
},
],
},
],
},
plugins: [
new ForkTsCheckerWebpackPlugin({
typescript: {
enabled: true,
configFile: config.env.tsConfig,
},
}),
new webpack.ProvidePlugin({
process: 'process/browser',
}),
],
externals: [nodeExternals()],
},
})
);
};

View File

@ -30,8 +30,8 @@
"@sentry/nextjs": "^6.19.3", "@sentry/nextjs": "^6.19.3",
"@sentry/react": "^6.19.2", "@sentry/react": "^6.19.2",
"@sentry/tracing": "^6.19.2", "@sentry/tracing": "^6.19.2",
"@vegaprotocol/vegawallet-service-api-client": "^0.4.13",
"@testing-library/user-event": "^14.2.1", "@testing-library/user-event": "^14.2.1",
"@vegaprotocol/vegawallet-service-api-client": "^0.4.13",
"@walletconnect/ethereum-provider": "^1.7.5", "@walletconnect/ethereum-provider": "^1.7.5",
"@web3-react/core": "8.0.20-beta.0", "@web3-react/core": "8.0.20-beta.0",
"@web3-react/metamask": "8.0.16-beta.0", "@web3-react/metamask": "8.0.16-beta.0",
@ -127,7 +127,7 @@
"@typescript-eslint/parser": "5.18.0", "@typescript-eslint/parser": "5.18.0",
"babel-jest": "27.2.3", "babel-jest": "27.2.3",
"babel-loader": "8.1.0", "babel-loader": "8.1.0",
"cypress": "^9.5.4", "cypress": "^10.2.0",
"cypress-cucumber-preprocessor": "^4.3.1", "cypress-cucumber-preprocessor": "^4.3.1",
"dotenv": "^16.0.1", "dotenv": "^16.0.1",
"eslint": "8.12.0", "eslint": "8.12.0",

View File

@ -10625,10 +10625,10 @@ cypress-cucumber-preprocessor@^4.3.1:
minimist "^1.2.5" minimist "^1.2.5"
through "^2.3.8" through "^2.3.8"
cypress@^9.5.4: cypress@^10.2.0:
version "9.5.4" version "10.2.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.5.4.tgz#49d9272f62eba12f2314faf29c2a865610e87550" resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.2.0.tgz#ca078abfceb13be2a33cbba6e0e80ded770f542a"
integrity sha512-6AyJAD8phe7IMvOL4oBsI9puRNOWxZjl8z1lgixJMcgJ85JJmyKeP6uqNA0dI1z14lmJ7Qklf2MOgP/xdAqJ/Q== integrity sha512-+i9lY5ENlfi2mJwsggzR+XASOIgMd7S/Gd3/13NCpv596n3YSplMAueBTIxNLcxDpTcIksp+9pM3UaDrJDpFqA==
dependencies: dependencies:
"@cypress/request" "^2.88.10" "@cypress/request" "^2.88.10"
"@cypress/xvfb" "^1.2.4" "@cypress/xvfb" "^1.2.4"