如何使用cucumber-jvm-parallel-plugin重新运行失败的方案?

时间:2018-08-23 12:02:28

标签: java selenium-webdriver cucumber-java

我正在使用Cucumber-jvm-parallel-plugin运行我的自动测试。该插件生成运行器类,并将失败的方案导出到文本文件中。

  <plugin>
        <groupId>com.github.temyers</groupId>
        <artifactId>cucumber-jvm-parallel-plugin</artifactId>
        <version>5.0.0</version>
        <executions>
          <execution>
            <id>generateRunners</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>generateRunners</goal>
            </goals>
            <configuration>
              <glue>
                <package>com.abc.test</package>
              </glue>
             
              <outputDirectory>${project.build.directory}/generated-test-sources/cucumber</outputDirectory>
            
              <featuresDirectory>src/test/resources/features/</featuresDirectory>
             
              <cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir>
              
              <plugins>
                <plugin>
                  <name>json</name>
                </plugin>
                <plugin>
                  <name>rerun</name>
                </plugin>
           
              </plugins>
           
              <strict>true</strict>
        
              <monochrome>true</monochrome>
   
              <tags>
                <tag>${tags}</tag>
              </tags>
            
              <useTestNG>false</useTestNG>
            
              <namingScheme>simple</namingScheme>
 
              <namingPattern>Parallel{c}IT</namingPattern>

              <parallelScheme>FEATURE</parallelScheme>

              <packageName>com.insight.automation.test</packageName>
      
              <useJUnitReRun>true</useJUnitReRun>
           
              <retryCount>2</retryCount>
            </configuration>
          </execution>
        </executions>
      </plugin>

这是插件生成的示例类。

import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(
        strict = true,
        features = {"C:/git/webdriver/src/test/resources/test.feature"},
        plugin = {"json:C:/git/webdriver/target/cucumber-parallel/1.json", "rerun:C:/git/webdriver/target/cucumber-parallel/1.txt"},
        monochrome = true,
        tags = {"@Test"},
        glue = {"com.abc.test"})
public class Parallel01IT {
}

我尝试将文本文件的内容复制到一个文件中,并使用永久失败的测试运行程序类运行,但是合并后出现词法错误。

是否有一种方法可以在第一次运行后仅重新运行失败的方案?

是否可以指定一个黄瓜赛跑者班来阅读多个文本文件?

0 个答案:

没有答案