Merge branch 'feature/migrate-cypress-10' into develop

This commit is contained in:
Ramon Wenger 2022-09-27 14:28:09 +02:00
commit ae9b0a4b00
48 changed files with 87 additions and 30 deletions

23
client/cypress.config.ts Normal file
View File

@ -0,0 +1,23 @@
import { defineConfig } from 'cypress'
export default defineConfig({
videoUploadOnPasses: false,
reporter: 'junit',
reporterOptions: {
mochaFile: 'cypress/test-reports/frontend/cypress-results-[hash].xml',
toConsole: true,
},
projectId: 'msk-fe',
retries: {
runMode: 2,
},
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/index.js')(on, config)
},
baseUrl: 'http://localhost:8080',
specPattern: 'cypress/integration/frontend/**/*.{js,jsx,ts,tsx}',
},
})

15
client/cypress.e2e.ts Normal file
View File

@ -0,0 +1,15 @@
import {defineConfig} from 'cypress';
export default defineConfig( {
e2e: {
"baseUrl": "http://localhost:8000",
specPattern: 'cypress/e2e/e2e/**/*.{spec,cy}.{js,ts}',
supportFile: 'cypress/support/e2e.js',
},
"videoUploadOnPasses": false,
"reporter": "junit",
"reporterOptions": {
"mochaFile": "cypress/test-reports/e2e/cypress-results-[hash].xml",
"toConsole": true
},
"projectId": "msk-ee",
});

View File

@ -0,0 +1,34 @@
import {defineConfig} from 'cypress';
import {readFileSync} from "fs";
import {resolve} from "path";
export default defineConfig({
chromeWebSecurity: false,
e2e: {
baseUrl: "http://localhost:8080",
specPattern: 'cypress/e2e/frontend/**/*.spec.{js,ts}',
supportFile: 'cypress/support/e2e.js',
setupNodeEvents(on, config) {
on('task', {
getSchema() {
return readFileSync(
resolve(__dirname, '../server/schema.graphql'),
'utf8'
);
}
});
},
},
videoUploadOnPasses: false,
reporter: "junit",
reporterOptions: {
mochaFile: "cypress/test-reports/frontend/cypress-results-[hash].xml",
toConsole: true
},
"projectId": "msk-fe",
retries: {
runMode: 3
}
});

View File

