Skip to content

Cypress is not defined error with @shelex/cypress-allure-plugin reporter (Cypress 13.x/15.x, Allure 2.29.0+) #243

@Nesay-hub

Description

@Nesay-hub

Description:
I am unable to use the @shelex/cypress-allure-plugin reporter with Cypress. I have tried multiple versions (Cypress 13.17.0, 15.4.0 and Allure plugin 2.29.0, 2.41.2, latest), but always get the following error when running npx cypress run:

Steps to Reproduce:

  1. Install Cypress and @shelex/cypress-allure-plugin (tried multiple versions).
  2. Use the following config in
    const { defineConfig } = require('cypress');
    const allureWriter = require('@shelex/cypress-allure-plugin/writer');
    module.exports = defineConfig({
    e2e: {
    setupNodeEvents(on, config) {
    allureWriter(on, config);
    return config;
    },
    specPattern: 'cypress/e2e/**/*.cy.js',
    supportFile: 'cypress/support/e2e.js',
    },
    reporter: '@shelex/cypress-allure-plugin',
    reporterOptions: { resultsDir: 'allure-results' },
    });
  3. Add import '@shelex/cypress-allure-plugin'; to e2e.js.
  4. Run npx cypress run.

Expected:
Cypress runs and generates Allure results.

Actual:
Fails with "Cypress is not defined" error.

Environment:

OS: Windows 11
Cypress: 13.17.0, 15.4.0 (tried both)
@shelex/cypress-allure-plugin: 2.29.0, 2.41.2, latest (tried all)
Node.js: [your version]
Additional Info:

Works if I comment out the reporter in config.
Tried clearing cache, reinstalling, and all known workarounds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions