2017-09-07 79 views
1

我有多個需要單獨運行的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 { 
} 

回答

2

我們使用QAF-Gherkin-client,在那裏你可以使用兩個測試節點configure它。

<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> 

相關問題