Is there a way to get the scenario name in my step definitions
See original GitHub issueHi,
I am happily using your framework but was wondering if I can get the scenario name in a step definition. I’ve used cucumberjs in the past and there I could do:
Before((scenario) => { console.log('\nscenario: ', scenario.pickle.name); });
Does the preprocessor expose the scenario name in any way to the step definitions?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Is there a way to get the scenario name in my step definitions
If the scenario doesn't have any examples, you can get the scenario name from cy.state('ctx').test.title . Otherwise the name will look like ${ ......
Read more >How to Get Step Name and Scenario Names through java ...
Hi John,. Just want to retrieve the names from feature file and log those names in my project. Could not able to register...
Read more >Step Definitions - Cucumber Documentation
Step definitions aren't linked to a particular feature file or scenario. The file, class or package name of a step definition does not...
Read more >How to Share data between steps in Cucumber using ...
To retrieve the value of the Product Name, just need to pass the Key to the getContext() method which can be accessed like...
Read more >Is it possible to get scenario inside the step in Cucumber?
I need to make screenshot inside the step on specific place. It means not on @BeforeStep nor on @AfterStep. I need to call...
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 FreeTop 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
Top GitHub Comments
Of course:
window.testState.currentScenario
This is where all your data relies.
cy.state doesn’t exist on typescript definitions. Is there any way to get the scenario name in my step definitions in ts.