This commit is contained in:
tidusjar 2022-12-02 16:26:03 +00:00
commit 618a775eb3
7 changed files with 404 additions and 2969 deletions

View file

@ -1,4 +1,7 @@
import { defineConfig } from 'cypress'
import { defineConfig } from 'cypress';
import createBundler from "@bahmutov/cypress-esbuild-preprocessor";
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
import createEsbuildPlugin from "@badeball/cypress-cucumber-preprocessor/esbuild";
export default defineConfig({
watchForFileChanges: true,
@ -17,11 +20,25 @@ export default defineConfig({
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)
async setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Promise<Cypress.PluginConfigOptions> {
await addCucumberPreprocessorPlugin(on, config);
on(
"file:preprocessor",
createBundler({
plugins: [createEsbuildPlugin(config)],
})
);
// Make sure to return the config object as it might have been modified by the plugin.
return config;
// return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'http://localhost:5000',
specPattern: 'cypress/tests/**/*.spec.ts*',
baseUrl: 'http://localhost:3577',
specPattern: ['cypress/tests/**/*.spec.ts*', '**/*.feature'],
excludeSpecPattern: ['**/snapshots/*'],
},
})