如何运行多个 chrome 实例以在量角器中按单个特征文件的顺序运行所有场景

如何解决如何运行多个 chrome 实例以在量角器中按单个特征文件的顺序运行所有场景

我希望所有场景都在浏览器的多个实例中运行,我尝试在功能中提供最大实例,但它总是打开 1 个 chrome 实例并一一运行测试。我希望测试在多个 chrome 实例中运行。我在这里做错了什么?

当前配置文件

     exports.config = {
      allScriptsTimeout: 800000,getPageTimeout: 400000,specs: [
        './src/cucumber/features/**/memberSearch.feature',],params: {
        pageObjects: require['./src/cucumber/pages/**/*.po.ts'],customTimeout: 5000,url:{
          dev: "https://dev.com/login",test: "https://test.com/login",stage: "https://stage.com/login",local: "http://localhost:4200",}
      },capabilities: {
        browserName: 'chrome',//acceptInsecureCerts: true,shardTestFiles: true,maxInstances: 4,chromeOptions: {
          args: ['--no-sandBox','--disable-setuid-sandBox','--disable-gpu','--window-size=800x600'],},directConnect: true,baseUrl: 'https://dev.com/',useAllAngular2AppRoots: true,framework: 'custom',frameworkPath: require.resolve('protractor-cucumber-framework'),cucumberOpts: {
    compiler: 'ts:ts-node/register',require: ['./src/cucumber/steps/**/*.steps.ts','./src/cucumber/utils/**/*.util.ts'],format: 'json:./reports/cucumber_report.json',monochrome: true,strict: true,tags: '@MemberSearch',}

特征文件

    @MemberSearch
Feature: Search a member
  @CompletedTodo
  Scenario: See all the assessments associated with the member
    Given Enter the URL
    When  click on the MemberID radio Button
    And   Type the memberID "ABCD" first time
    And   Click the Search Button first time
  
@FilterTitle
  Scenario: Validate the Filters With Title field
    Given Enter the URL
    When  click on the MemberID radio Button
    And   Type the memberID "ABCD"
    Then  Click the Search Button
  
@FilterTimeFrame30
 Scenario: Validate the Filters with time FilterTimeFrame 30
   Given Enter the URL
    When  click on the MemberID radio Button
    And   Type the memberID "ABCD"
    Then  Click the Search Button
    Then  Show the message "No records to display"
  
@FilterTimeFrame60
 Scenario: Validate the Filters with time FilterTimeFrame 60
   Given Enter the URL
    When  click on the MemberID radio Button
    And   Type the memberID "ABCD"
    Then  Click the Search Button
  
@FilterTimeFrame90
 Scenario: Validate the Filters with time FilterTimeFrame 90
   Given Enter the URL
    When  click on the MemberID radio Button
    And   Type the memberID "ABCD"
    Then  Click the Search Button
    Then  Show the message "No records to display"
    And   Click the Clear Button
  
@FilterTimeFrame365
 Scenario: Validate the Filters with time FilterTimeFrame 365
   Given Enter the URL
    When  click on the MemberID radio Button
    And   Type the memberID "ABCD"
    Then  Click the Search Button
    Then  Show the message "No records to display"
    And   Click the Clear Button
    When  Type the memberID "40988"

Terminal

我希望所有场景都在多个浏览器实例中运行,我曾尝试在功能中提供最大实例,但它始终打开 1 个实例并逐一运行测试。我想测试在多个实例中运行。我在这里做错了什么?

解决方法

您可以尝试在 npm/量角器脚本中使用“--parallel=**”(例如:cucumber-js ./features --parallel=5)。将 ** 替换为您需要的并行实例数。配置文件中的“maxInstances”是指浏览器应该启动的最大实例数,这并不意味着默认会打开4个实例,请根据--parallel count进行更改。

--parallel incucumber-js 运行相同特征文件的每个场景,并且一个场景大纲的每个示例并行触发。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?