mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
set up cypress to utilize cucumber and for tests in typescript
This commit is contained in:
parent
37c6a36a7a
commit
153b2a2c4e
43
e2e-tests/cypress/tests/cypress.config.ts
Normal file
43
e2e-tests/cypress/tests/cypress.config.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import { defineConfig } from "cypress";
|
||||||
|
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
|
||||||
|
import browserify from "@badeball/cypress-cucumber-preprocessor/browserify";
|
||||||
|
|
||||||
|
async function setupNodeEvents(
|
||||||
|
on: Cypress.PluginEvents,
|
||||||
|
config: Cypress.PluginConfigOptions
|
||||||
|
): Promise<Cypress.PluginConfigOptions> {
|
||||||
|
await addCucumberPreprocessorPlugin(on, config);
|
||||||
|
|
||||||
|
on(
|
||||||
|
"file:preprocessor",
|
||||||
|
browserify(config, {
|
||||||
|
typescript: require.resolve("typescript"),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
on('after:run', (results) => {
|
||||||
|
if (results) {
|
||||||
|
// results will be undefined in interactive mode
|
||||||
|
console.log(results.status)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
e2e: {
|
||||||
|
specPattern: "**/*.feature",
|
||||||
|
excludeSpecPattern: "*.js",
|
||||||
|
baseUrl: 'http://localhost:3000',
|
||||||
|
chromeWebSecurity: false,
|
||||||
|
supportFile: false,
|
||||||
|
viewportHeight: 720,
|
||||||
|
viewportWidth: 1280,
|
||||||
|
retries: {
|
||||||
|
runMode: 2,
|
||||||
|
openMode: 0
|
||||||
|
},
|
||||||
|
setupNodeEvents
|
||||||
|
}
|
||||||
|
})
|
||||||
@ -7,12 +7,21 @@
|
|||||||
"author": "Mathias Lenz",
|
"author": "Mathias Lenz",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
|
"cypress-cucumber-preprocessor": {
|
||||||
|
"nonGlobalStepDefinitions": true,
|
||||||
|
"json": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"cypress-e2e-tests": "yarn run cypress run",
|
"cypress-e2e-tests": "yarn run cypress run -e \"TAGS=not @skip\"",
|
||||||
"lint": "eslint --max-warnings=0 --ext .js,.ts ."
|
"lint": "eslint --max-warnings=0 --ext .js,.ts ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cypress": "^10.3.0",
|
"@badeball/cypress-cucumber-preprocessor": "^12.0.0",
|
||||||
"eslint": "^8.19.0"
|
"@cypress/browserify-preprocessor": "^3.0.2",
|
||||||
|
"cypress": "^10.4.0",
|
||||||
|
"eslint": "^8.19.0",
|
||||||
|
"typescript": "^4.7.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
e2e-tests/cypress/tests/tsconfig.json
Normal file
10
e2e-tests/cypress/tests/tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es2016",
|
||||||
|
"lib": ["es6", "dom"],
|
||||||
|
"baseUrl": "../node_modules",
|
||||||
|
"types": ["cypress", "node"],
|
||||||
|
"strict": true
|
||||||
|
},
|
||||||
|
"include": ["**/*.ts"]
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user