@ -89,14 +89,6 @@ Cypress.Commands.add('startGraphQLCapture', () => {
cy.route('POST', '/api/graphql/').as('graphQL'); cy.route('POST', '/api/graphql/').as('graphQL');
}); });
// from https://stackoverflow.com/questions/53814647/how-can-i-alias-specific-graphql-requests-in-cypress
Cypress.Commands.add('waitFor', operationName => {
cy.wait('@graphQL').then(({request}) => {
if (request.body.operationName !== operationName) {
return cy.waitFor(operationName);
}
});
});
Cypress.Commands.add('changePassword', (oldPassword, newPassword) => { Cypress.Commands.add('changePassword', (oldPassword, newPassword) => {
if (oldPassword) { if (oldPassword) {

View File

@ -15,10 +15,10 @@
"open:cypress:frontend": "npm run cypress:frontend:open", "open:cypress:frontend": "npm run cypress:frontend:open",
"test:cypress:e2e": "npm run cypress:e2e:test", "test:cypress:e2e": "npm run cypress:e2e:test",
"test:cypress:frontend": "npm run cypress:frontend:test", "test:cypress:frontend": "npm run cypress:frontend:test",
"cypress:e2e:open": "cypress open --config-file cypress.e2e.json", "cypress:e2e:open": "cypress open --config-file cypress.e2e.ts",
"cypress:frontend:open": "cypress open --config-file cypress.frontend.json", "cypress:frontend:open": "cypress open --config-file cypress.frontend.ts",
"cypress:e2e:test": "cypress run --config-file cypress.e2e.json", "cypress:e2e:test": "cypress run --config-file cypress.e2e.ts",
"cypress:frontend:test": "cypress run --config-file cypress.frontend.json", "cypress:frontend:test": "cypress run --config-file cypress.frontend.ts",
"install:cypress": "cypress install", "install:cypress": "cypress install",
"test:unit": "jest", "test:unit": "jest",
"cypress:parallel": "CYPRESS_API_URL=\"https://iterativ-cypress-director.herokuapp.com/\" cy2 run --parallel --record --key somekey --config-file cypress.frontend.json --ci-build-id some-id", "cypress:parallel": "CYPRESS_API_URL=\"https://iterativ-cypress-director.herokuapp.com/\" cy2 run --parallel --record --key somekey --config-file cypress.frontend.json --ci-build-id some-id",
@ -62,7 +62,7 @@
"css-loader": "^0.28.0", "css-loader": "^0.28.0",
"css-minimizer-webpack-plugin": "^3.4.1", "css-minimizer-webpack-plugin": "^3.4.1",
"cy2": "^1.2.1", "cy2": "^1.2.1",
"cypress": "^9.5.0", "cypress": "10",
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"debounce": "^1.2.0", "debounce": "^1.2.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",

View File

@ -4653,10 +4653,10 @@ cy2@^1.2.1:
js-yaml "^4.0.0" js-yaml "^4.0.0"
npm-which "^3.0.1" npm-which "^3.0.1"
cypress@^9.5.0: cypress@10:
version "9.7.0" version "10.8.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.7.0.tgz#bf55b2afd481f7a113ef5604aa8b693564b5e744" resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.8.0.tgz#12a681f2642b6f13d636bab65d5b71abdb1497a5"
integrity sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q== integrity sha512-QVse0dnLm018hgti2enKMVZR9qbIO488YGX06nH5j3Dg1isL38DwrBtyrax02CANU6y8F4EJUuyW6HJKw1jsFA==
dependencies: dependencies:
"@cypress/request" "^2.88.10" "@cypress/request" "^2.88.10"
"@cypress/xvfb" "^1.2.4" "@cypress/xvfb" "^1.2.4"
@ -4677,7 +4677,7 @@ cypress@^9.5.0:
dayjs "^1.10.4" dayjs "^1.10.4"
debug "^4.3.2" debug "^4.3.2"
enquirer "^2.3.6" enquirer "^2.3.6"
eventemitter2 "^6.4.3" eventemitter2 "6.4.7"
execa "4.1.0" execa "4.1.0"
executable "^4.1.1" executable "^4.1.1"
extract-zip "2.0.1" extract-zip "2.0.1"
@ -5571,10 +5571,10 @@ event-target-shim@^5.0.0:
resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
eventemitter2@^6.4.3: eventemitter2@6.4.7:
version "6.4.9" version "6.4.7"
resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.9.tgz#41f2750781b4230ed58827bc119d293471ecb125" resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.7.tgz#a7f6c4d7abf28a14c1ef3442f21cb306a054271d"
integrity sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg== integrity sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==
eventemitter3@^4.0.0: eventemitter3@^4.0.0:
version "4.0.7" version "4.0.7"
@ -12013,13 +12013,6 @@ survey-vue-ui@^1.9.50:
survey-core "*" survey-core "*"
vue "^2.6.12" vue "^2.6.12"
survey-vue@^1.9.2:
version "1.9.50"
resolved "https://registry.yarnpkg.com/survey-vue/-/survey-vue-1.9.50.tgz#1bce8762f1737fc05ac53dc3e25e8ac657fd2847"
integrity sha512-5QOhxvDAwGDmO87A320fl9PuVHXRH3+Dm9uxJ7iM3OrHSMYh+Pq9u+qa19pZnc3WhMyTuAEpHgJ1NIAM4KxBbg==
dependencies:
vue "^2.1.10"
svgo@^0.7.0: svgo@^0.7.0:
version "0.7.2" version "0.7.2"
resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5" resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5"
@ -12880,7 +12873,7 @@ vue@2.6.11:
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5" resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5"
integrity sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ== integrity sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ==
vue@^2.1.10, vue@^2.6.12, vue@^2.7: vue@^2.6.12, vue@^2.7:
version "2.7.10" version "2.7.10"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.7.10.tgz#ae516cc6c88e1c424754468844218fdd5e280f40" resolved "https://registry.yarnpkg.com/vue/-/vue-2.7.10.tgz#ae516cc6c88e1c424754468844218fdd5e280f40"
integrity sha512-HmFC70qarSHPXcKtW8U8fgIkF6JGvjEmDiVInTkKZP0gIlEPhlVlcJJLkdGIDiNkIeA2zJPQTWJUI4iWe+AVfg== integrity sha512-HmFC70qarSHPXcKtW8U8fgIkF6JGvjEmDiVInTkKZP0gIlEPhlVlcJJLkdGIDiNkIeA2zJPQTWJUI4iWe+AVfg==