I’m trying to integrate Allure reports with Cypress in my project. The Allure report is being created, but the allure-results folder is not being generated. Below are the steps I’ve taken and the configuration I’ve set up.
cypress.config.ts
const { defineConfig } = require(‘cypress’);
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
require('@shelex/cypress-allure-plugin/writer')(on, config);
return config;
},
specPattern: 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
reporter: 'cypress-mochawesome-reporter',
reporterOptions: {
reportDir: 'cypress/reports',
overwrite: false,
html: false,
json: true,
},
env: {
allureReuseAfterSpec: true,
},
},
});
cypress/support/index.ts
import '.';
import './commands';
import '@shelex/cypress-allure-plugin';
My test file sample, cypress/e2e/sample_test.cy.ts
describe('Sample Test', () => {
it('should pass', () => {
expect(true).to.equal(true);
});
});
Run Cypress tests using:
npx cypress run
or
npx cypress run --env allure=true —spec cypress/e2e/test/sample_test.cy.ts --browser electron --headed
Issues:
- The Allure report is created, but the allure-results folder is not generated.
- There are no specific error messages indicating why the folder is not being created.
Troubleshooting Steps Taken:
- Verified Plugin Integration:
- Ensured the Allure plugin is properly integrated into cypress.config.ts and imported in cypress/support/index.ts.
- Re-checked Configuration Files:
- Confirmed the setup is correct as shown above.
- Manually Created Allure Results Directory:
- Tried creating the allure-results folder manually, but it remains empty.
Any help would be greatly appreciated!
prabhakar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.