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"; export default defineConfig({ e2e: { baseUrl: "http://localhost:5173", // Scenarios live in `.feature` files (Gherkin), one per // cypress/e2e/*.cy.ts spec this replaced — see cypress/e2e/README.md. // Step definitions are picked up from the preprocessor's default globs: // co-located `cypress/e2e//*.ts` for scenario-specific // steps, `cypress/support/step_definitions/*.ts` for steps shared across // features (auth, navigation, generic API mocking). specPattern: "cypress/e2e/**/*.feature", async setupNodeEvents(on, config) { // Disable GPU for headless/sandboxed environments (e.g. CI containers) // where no GPU device is available. on("before:browser:launch", (browser, launchOptions) => { if (browser.family === "chromium") { launchOptions.args.push("--disable-gpu", "--no-sandbox"); } return launchOptions; }); await addCucumberPreprocessorPlugin(on, config); on( "file:preprocessor", createBundler({ plugins: [createEsbuildPlugin(config)], }), ); return config; }, }, });