首页 > 解决方案 > 有没有办法添加标签,浏览器量角器正在测试以显示在报告上?

问题描述

我在詹金斯https://github.com/damianszczepanik/cucumber-reporting上使用黄瓜报告。我正在使用不同的浏览器运行并行测试。我的报告如何显示失败的浏览器?我可以以某种方式将@firefox、@ie、@safari、@chrome 等标签添加到我的功能中,我将如何链接它们?

exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',
  getPageTimeout: 600000,
  allScriptsTimeout: 500000,
  defaultTimeoutInterval: 30000,
  framework: 'custom',
  // path relative to the current config file
  frameworkPath: require.resolve('protractor-cucumber-framework'),
  multiCapabilities:
  [
    {
      'browserName': 'safari'
    },
    {
      'browserName': 'internet explorer'
    },
  {
    'browserName': 'chrome'
  },
  {
    'browserName': 'firefox'
  }],

  // Spec patterns are relative to this directory.
  specs: [
    'features/*.feature'
  ],
  baseUrl: 'http://localhost:8080/',
  ignoreSynchronization: true,
  cucumberOpts: {
    strict: true,
    require: [
              'hooks/reporter/js',
              'specs/*Spec.js'
            ],
    tags: ["runThis", "~ignoreThis"],
    profile: false,
    format: 'json:e2e/reports/cucumber-report.json',
    resultJsonOutputFile: 'e2e/reports/cucumber-report.json'
  },
  onPrepare: function() {

    var chai = require('chai');
    chai.use(require('chai-as-promised'));
    global.expect = chai.expect;
    global.baseURL = this.baseURL;
    browser.ignoreSynchronization = true;
    browser.driver.manage().window().maximize();
    browser.waitForAngular();           
    browser.driver.manage().timeouts().implicitlyWait(30000);  
  },

  onComplete: function() {

    const report = require('multiple-cucumber-html-reporter');

    report.generate({
        jsonDir: 'e2e/reports/',
        reportPath: 'e2e/reports/',

    });
  }
}

标签: javascriptjenkinsreporting-servicesprotractorcucumber

解决方案


推荐阅读