如何在黄瓜中运行前提条件和前提条件测试方法?
示例
功能文件。
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 妈妈生日祝福语简短励志