question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failure with exception when using cypress-allure-plugin with @badeball/cypress-cucumber-preprocessor

See original GitHub issue

Describe the bug When attempting to use cypress-allure-plugin with cypress-cucumber-preprocessor an exception is thrown causing the first test to fail and cypress appears to hang. Hence no allure-results are generated

To Reproduce

Uncaught TypeError: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.

  > Cannot read properties of undefined (reading 'keyword')

When Cypress detects uncaught errors originating from your application it will automatically fail the current test.

This behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.
    at CucumberHandler.checkLinksInExamplesTable (https://duckduckgo.com/__cypress/tests?p=cypress\support\index.ts:1862:43)
    at Runner.eval (https://duckduckgo.com/__cypress/tests?p=cypress\support\index.ts:2878:39)
From previous event:
    at onNext (https://duckduckgo.com/__cypress/runner/cypress_runner.js:185685:19)
    at done (https://duckduckgo.com/__cypress/runner/cypress_runner.js:129431:5)
    at https://duckduckgo.com/__cypress/runner/cypress_runner.js:129496:11
From previous event:
    at callFn (https://duckduckgo.com/__cypress/runner/cypress_runner.js:129494:14)
    at Test.../driver/node_modules/mocha/lib/runnable.js.Runnable.run (https://duckduckgo.com/__cypress/runner/cypress_runner.js:129478:7)
    at https://duckduckgo.com/__cypress/runner/cypress_runner.js:185755:30
From previous event:
    at Object.onRunnableRun (https://duckduckgo.com/__cypress/runner/cypress_runner.js:185740:19)
    at $Cypress.action (https://duckduckgo.com/__cypress/runner/cypress_runner.js:174847:28)
    at Test.Runnable.run (https://duckduckgo.com/__cypress/runner/cypress_runner.js:183404:13)
    at Runner.../driver/node_modules/mocha/lib/runner.js.Runner.runTest (https://duckduckgo.com/__cypress/runner/cypress_runner.js:130150:10)
    at https://duckduckgo.com/__cypress/runner/cypress_runner.js:130276:12
    at next (https://duckduckgo.com/__cypress/runner/cypress_runner.js:130059:14)
    at https://duckduckgo.com/__cypress/runner/cypress_runner.js:130069:7
    at next (https://duckduckgo.com/__cypress/runner/cypress_runner.js:129971:14)
    at https://duckduckgo.com/__cypress/runner/cypress_runner.js:130037:5
    at timeslice (https://duckduckgo.com/__cypress/runner/cypress_runner.js:123963:27)

Expected behavior A successful test run with allure-results.

Test code to reproduce

badeball-cypress-cucumber-allure-issue

See README.md to see steps to duplicate

Environment (please complete the following information):

  • Cypress version: 9.6.1
  • OS: Windows 11
  • Node version: v14.17.3

Additional context I originally created an issue for cypress-cucumber-preprocessor here 714

Note this comment on the issue: https://github.com/badeball/cypress-cucumber-preprocessor/issues/714#issuecomment-1128134280

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kenzhemircommented, Jun 29, 2022

Hi!

I updated allure plugin to v2.27.0 and @badeball/cypress-cucumber-preprocessor to v11.3.1

Some tests are passing, but some don’t and I get this error message:

Unhandled rejection TypeError: Cannot read properties of undefined (reading 'id')    

at eval (domain/__cypress/tests?p=cypress/support/index.ts:4245:70)    
at Array.find (<anonymous>)    
at CucumberHandler.get currentScenario [as currentScenario] (domain/__cypress/tests?p=cypress/support/index.ts:4244:57)    
at CucumberHandler.checkLinksInExamplesTable (domain/__cypress/tests?p=cypress/support/index.ts:4303:18)    
at Runner.eval (domain/__cypress/tests?p=cypress/support/index.ts:5306:39)From previous event:    
at onNext (domain/__cypress/runner/cypress_runner.js:185716:19)    
at done (domain/__cypress/runner/cypress_runner.js:129431:5)    
at domain/__cypress/runner/cypress_runner.js:129496:11

Error points at approximately this line I think it doesn’t pass for scenarios that have Background like this:

Feature: Feature name
	Background:
		Given some user
	Scenario: Scenario name
		When ...
		Then ...

When I remove Background it works fine

If u need more details, I can search for it

Cypress version: 9.7.0 OS: Win 10, but running in WSL Node version: 16.13.2

2reactions
Shelexcommented, Jun 23, 2022

Hi @Shelex Thanks for checking the issue, Cypress v10 has breaking changes, pl provide a fix for v9 prior to V10

Hi. This issues are not related at all and will be worked out separately.

Regarding this one I see that new implementation of cucumber-preprocessor exposes different format of internal information. Thanks to @pwpatton example repo I can try to add new format support as currently I have not managed to make new preprocessor working in my js based repos for some older cypress versions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · badeball/cypress-cucumber-preprocessor - GitHub
Run cucumber/gherkin-syntaxed specs with Cypress. Contribute to badeball/cypress-cucumber-preprocessor development by creating an account on GitHub.
Read more >
Module '@badeball/cypress-cucumber-preprocessor' has no ...
I am trying to import "And" keyword from @badeball/cypress-cucumber-preprocessor so I can use it in Cypress/Cucumber, but I get this error.
Read more >
@badeball/cypress-cucumber-preprocessor - npm
This preprocessor aims to provide a developer experience and behavior similar to that of Cucumber, to Cypress. ℹ️ The repositor has recently ...
Read more >
Plugins - Cypress Documentation
Plugins provide a way to support and extend the behavior of Cypress. Follow these instructions to submit your own plugin. Looking for the...
Read more >
Cypress Cucumber via Cucumber JSON report - AIO Tests
For the current example we would be using webpack. Sample package.json dependencies. 1"dependencies": { 2 "@badeball/cypress-cucumber-preprocessor": ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found