我正在尝试在 "Scenario Outline" 下的 "Examples" 中处理当前行数。如何在步骤定义中获取当前行数?我不想在示例中传递数字。有什么办法吗?
Scenario Outline:
When the name is entered as "<fruit>" <days>
Examples:
|fruit|days|
|Apple|10|
|Orange|12|
|Guava|3|
...
在步骤定义中,我希望将行处理为 1,2,3,...(代替 XXXXX)。
@When("^the name is entered as \"([^\"]*)\" ([^\"]*)$")
public void the_name_is_entered_as(String fruitName, int days) throws Throwable {
System.out.println("Current Row processsed is: "+XXXXXXX)
}