加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

量角器AngularJS Jasmine在xml文件上获得输出结果

发布时间:2020-12-17 18:11:43 所属栏目:安全 来源:网络整理
导读:我正在尝试将量角器结果导出到xml文件, 我在网上找到了这个很棒的链接: https://github.com/angular/protractor/issues/60 运行后:npm install jasmine-reporter 我在protracotr配置文件中添加了以下行: require('jasmine-reporters');jasmine.getEnv().a
我正在尝试将量角器结果导出到xml文件,
我在网上找到了这个很棒的链接: https://github.com/angular/protractor/issues/60

运行后:npm install jasmine-reporter

我在protracotr配置文件中添加了以下行:

require('jasmine-reporters');

jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(
    'C:temptest',true,true));

我收到以下错误:

jasmine.console_reporter.js:2
if (! jasmine) {
^
ReferenceError: jasmine is not defined

??

我附在这里我的配置文件,请告诉我我做错了什么,我该如何解决这个问题:

require('jasmine-reporters');

jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(
    'C:temptest',true));

// An example configuration file.
exports.config = {
    seleniumAddress: 'http://localhost:4444/wd/hub',chromeOnly: true,capabilities: {
    'browserName': 'chrome'
  },specs: ['../test/protractor/publisher_list_e2e.js'],allScriptsTimeout: 60000,// Options to be passed to Jasmine-node.

  jasmineNodeOpts: {
    showColors: true,defaultTimeoutInterval: 30000
  }

};

解决方法

您必须更改配置文件,使其如下所示:

// An example configuration file.
exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',// Options to be passed to Jasmine-node.
  onPrepare: function() {      
    require('jasmine-reporters');
    jasmine.getEnv().addReporter(
      new jasmine.JUnitXmlReporter(null,'<path to directory>')
    );
  },jasmineNodeOpts: {
    showColors: true,defaultTimeoutInterval: 30000
  }

};

整个jasmine-reports功能必须在onPrepare语句中完成,因为jasmine是唯一必须保证在onPrepare函数内的方法.

并将基于项目的根文件夹.如果这有帮助,请告诉我!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读