diff --git a/cypress.config.ts b/cypress.config.ts index 5db7fe24..9a669680 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,5 +1,24 @@ +import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor' +import { createEsbuildPlugin } from '@badeball/cypress-cucumber-preprocessor/esbuild' +import createBundler from '@bahmutov/cypress-esbuild-preprocessor' import { defineConfig } from 'cypress' +async function setupNodeEvents( + on: Cypress.PluginEvents, + config: Cypress.PluginConfigOptions, +): Promise { + await addCucumberPreprocessorPlugin(on, config) + + on( + 'file:preprocessor', + createBundler({ + plugins: [createEsbuildPlugin(config)], + }), + ) + + return config +} + export default defineConfig({ component: { devServer: { @@ -8,4 +27,12 @@ export default defineConfig({ }, specPattern: ['**/**/*.cy.{ts,tsx}'], }, + e2e: { + chromeWebSecurity: false, + retries: 0, + specPattern: 'features/**/*.feature', + supportFile: false, + video: false, + setupNodeEvents, + }, })