为不同的API版本运行多个测试套件



我有多个需要单独运行的API版本。有时API测试将是相同的,而其他时候它们会不同。

@v1 @v2
Scenario: the api is the same for v1 and v2
@v2
Scenario: v2 specific test

我正在为每个标签设置API版本

@Before("v1")
public void signupSetup(){
    World.api("v1");
}
@Before("v2")
public void signupSetup(){
    World.api("v2");
}

我可以配置所有 @V1标签以这样运行。如何将V2测试单独运行?

@RunWith(Cucumber.class)
@CucumberOptions(glue = {"my.package.cucumber", "cucumber.api.spring"}, tags = {"v1"})
public class CucumberTestV1 {
}

我们正在使用qaf-gherkin-client,您可以在其中使用两个测试节点进行配置。

<suite name="AUT Test Automation" verbose="0" parallel="methods">
  <test name="V1 Tests">
        <parameter name="env.resources" value="resources/v1"/> 
        <groups>
            <run>
              <include name="v1"/>
            </run>
        </groups>         
        <classes>
              <class name="com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory" />
        </classes>
  </test>
  <test name="V2 Tests">
        <parameter name="env.resources" value="resources/v1"/>          
        ...
  </test>

最新更新