【问题标题】:How to configure Extent report for temyers/Cucumber-JVM-Parallel plugin如何为 temyers/Cucumber-JVM-Parallel 插件配置范围报告
【发布时间】:2019-01-18 10:19:54
【问题描述】:

如何为 temyers/Cucumber-JVM-Parallel 插件配置 Extent 报告?

我们正在使用 Teamyers Cucumber-JVM-Parallel-plugin 使用 Maven-surefire-plugin 并行运行 Selenium 黄瓜测试。 使用 Cucumber-JVM-Parallel-plugin,我们绕过了对传统 Cucumber-runner 类的需求,它的多个实例正在由这个插件在运行时生成

对于每个并行运行,它会生成单独的黄瓜报告。

 <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>
        <!-- Mandatory -->
        <!-- List of package names to scan for glue code. -->
        <glue>
          <package>com.example</package>
          <package>com.example.other</package>
        </glue>
        <!-- These are optional, with the default values -->
        <!-- Where to output the generated tests -->
        <outputDirectory>${project.build.directory}/generated-test-sources/cucumber</outputDirectory>
        <!-- The directory, which must be in the root of the runtime classpath, containing your feature files.  -->
        <featuresDirectory>src/test/resources/features/</featuresDirectory>
        <!-- Directory where the cucumber report files shall be written  -->
        <cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir>
        <!-- List of cucumber plugins. When none are provided the json formatter is used. For more 
             advanced usage see section about configuring cucumber plugins -->
        <plugins>
          <plugin>
              <name>json</name>
          </plugin>
          <plugin>
              <name>com.example.CustomHtmlFormatter</name>
              <extension>html</extension>
          </plugin>
        </plugins>
        <!-- CucumberOptions.strict property -->
        <strict>true</strict>
        <!-- CucumberOptions.monochrome property -->
        <monochrome>true</monochrome>
        <!-- The tags to run, maps to CucumberOptions.tags property. Default is no tags. -->
        <tags>
          <tag>@billing</tag>
          <tag>~@billing</tag>
          <tag>@important</tag>
          <tag>@important,@billing</tag>
        </tags>
        <!-- Generate TestNG runners instead of JUnit ones. --> 
        <useTestNG>false</useTestNG>
        <!-- The naming scheme to use for the generated test classes.  One of ['simple', 'feature-title', 'pattern'] -->
        <namingScheme>simple</namingScheme>
        <!-- The class naming pattern to use.  Only required/used if naming scheme is 'pattern'.-->
        <namingPattern>Parallel{c}IT</namingPattern>
        <!-- One of [SCENARIO, FEATURE]. SCENARIO generates one runner per scenario.  FEATURE generates a runner per feature. -->
        <parallelScheme>SCENARIO</parallelScheme>
        <!-- Specify a custom template for the generated sources (this is a path relative to the project base directory) -->
        <customVmTemplate>src/test/resources/cucumber-custom-runner.vm</customVmTemplate>
        <!-- Specify a custom package name for generated sources. Default is no package.-->
        <packageName>com.example</packageName>
      </configuration>
    </execution>
  </executions>
</plugin>

如何为其配置范围报告。

谢谢

【问题讨论】:

    标签: extentreports selenium-extent-report


    【解决方案1】:

    Since version 4.0.0 cucumber supports parallel execution。您可以像正常执行一样使用它并使用 Extent。

    【讨论】:

    • 感谢您的快速回复。是否仍然支持 Cucumber-jvm-parallel 插件?或者如何在不使用它的情况下生成多个并行运行器?
    • 您不再需要生成多个跑步者。 Cucumber JVM 可以与单个运行器并行执行场景/功能。查看链接的文档/公告,了解适用于您的情况。
    • 您能告诉我如何使用 Cucumber-JVM 的 Gradle 变体实现并行执行吗?谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-07
    相关资源
    最近更新 更多