Support for nested steps
See original GitHub issueIn eg. cucumber-ruby
, one has the ability to invoke steps from step definitions, as shown here. It would be super cool to have this support in cypress-cucumber-preprocessor
as well.
Right now, I’ve solved it using resolveAndRunStepDefinition
, but I realize that this isn’t part of the official API.
Feature: some feature
Scenario: some scenario
When within "some section" I fill in "foo" for "bar"
const { When } = require("cypress-cucumber-preprocessor/steps");
const { resolveAndRunStepDefinition } = require("cypress-cucumber-preprocessor/lib/resolveStepDefinition");
When("within {string} {}", (section, subExpression) => {
cy.contains("section", section).within(() => {
resolveAndRunStepDefinition({
keyword: "When",
text: subExpression
});
});
});
When("I fill in {string} for {string}", (text, label) => {
cy.get(`input[label='${label}']`)
.type(text);
});
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Support for nested steps · Issue #170 - GitHub
In eg. cucumber-ruby , one has the ability to invoke steps from step definitions, as shown here. It would be super cool to...
Read more >AWS Step Functions Adds Support for Nested Workflows
Step Functions lets you coordinate multiple AWS services in fully-managed workflows so you can build and update apps quickly.
Read more >Nested Steps - Defining steps - Cucumber - Relish
Nested Steps · Use #steps to call several steps at once · Use #step to call a single step · Use #steps to...
Read more >Expanding nested steps on execution - Google Groups
I really dig Cucumber's support for building complex steps out of simpler ones, but sometimes I wish there was an option to "expand"...
Read more >nested-steps - npm
Start using nested-steps in your project by running `npm i nested-steps`. There are no other projects in the npm registry using nested-steps.
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
In my case, we don’t contain the to-be-called-step in feature line, so I wrote a function using the workaround @badeball provided:
then call it in step_definition file
it worked perfectly, thanks to this workaround.
@badeball reported to them