如何在黄瓜中运行前提条件和前提条件测试方法?
示例
功能文件。
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 红包祝福语简短10字
18 周六早晨祝福语简短