重用黄瓜中的功能/步骤

时间:2020-09-18 16:45:50

标签: cucumber cucumber-java

我想在另一个类中重用功能/步骤。我有以下结构

   public abstract class MyTestRunner {
    
        @CitrusResource
        protected TestRunner runner;
    
        public void getRequest() {
          runner.http(....)
     }
    }

public class A extends MyTestRunner {

    public static value;
        @Given("^.....$")
    public void i_want_to_perform_a() {
        getRequest();
    }

    @Then("^...$")
    public void i_will_get_a_() {
        value = response_value;     
    }
}

    public class B extends MyTestRunner {
    
            @Given("^.....$")
        public void i_want_to_perform_() {
            getRequest();
        }
    
        @Then("^...$")
        public void i_will_get_b_() {
        }
    }

我想从B类调用A类中定义的步骤。

0 个答案:

没有答案