Skip to content

Error: Unexpected state in testStepFinishedHandler: step-started & step-finished. Because this error occurred during a after each hook we are skipping the remaining tests in the current suite #1313

@vishnula-risk

Description

@vishnula-risk

Current behavior

When trying to use @badeball/cypress-cucumber-preprocessor alongside other Cypress plugins that register event handlers, the event handlers appear to conflict, resulting in only the last registered handler being executed. Despite following the event-handlers documentation and attempting the recommended workarounds (including cypress-on-fix), the issue still persists.

Browser: Electron 130 (Headless)

Other relevant plugins and versions:

  • @cypress/webpack-preprocessor: 6.0.4
  • webpack: 5.101.0
  • typescript: ^5.5.4
  • cypress-file-upload: ^5.0.8
  • cypress-io/github-action: v6

Desired behavior

When running Cypress tests with @badeball/cypress-cucumber-preprocessor in our GitHub Actions CI/CD pipeline, all registered event handlers should execute without conflicts, ensuring that HTML reports are successfully generated at cypress/report/report.html and screenshots are captured at src/cypress/cypress/report/screenshots for artifact upload. The cypress-on-fix workaround should allow multiple plugins to coexist properly, preventing event handler overwrites that currently cause missing reports and artifacts in our automated test runs.

Cypress version

14.5.4

Preprocessor version

22.2.0

Node version

20.19.4

Operating system

Ubuntu Latest (GitHub Actions runner) / Linux (self-hosted runner)

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions