Cucumber特性文件和并行执行场景

Cucumber特性文件和并行执行场景,cucumber,Cucumber,使用Cucumber,我们创建由不同场景组成的不同功能文件。我们要记住的一点是,每个场景都独立于所有其他场景 <configuration> <glue>russel.StepDefination.Option1.IN451</glue> <featuresDirectory>Login</featuresDirecto

使用Cucumber,我们创建由不同场景组成的不同功能文件。我们要记住的一点是,每个场景都独立于所有其他场景

                  <configuration>
                      <glue>russel.StepDefination.Option1.IN451</glue>
                      <featuresDirectory>Login</featuresDirectory>
                      <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                      <format>json,html</format>
                      <parallelScheme>SCENARIO</parallelScheme>
                      <!-- <parallelScheme>FEATURE</parallelScheme> -->

                  </configuration>
              </execution>
          </executions>           
问题:我们能为所有功能文件或场景并行执行吗?

这确实是可能的

                  <configuration>
                      <glue>russel.StepDefination.Option1.IN451</glue>
                      <featuresDirectory>Login</featuresDirectory>
                      <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                      <format>json,html</format>
                      <parallelScheme>SCENARIO</parallelScheme>
                      <!-- <parallelScheme>FEATURE</parallelScheme> -->

                  </configuration>
              </execution>
          </executions>           
有关所有信息和学分,请参见此链接:

                  <configuration>
                      <glue>russel.StepDefination.Option1.IN451</glue>
                      <featuresDirectory>Login</featuresDirectory>
                      <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                      <format>json,html</format>
                      <parallelScheme>SCENARIO</parallelScheme>
                      <!-- <parallelScheme>FEATURE</parallelScheme> -->

                  </configuration>
              </execution>
          </executions>           

希望这有助于

开箱即用Cucumber不支持并行测试。您可以使用Maven来运行并行测试。我们有一个github项目,请检查此链接。它有一些关于并行测试的细节

                  <configuration>
                      <glue>russel.StepDefination.Option1.IN451</glue>
                      <featuresDirectory>Login</featuresDirectory>
                      <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                      <format>json,html</format>
                      <parallelScheme>SCENARIO</parallelScheme>
                      <!-- <parallelScheme>FEATURE</parallelScheme> -->

                  </configuration>
              </execution>
          </executions>           
查看以下链接:

                  <configuration>
                      <glue>russel.StepDefination.Option1.IN451</glue>
                      <featuresDirectory>Login</featuresDirectory>
                      <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                      <format>json,html</format>
                      <parallelScheme>SCENARIO</parallelScheme>
                      <!-- <parallelScheme>FEATURE</parallelScheme> -->

                  </configuration>
              </execution>
          </executions>           
  •                   <configuration>
                          <glue>russel.StepDefination.Option1.IN451</glue>
                          <featuresDirectory>Login</featuresDirectory>
                          <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                          <format>json,html</format>
                          <parallelScheme>SCENARIO</parallelScheme>
                          <!-- <parallelScheme>FEATURE</parallelScheme> -->
    
                      </configuration>
                  </execution>
              </executions>           
    
  •                   <configuration>
                          <glue>russel.StepDefination.Option1.IN451</glue>
                          <featuresDirectory>Login</featuresDirectory>
                          <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                          <format>json,html</format>
                          <parallelScheme>SCENARIO</parallelScheme>
                          <!-- <parallelScheme>FEATURE</parallelScheme> -->
    
                      </configuration>
                  </execution>
              </executions>           
    

    是的,正如另外两个答案所表明的,它不是现成的

                      <configuration>
                          <glue>russel.StepDefination.Option1.IN451</glue>
                          <featuresDirectory>Login</featuresDirectory>
                          <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                          <format>json,html</format>
                          <parallelScheme>SCENARIO</parallelScheme>
                          <!-- <parallelScheme>FEATURE</parallelScheme> -->
    
                      </configuration>
                  </execution>
              </executions>           
    
    • 供JVM(java)使用
    • 供红宝石黄瓜使用
    我在上面那个职位所在的公司工作。验收测试——特别是基于web的验收测试——通常非常慢,而并行测试是加速验收测试的一种很好的方法。您可能还想考虑在无头浏览器中运行Web测试,例如幻像。它们非常适合在夜间运行,但在发布之前,我会在firefox或chrome上进行测试。您可能有特定于浏览器的错误

                      <configuration>
                          <glue>russel.StepDefination.Option1.IN451</glue>
                          <featuresDirectory>Login</featuresDirectory>
                          <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                          <format>json,html</format>
                          <parallelScheme>SCENARIO</parallelScheme>
                          <!-- <parallelScheme>FEATURE</parallelScheme> -->
    
                      </configuration>
                  </execution>
              </executions>           
    

    如果运行硒测试,您可能还需要考虑使用硒网格。上述方法在同一台机器上启动多个浏览器,但机器只能运行这么多浏览器。Selenium Grid将平衡多台机器的测试。例如,您可以有5个节点运行5个并行测试,每个节点=25个并行测试

                      <configuration>
                          <glue>russel.StepDefination.Option1.IN451</glue>
                          <featuresDirectory>Login</featuresDirectory>
                          <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                          <format>json,html</format>
                          <parallelScheme>SCENARIO</parallelScheme>
                          <!-- <parallelScheme>FEATURE</parallelScheme> -->
    
                      </configuration>
                  </execution>
              </executions>           
    
    如果并行运行多个测试,请记住测试应该是隔离的——理想情况下,测试应该拥有并删除自己的数据。不要假设任何其他测试的顺序()

                      <configuration>
                          <glue>russel.StepDefination.Option1.IN451</glue>
                          <featuresDirectory>Login</featuresDirectory>
                          <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                          <format>json,html</format>
                          <parallelScheme>SCENARIO</parallelScheme>
                          <!-- <parallelScheme>FEATURE</parallelScheme> -->
    
                      </configuration>
                  </execution>
              </executions>           
    
    哦,如果你把音量调得很高,你最终会得到一个性能测试。所以要小心

                      <configuration>
                          <glue>russel.StepDefination.Option1.IN451</glue>
                          <featuresDirectory>Login</featuresDirectory>
                          <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                          <format>json,html</format>
                          <parallelScheme>SCENARIO</parallelScheme>
                          <!-- <parallelScheme>FEATURE</parallelScheme> -->
    
                      </configuration>
                  </execution>
              </executions>           
    
    以下是一些方便的链接:

                      <configuration>
                          <glue>russel.StepDefination.Option1.IN451</glue>
                          <featuresDirectory>Login</featuresDirectory>
                          <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                          <format>json,html</format>
                          <parallelScheme>SCENARIO</parallelScheme>
                          <!-- <parallelScheme>FEATURE</parallelScheme> -->
    
                      </configuration>
                  </execution>
              </executions>           
    
    •                   <configuration>
                            <glue>russel.StepDefination.Option1.IN451</glue>
                            <featuresDirectory>Login</featuresDirectory>
                            <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                            <format>json,html</format>
                            <parallelScheme>SCENARIO</parallelScheme>
                            <!-- <parallelScheme>FEATURE</parallelScheme> -->
      
                        </configuration>
                    </execution>
                </executions>           
      
    •                   <configuration>
                            <glue>russel.StepDefination.Option1.IN451</glue>
                            <featuresDirectory>Login</featuresDirectory>
                            <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                            <format>json,html</format>
                            <parallelScheme>SCENARIO</parallelScheme>
                            <!-- <parallelScheme>FEATURE</parallelScheme> -->
      
                        </configuration>
                    </execution>
                </executions>           
      
    •                   <configuration>
                            <glue>russel.StepDefination.Option1.IN451</glue>
                            <featuresDirectory>Login</featuresDirectory>
                            <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                            <format>json,html</format>
                            <parallelScheme>SCENARIO</parallelScheme>
                            <!-- <parallelScheme>FEATURE</parallelScheme> -->
      
                        </configuration>
                    </execution>
                </executions>           
      
    •                   <configuration>
                            <glue>russel.StepDefination.Option1.IN451</glue>
                            <featuresDirectory>Login</featuresDirectory>
                            <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                            <format>json,html</format>
                            <parallelScheme>SCENARIO</parallelScheme>
                            <!-- <parallelScheme>FEATURE</parallelScheme> -->
      
                        </configuration>
                    </execution>
                </executions>           
      
    •                   <configuration>
                            <glue>russel.StepDefination.Option1.IN451</glue>
                            <featuresDirectory>Login</featuresDirectory>
                            <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                            <format>json,html</format>
                            <parallelScheme>SCENARIO</parallelScheme>
                            <!-- <parallelScheme>FEATURE</parallelScheme> -->
      
                        </configuration>
                    </execution>
                </executions>           
      
    •                   <configuration>
                            <glue>russel.StepDefination.Option1.IN451</glue>
                            <featuresDirectory>Login</featuresDirectory>
                            <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                            <format>json,html</format>
                            <parallelScheme>SCENARIO</parallelScheme>
                            <!-- <parallelScheme>FEATURE</parallelScheme> -->
      
                        </configuration>
                    </execution>
                </executions>           
      

        谢谢大家的帮助!!我已经得到了答案。下面是逐步解决方案 风味-黄瓜 IDE-Eclipse 1-什么?-删除您的测试运行程序文件 为什么?-对于并行测试,JVM会自动为每个并行进程创建每个运行程序 什么时候?-这可能是任何配置之前的第一步

                          <configuration>
                              <glue>russel.StepDefination.Option1.IN451</glue>
                              <featuresDirectory>Login</featuresDirectory>
                              <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                              <format>json,html</format>
                              <parallelScheme>SCENARIO</parallelScheme>
                              <!-- <parallelScheme>FEATURE</parallelScheme> -->
        
                          </configuration>
                      </execution>
                  </executions>           
        
        2-什么?-在POM.xml中添加以下提到的属性 为什么?-稍后将添加此项 什么时候?-编译之前

                          <configuration>
                              <glue>russel.StepDefination.Option1.IN451</glue>
                              <featuresDirectory>Login</featuresDirectory>
                              <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                              <format>json,html</format>
                              <parallelScheme>SCENARIO</parallelScheme>
                              <!-- <parallelScheme>FEATURE</parallelScheme> -->
        
                          </configuration>
                      </execution>
                  </executions>           
        

                          <configuration>
                              <glue>russel.StepDefination.Option1.IN451</glue>
                              <featuresDirectory>Login</featuresDirectory>
                              <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                              <format>json,html</format>
                              <parallelScheme>SCENARIO</parallelScheme>
                              <!-- <parallelScheme>FEATURE</parallelScheme> -->
        
                          </configuration>
                      </execution>
                  </executions>           
        
        3-什么?-在POM.xml中添加下面提到的插件 为什么?-这将自动创建runner 什么时候?-编译之前

                          <configuration>
                              <glue>russel.StepDefination.Option1.IN451</glue>
                              <featuresDirectory>Login</featuresDirectory>
                              <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                              <format>json,html</format>
                              <parallelScheme>SCENARIO</parallelScheme>
                              <!-- <parallelScheme>FEATURE</parallelScheme> -->
        
                          </configuration>
                      </execution>
                  </executions>           
        
        org.apache.maven.plugins maven surefire插件 2.19.1

                  <configuration>
                      <additionalClasspathElements>
                          <additionalClasspathElement>resources</additionalClasspathElement>
                      </additionalClasspathElements>
                      <forkCount>5</forkCount>
                      <reuseForks>true</reuseForks>
                      <includes>
                          <include>**/*IT.class</include>
                      </includes>
                  </configuration>
        
                          <configuration>
                              <glue>russel.StepDefination.Option1.IN451</glue>
                              <featuresDirectory>Login</featuresDirectory>
                              <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                              <format>json,html</format>
                              <parallelScheme>SCENARIO</parallelScheme>
                              <!-- <parallelScheme>FEATURE</parallelScheme> -->
        
                          </configuration>
                      </execution>
                  </executions>           
        
        
        

                          <configuration>
                              <glue>russel.StepDefination.Option1.IN451</glue>
                              <featuresDirectory>Login</featuresDirectory>
                              <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                              <format>json,html</format>
                              <parallelScheme>SCENARIO</parallelScheme>
                              <!-- <parallelScheme>FEATURE</parallelScheme> -->
        
                          </configuration>
                      </execution>
                  </executions>           
        
        4-什么?-在POM.xml中添加下面提到的插件 为什么?-这将根据功能或场景创建并行执行 将创建jason,以及HTML报告 什么时候?-编译之前

                          <configuration>
                              <glue>russel.StepDefination.Option1.IN451</glue>
                              <featuresDirectory>Login</featuresDirectory>
                              <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                              <format>json,html</format>
                              <parallelScheme>SCENARIO</parallelScheme>
                              <!-- <parallelScheme>FEATURE</parallelScheme> -->
        
                          </configuration>
                      </execution>
                  </executions>           
        
        com.github.temyers 黄瓜jvm并行插件 2.2.0 发电商 验证 发电商

                          <configuration>
                              <glue>russel.StepDefination.Option1.IN451</glue>
                              <featuresDirectory>Login</featuresDirectory>
                              <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                              <format>json,html</format>
                              <parallelScheme>SCENARIO</parallelScheme>
                              <!-- <parallelScheme>FEATURE</parallelScheme> -->
        
                          </configuration>
                      </execution>
                  </executions>           
        
        
        russel.StepDefinition.Option1.IN451
        登录
        目标/平行报告
        json,html
        脚本
        

                          <configuration>
                              <glue>russel.StepDefination.Option1.IN451</glue>
                              <featuresDirectory>Login</featuresDirectory>
                              <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                              <format>json,html</format>
                              <parallelScheme>SCENARIO</parallelScheme>
                              <!-- <parallelScheme>FEATURE</parallelScheme> -->
        
                          </configuration>
                      </execution>
                  </executions>           
        
        5-转到控制台并运行commomd -mvn清洁 -mvn编译
        -mvn验证

        请分享您使用的黄瓜口味。不同的环境有不同的解决方案。@ThomasSundberg。。我正在使用java进行编码。你所说的味道还意味着什么?请详细说明。我的问题是,您是使用Cucumber JVM、Cucumber代表Ruby还是Cucumber代表其他语言?有大约10种不同的实现可供选择。谢谢@ThomasSundberg。。我使用Cucumber JVM很好地解释了Mirzab,我遵循了所有步骤,但是Cucumber输出目录“Parallel report”不是在“target”文件夹下创建的。请分享完整的pom.xml以供参考?
                          <configuration>
                              <glue>russel.StepDefination.Option1.IN451</glue>
                              <featuresDirectory>Login</featuresDirectory>
                              <cucumberOutputDir>target/Parallel-report</cucumberOutputDir>
                              <format>json,html</format>
                              <parallelScheme>SCENARIO</parallelScheme>
                              <!-- <parallelScheme>FEATURE</parallelScheme> -->
        
                          </configuration>
                      </execution>
                  </executions>