typescripttestingautomationcypressallure

Cypress Allure Report Created but allure-results Folder Not Generated


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. Pre-requisites

cypress.config.ts

import { defineConfig } from "cypress";
import allureWriter from "@shelex/cypress-allure-plugin/writer"

export default defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
    allureWriter(on, config);
    //require('@shelex/cypress-allure-plugin/writer')(on, config);
      return config;
    },
    baseUrl: "http://localhost:3000",
    specPattern: "cypress/e2e/**/*.cy.ts",
    supportFile: 'cypress/support/index.ts',
    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);
    });
  });

package.json

    "@shelex/cypress-allure-plugin": "^2.40.2",
    "allure-commandline": "^2.29.0",
    "cypress": "^13.13.1",
    "cypress-mochawesome-reporter": "^3.8.2"  
 },   "dependencies": {
    "typescript": "^5.5.4"  
 }

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:

Troubleshooting Steps Taken:

NOTE:

Any help would be greatly appreciated!


Solution

  • The @shelex/cypress-allure-plugin supports only Cypress versions before v12.14.0.

    For newer versions of Cypress, please consider switching to the official Allure Cypress module: allure-cypress.

    The documentation can be found on the Allure Report website: https://allurereport.org/docs/cypress/