假设我有这样一个测试用例 -
*Scenario: Facebook login test
GIVEN I am a Facebook user
WHEN I enter my user name & password
THEN login should be successful*
我该如何从与“我是Facebook用户”、“我输入我的用户名和密码”或“登录应该成功”相对应的步骤定义方法中获取场景名称?
步骤定义方法为 -
@Given("^I am a Facebook user$")
public void method1() {
//some coding
//I want to get the scenario name here
}
@When("^I enter my user name & password$")
public void method2() {
//some coding
//I want to get the scenario name here
}
@Then("^login should be successful$")
public void method3() {
//some coding
//I want to get the scenario name here
}