You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
step: And a message is sent with a mobile
glue: Then("a message is sent (with|without) a mobile") { withOrWithout: String =>
error message: io.cucumber.junit.UndefinedStepException: The step 'a message is sent with a mobile' is undefined.
✅ What did you expect to see?
Step should be picked and "with" or "without" should be the captured value
📦 Which tool/library version are you using?
Cucumber Scala 8.9.0
Cucumber core 7.7.0
🔬 How could we reproduce it?
Scenario: Regex capture
Given wte
And a message is sent with a mobile
and
Then("a message is sent (with|without) a mobile") { withOrWithout: String =>
assert(withOrWithout == "with"
}
the error:
2022-09-12 09:56:22.644 [error] Test SomeFeature - SomeFeature failed: io.cucumber.junit.UndefinedStepException: The step 'a message is sent with a mobile' is undefined.
2022-09-12 09:56:22.644 [error] You can implement this step using the snippet(s) below:
2022-09-12 09:56:22.644 [error]
2022-09-12 09:56:22.644 [error] Then("""a message is sent with a mobile""") { () =>
2022-09-12 09:56:22.644 [error] // Write code here that turns the phrase above into concrete actions
2022-09-12 09:56:22.644 [error] throw new io.cucumber.scala.PendingException()
2022-09-12 09:56:22.644 [error] }
2022-09-12 09:56:22.644 [error] , took 8.307 sec
The text was updated successfully, but these errors were encountered:
Indeed, in Cucumber terminology, without start and end, the string is interpreted as a "Cucumber Expression" whereas with it it's interpreted as a regular regex.
Cucumber Expression can still be used for your use case but by defining a custom type like (not tested, there might be typos):
ParameterType("withOrWithout", "(with|without)") { (str) =>
str
}
Then("a message is sent {withOrWithout} a mobile") { withOrWithout: String=>
}
👓 What did you see?
step:
And a message is sent with a mobile
glue:
Then("a message is sent (with|without) a mobile") { withOrWithout: String =>
error message:
io.cucumber.junit.UndefinedStepException: The step 'a message is sent with a mobile' is undefined.
✅ What did you expect to see?
Step should be picked and "with" or "without" should be the captured value
📦 Which tool/library version are you using?
Cucumber Scala 8.9.0
Cucumber core 7.7.0
🔬 How could we reproduce it?
and
the error:
The text was updated successfully, but these errors were encountered: