Unable to use fixture with cucumber plugin
See original GitHub issueHi @lgandecki and all,
I am unable to use fixtures inside When,And
etc. It is showing me an error : TypeError: Cannot read property 'data' of undefined
Below is the code snippet:
Below is the test runner execution error:
Issue Analytics
- State:
- Created 4 years ago
- Comments:9
Top Results From Across the Web
Unable to use fixture with cucumber plugin · Issue #317 - GitHub
Hi @lgandecki and all, I am unable to use fixtures inside When,And etc. It is showing me an error : TypeError: Cannot read...
Read more >Cypress cucumber with custom directory structure
I need to support a custom directory structure on my project that uses Cypress for testing. As I am using cucumber preprocessor plugin...
Read more >Plugins - Cypress Documentation
Plugins provide a way to support and extend the behavior of Cypress. Follow these instructions to ... Run cucumber/gherkin-syntaxed specs with cypress.io.
Read more >Using Cypress with Cucumber to test your app as if you were ...
Cucumber is a test framework for BDD. By using the Gherkin language, it allows you to write tests that look like natural language....
Read more >How to set up Cucumber BDD Automation Framework in ...
The first file (shown by marker 1) is the "index. js" file under the plugins folder. We need to make the following changes...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @lgandecki It worked thank you for the help but after removing mocha import it was still not working
Then I changed my below style of code
Given(‘I import fixture’, () => { cy.log(this.data.AnimalGroupNo) })
To your given style of code :
Given(‘I import fixture’, function () { cy.log(this.data.AnimalGroupNo) })
then it worked.
Thank you for the help 😃
this worked for me:
don’t import anything from mocha, and make sure you use function callbacks, you have it explained here:
https://docs.cypress.io/api/commands/fixture.html#Encoding