configuration

This commit is contained in:
mahula 2024-02-19 13:33:22 +01:00
parent 879fab62dc
commit 681e2d2915
4 changed files with 18 additions and 47 deletions

View File

@ -1,27 +1,11 @@
import { defineConfig } from "cypress"; import { defineConfig } from 'cypress'
import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor'; import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor'
import webpack from '@cypress/webpack-preprocessor'; import webpack from '@cypress/webpack-preprocessor'
// async function setupNodeEvents(
// on: Cypress.PluginEvents,
// config: Cypress.PluginConfigOptions
// ): Promise<Cypress.PluginConfigOptions> {
// await addCucumberPreprocessorPlugin(on, config);
// on(
// "file:preprocessor",
// preprocessor(config, {
// typescript: require.resolve("typescript"),
// })
// );
// return config;
// }
const setupNodeEvents = async (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => { const setupNodeEvents = async (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => {
await addCucumberPreprocessorPlugin(on, config, { await addCucumberPreprocessorPlugin(on, config, {
omitAfterRunHandler: true, omitAfterRunHandler: true,
}); })
on( on(
'file:preprocessor', 'file:preprocessor',
webpack({ webpack({
@ -53,22 +37,19 @@ const setupNodeEvents = async (on: Cypress.PluginEvents, config: Cypress.PluginC
}, },
}, },
}), }),
); )
return config; return config;
}; }
export default defineConfig({ export default defineConfig({
e2e: { e2e: {
defaultCommandTimeout: 60000,
pageLoadTimeout:180000,
chromeWebSecurity: false, chromeWebSecurity: false,
baseUrl: "http://localhost:3000", baseUrl: 'https://the-internet.herokuapp.com/',
specPattern: "cypress/e2e/**/*.feature", specPattern: 'cypress/e2e/features/*.feature',
supportFile: "cypress/support/e2e.ts", supportFile: false,
retries: 0, retries: 0,
video: false, video: false,
setupNodeEvents, setupNodeEvents,
experimentalInteractiveRunEvents: true,
} }
}); })

View File

@ -1,15 +0,0 @@
// ***********************************************************
// This example support/e2e.ts 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/commands'

View File

@ -2,7 +2,12 @@
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"lib": ["es5", "dom"], "lib": ["es5", "dom"],
"types": ["cypress", "node"] "types": ["cypress", "node"],
"paths": {
"#pages/*": [
"../pages/*.ts"
]
},
}, },
"include": ["**/*.ts"] "include": ["./**/*.ts"]
} }

View File

@ -24,7 +24,7 @@
"author": "mahula", "author": "mahula",
"license": "Apache-2.0", "license": "Apache-2.0",
"scripts": { "scripts": {
"cypress:open": "cypress open", "cypress:open": "cypress open --e2e --browser electron",
"cypress:run": "cypress run" "cypress:run": "cypress run"
}, },
"devDependencies": { "devDependencies": {