【问题标题】:Jasmine HTML2 Reporter茉莉花 HTML 记者
【发布时间】:2018-01-07 13:03:15
【问题描述】:

我一直在使用 Jasmine2-HTML-Reporter,它很好。生成带有屏幕截图的多规格报告 - 就像我需要的那样。

但是,似乎出了点问题!现在我只会得到第一个规范的报告,而其他任何规范都没有。此外,系统曾经删除以前的报告/屏幕截图,但现在必须手动完成。

我真的想不出包装的其余部分发生了什么变化!

这是 conf.js 文件中的条目...每个 conf 文件都相同。我已经尝试添加各种开关 - 完全没有效果!

谢谢

 var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');

exports.config = {
//seleniumAddress: 'http://localhost:444/wd/hub',
params: require ('Models/Baths.js'), 
directConnect: true,

capabilities: {
  cssSelectorsEnabled: true,
  'browserName': 'chrome',


   specs:['Specs/001-First.js',
        'Specs/003-Exp.js'
],


allScriptsTimeout: 120000,
getPageTimetout: 30000,

framework: 'jasmine2',
showColors: true,
isVerbose: true,


onPrepare: function() {

Jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
 takeScreenshots: true,
savePath: './Reports',
  fileName: 'B&Q'
})
  );

  var SpecReporter = require ( 'jasmine-spec-reporter').SpecReporter;
  jasmine.getEnv().addReporter( new SpecReporter( {
  displayStacktrace:      true,
  displayFailureSummary:  true,
  displayPendingSummary:  true,
  displaySuccessfulSpec:  true,
  displayFailedSpec:      true,
  displaySpecDuration:    true,
  displaySuiteNumber:     false,
  colors: {
success: 'green',
failure: 'red',
pending: 'yellow'
 },
   customProcessors: []

} ));

  }
}
};

【问题讨论】:

  • 你能发布完整的conf文件吗?
  • 感谢 tyaga001 - 发布在上面。

标签: jasmine protractor


【解决方案1】:

试试下面的 conf 文件,它应该适合你。

var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
var log4js = require('log4js');
var params = process.argv;
var args = process.argv.slice(3);

exports.config = {
  //seleniumServerJar: './node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.48.2.jar',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  allScriptsTimeout: 100000,
  framework: 'jasmine2',

  onPrepare: function () {

    browser.manage().timeouts().implicitlyWait(11000);
    var width = 768;
    var height = 1366;
    browser.driver.manage().window().setSize(768, 1366);
    browser.ignoreSynchronization = false;

    jasmine.getEnv().addReporter(
      new Jasmine2HtmlReporter({
        savePath: __dirname+'/qualityreports/testresults/e2e',
        takeScreenshots: false,
        filePrefix: 'automationReport',
        consolidate: true,
        cleanDestination: false,
        consolidateAll: true

      })
    );
  },

  suites:{

    example:['./test/e2e/specs/**/*Spec.js',]
  },


  capabilities: {
    'browserName': 'chrome'
  },


  resultJsonOutputFile:'./results.json',

  // Options to be passed to Jasmine-node.
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 100000
  }
};

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    • 2014-12-12
    • 1970-01-01
    • 1970-01-01
    • 2015-07-26
    • 1970-01-01
    • 2023-03-23
    相关资源
    最近更新 更多