Discussion:
[Cucumber] Issues while migrating JBehave to cucumber
(too old to reply)
Muthu Pondi
2018-09-25 12:08:12 UTC
Permalink
Currently we are using JBehave with serenity for our automation.We are
trying to migrate our JBehave feature files and their implementations to
cucumber and facing the following challenges.

Issues :
1.We have multiple step names in the same step definition as shown below .
Please let me know how the below step definition can be changed as per
cucumber ?
Note : We have 300 step definitions in our project similar to this.
*JBehave Step Definition:*
*@when* <https://github.com/when>("there are no items for $transaction")
*@then* <https://github.com/then>("there are zero items for $transaction")
public void cleanEnv(String modality) throws InterruptedException{
login.cleanupEnv(modality);
}

2.We have aliases with multiple values in a step definition as given below
.Is there a way we can write same pattern in cucumber and call it from
feature file
*JBehave Step Definition Eg :*
*@when* <https://github.com/when> ( "user selects a $item item name from
the list" )
*@Aliases* <https://github.com/Aliases> ( values = {"user selects a
$itemName item name from the list with no protocol",
"user selects a $itemId which contains list with same technical setting
UID, name, population and anatomy with different checksum",
"user selects a $itemId which contains list with same technical setting UID
and checksum with different DMID",
public void selectitemNameFromItemList( String itemName) {
}

Please recommend the best way of how to migrate the above patterned step
definitions to cucumber.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mrunal Gosar
2018-10-27 15:02:15 UTC
Permalink
Following is the general way in which you can write Cucumber StepDef

@when("there are *no|zero* items for $transaction")
public void cleanEnv(String modality) throws InterruptedException{
login.cleanupEnv(modality);
}

@when ( "^user selects a $item item name from the list***" )
public void selectitemNameFromItemList( String itemName) {
}


The idea here is Cucumber does not cares what annotation you use on the
method. Also Cucumber's regex support is much more strong and flexible then
that of JBehave. Having said all of that, I am just curious to know why do
you wish to migrate from JBehave to Cucumber?
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...