Skip to content

Dynamic step invocation from another step #2662

@zeldigas

Description

@zeldigas

🤔 What's the problem you're trying to solve?

I'd like to have ability to dynamically invoke some step by name when executing another step:

When(/.../, async function() {
  await this.invokeStep("Some step");
}

Previously it was possible, but latest version does not expose this method in context.

Dynamic step invocation helps to implement some special scenarios, like "try catch" behavior:

Then I expect error
  """
   When I do this
  """
And It is http error

✨ What's your proposed solution?

Expose invokeStep in step context

⛏ Have you considered any alternatives or workarounds?

I though about 2 sequential steps and some wrapper around step execution to catch error, like this:

When I expect error from next step
And I do this
Then It is http error

But so far I fail to solve function args check

📚 Any additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions