badeball / cypress-cucumber-preprocessor

Run cucumber/gherkin-syntaxed specs with Cypress
MIT License
1.32k stars 147 forks source link

Allure result is failed to be generated when use allure-cypress #1182

Closed dimas-rymera closed 5 months ago

dimas-rymera commented 5 months ago

Current behavior

Use cypress cucumber and allure cypress https://allurereport.org/docs/cypress/ to make the allure-results JSON files failed to be generated when run npx cypress run via terminal

Desired behavior

allure-results JSON should be generated after the test is done

Test code to reproduce

  1. Install Cypress 13.x
  2. install and use cucumber for cypress @badeball/cypress-cucumber-preprocessor
  3. Install allure plugins and set it up const { defineConfig } = require("cypress"); const { allureCypress } = require("allure-cypress/reporter"); const createBundler = require('@bahmutov/cypress-esbuild-preprocessor'); const preprocessor = require('@badeball/cypress-cucumber-preprocessor'); const createEsbuildPlugin = require('@badeball/cypress-cucumber-preprocessor/esbuild');
async function setupNodeEvents(on, config) {
  allureCypress(on);

  await preprocessor.addCucumberPreprocessorPlugin(on, config);
  on(
    'file:preprocessor',
    createBundler({
      plugins: [createEsbuildPlugin.default(config)],
    })
  );

  return config;
}

module.exports = defineConfig({
  e2e: {
    setupNodeEvents
  },
});
  1. via terminal exec npx cypress run

Versions

Checklist

badeball commented 5 months ago

This is answered in the FAQ.