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

This commit is contained in:
Ramon Wenger 2022-09-29 14:50:42 +02:00
commit bd458c423a
7 changed files with 113 additions and 25989 deletions

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

@ -1,15 +0,0 @@
{
"baseUrl": "http://localhost:8080",
"videoUploadOnPasses": false,
"reporter": "junit",
"reporterOptions": {
"mochaFile": "cypress/test-reports/frontend/cypress-results-[hash].xml",
"toConsole": true
},
"projectId": "msk-fe",
"integrationFolder": "cypress/integration/frontend",
"$schema": "https://on.cypress.io/cypress.schema.json",
"retries": {
"runMode": 2
}
}

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');
});
// 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) => {
if (oldPassword) {

View File

@ -1,26 +0,0 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands';
// Alternatively you can use CommonJS syntax:
// require('./commands')
// from https://stackoverflow.com/questions/49079005/how-to-stub-a-call-to-graphql-using-cypress#49088084
// Cypress.on('window:before:load', win => {
// win.fetch = null;
// win.Blob = null;
// });

25994
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,10 +15,10 @@
"open:cypress:frontend": "npm run cypress:frontend:open",
"test:cypress:e2e": "npm run cypress:e2e:test",
"test:cypress:frontend": "npm run cypress:frontend:test",
"cypress:e2e:open": "cypress open --config-file cypress.e2e.json",
"cypress:frontend:open": "cypress open --config-file cypress.frontend.json",
"cypress:e2e:test": "cypress run --config-file cypress.e2e.json",
"cypress:frontend:test": "cypress run --config-file cypress.frontend.json",
"cypress:e2e:open": "cypress open --config-file cypress.e2e.ts",
"cypress:frontend:open": "cypress open --config-file cypress.frontend.ts",
"cypress:e2e:test": "cypress run --config-file cypress.e2e.ts",
"cypress:frontend:test": "cypress run --config-file cypress.frontend.ts",
"install:cypress": "cypress install",
"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",
@ -62,7 +62,7 @@
"css-loader": "^0.28.0",
"css-minimizer-webpack-plugin": "^3.4.1",
"cy2": "^1.2.1",
"cypress": "^9.5.0",
"cypress": "^10",
"dayjs": "^1.10.7",
"debounce": "^1.2.0",
"eslint": "^7.32.0",