0

我用 Cucumber 和 Typescript 在量角器中创建了框架。现在,如果我通过将maxInstances设置为2并将shardTestFiles设置为true并行运行测试,则会创建多个 Json,但不会从多个 json 生成 cucumber_report.html 如何使用cucumber-html-reporter从多个 json 生成 html 报告?
谁能帮助我使用 cucumber-html-reporter 报告并行测试?

在此处输入图像描述

配置文件

import {Config} from 'protractor';
import * as reporter from "cucumber-html-reporter";

var options;
export let config: Config = {
  directConnect: true,
  framework: 'custom',
  baseUrl: 'https://xyz',
  frameworkPath: require.resolve('protractor-cucumber-framework'),
  capabilities: {
    browserName: 'chrome',
    shardTestFiles: true,
    maxInstances: 2,
    //chromeOptions: {
      //args: [ "--headless", "--disable-gpu", "--window-size=800,600" ]
      //}
  },
  specs: [ '../Feature Files/**/*/*feature' ],
// seleniumAddress: 'http://localhost:4444/wd/hub',
    cucumberOpts: {
      tags: "@crit_proc2",
      format:'json:./Parallel_Report/cucumber_report.json',
        require: [
        '../JSFiles/Stepdefinitions/*.js' // accepts a glob
        ]
    },   
    
  onComplete: ()=> {

     options = {
      theme: 'bootstrap',
      jsonFile: './JSFiles/Parallel_Report/cucumber_report.json',
      output: './JSFiles/Parallel_Report/cucumber_report.html',
      reportSuiteAsScenarios: true,
      scenarioTimestamp: true,
      launchReport: true,
      metadata: {
          "App Version":"0.3.2",
          "Test Environment": "STAGING",
          "Browser": "Chrome  90.0.4430.212",
          "Platform": "Windows 10",
          "Parallel": "Scenarios",
          "Executed": "Remote"
      }
  };

  reporter.generate(options);
    
},

};
4

0 回答 0