You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing a e2e test case with cypress for angular application, i am not able to find proper documentation for cypress code coverage for angular, i can able to do with react, but facing issues in angular18. any additional configuration need to do ,
could you please update cypress code coverage much more clearer for technology wise in the documentation,
here is cypress config.ts
import{defineConfig}from'cypress';import{addCucumberPreprocessorPlugin}from'@badeball/cypress-cucumber-preprocessor';importcreateBundlerfrom'@bahmutov/cypress-esbuild-preprocessor';import{createEsbuildPlugin}from'@badeball/cypress-cucumber-preprocessor/esbuild';importcodeCoverageTaskfrom'@cypress/code-coverage/task';importregisterCodeCoverageTasksfrom'@cypress/code-coverage/task';exportdefaultdefineConfig({e2e: {specPattern: 'cypress/e2e/**/*.feature',supportFile: 'cypress/support/e2e.ts',asyncsetupNodeEvents(on: Cypress.PluginEvents,config: Cypress.PluginConfigOptions){awaitaddCucumberPreprocessorPlugin(on,config);on('file:preprocessor',createBundler({plugins: [createEsbuildPlugin(config)],}));// Register code coverage taskcodeCoverageTask(on,config);// Ensure coverage is enabledconfig.env.coverage=true;config.instrument=true;config.experimentalSourceRewriting=true;returnconfig;// require('@cypress/code-coverage/task')(on, config)// registerCodeCoverageTasks(on, config);// return config;// codeCoverageTask(on, config);// Use type assertion for config.env// (config.env as any).coverage = true;// (config.env as any).codeCoverage = true;// (config.env as any).codeCoverageTasksRegistered = true;// return config;},baseUrl: 'http://localhost:4700',},component: {devServer: {framework: 'angular',bundler: 'webpack',},specPattern: '**/*.ts',},env: {coverage: true,disableGpu: true,codeCoverage: true,codeCoverageTasksRegistered: true,},experimentalSourceRewriting: true,});
tried both
and babel.config.json or .babelrc
{
"presets": ["@babel/preset-env", "@babel/preset-typescript"],
"plugins": ["babel-plugin-istanbul"]
//"plugins": ["istanbul"]
}
i can able to generate cucumber report but cypress not instrumenting
added in plugin index.ts file
const codeCoverageTask = require('@cypress/code-coverage/task');
module.exports = (on:any, config:any) => {
codeCoverageTask(on, config);
return config;
};
I am writing a e2e test case with cypress for angular application, i am not able to find proper documentation for cypress code coverage for angular, i can able to do with react, but facing issues in angular18. any additional configuration need to do ,
enable source map in angular json.
versions:
cypress@13.15.0
node version:18.20.2
"@cypress/code-coverage": "^3.12.48",
angular 17 ,18 tested
could you please update cypress code coverage much more clearer for technology wise in the documentation,
here is cypress config.ts
tried both
nycrc
nothing working could you please help me on this ,struggling here for two weeks.
code coverage report generated with no coverage.
i want both reports cucumber and cypress .cucumber can able to generate , but cypress not instrumenting
The text was updated successfully, but these errors were encountered: