如何在黄瓜中运行前提条件和前提条件测试方法?
示例
功能文件。
Feature: Transaction Table Scenario: Verify the monthly transactions Given User is on the Payment Page
步骤定义具有带有钩子@Before和@After的方法。带有钩子@Before的测试方法将作为前提条件执行,然后将运行测试方法(naviagteToPayment()方法),最后将带钩子@After的测试方法作为后置条件执行。
示例
@Before
public void method1(){
System.out.println("The precondition executed successfully");
}
@After
public void method2(){
System.out.println("The postcondition executed successfully ");
}
@Given ("^User is on payment page$")
public void navigateToPayment(){
System.out.println ("Payment screen navigation is successful");
}热门推荐
10 广西考试祝福语结婚简短
11 猪年祝福语简短小孩
12 元旦祝福语送长辈简短
13 恭喜二宝祝福语简短
14 祝福语暖心话简短
15 国庆中秋祝福语简短兄弟
16 朋友订婚的祝福语简短
17 送弟弟中秋祝福语简短
18 爱生日祝福语简短独特