I have one test project with 2 features, when I try to execute my test with:
npx cypress run --browser edge --headed
Only the first feature is executed in the "inprivate" mode, the second one is executed in normal mode.
My file tsconfig.json:
const { defineConfig } = require("cypress");
import createBundler from "@bahmutov/cypress-esbuild-preprocessor";
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
import createEsbuildPlugin from "@badeball/cypress-cucumber-preprocessor/esbuild";
module.exports = defineConfig({
e2e: {
specPattern: "**/*.feature",
async setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Promise<Cypress.PluginConfigOptions> {
await addCucumberPreprocessorPlugin(on, config);
on(
"file:preprocessor",
createBundler({
plugins: [createEsbuildPlugin(config)],
})
);
on('before:browser:launch', (browser = {}, launchOptions) => {
// `args` is an array of all the arguments that will
// be passed to browsers when it launches
console.log(launchOptions.args) // print all current args
if (browser.name === 'edge') {
// open in incognito
launchOptions.args.push('--inprivate')
}
if (browser.family === 'chromium' && browser.name !== 'electron') {
launchOptions.args.push("--incognito");
}
// whatever you return here becomes the launchOptions
return launchOptions
})
return config;
},
},
experimentalModifyObstructiveThirdPartyCode: true,
chromeWebSecurity: true,
});
Hi, I am working with the following versions:
I have one test project with 2 features, when I try to execute my test with:
npx cypress run --browser edge --headed
Only the first feature is executed in the "inprivate" mode, the second one is executed in normal mode.
My file tsconfig.json:
Do you know what is the problem?? Thanks