在xml文件量角器+ AngularJS +茉莉得到的输出结果 [英] Protractor + AngularJS + Jasmine get output results on xml file

查看:112
本文介绍了在xml文件量角器+ AngularJS +茉莉得到的输出结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想量角器结果导出到XML文件,
我发现网络上的这个伟大的链接: https://github.com/angular/protractor/issues/60

运行后:NPM安装茉莉花记者

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

 要求('茉莉记者');jasmine.getEnv()。addReporter(新jasmine.JUnitXmlReporter(
    C:\\ TEMP \\测试,真实,真实));

和我得到了以下错误:


  

    

      

jasmine.console_reporter.js:2
      如果(!茉莉){
      ^
      的ReferenceError:茉莉没有定义


    
  

我这里附我的配置文件,请指教一下我做错了,我怎么能解决这个问题:

 要求('茉莉记者');jasmine.getEnv()。addReporter(新jasmine.JUnitXmlReporter(
    C:\\ TEMP \\测试,真实,真实));//一个示例配置文件。
exports.config = {
    seleniumAddress:HTTP://本地主机:4444 / WD /中心,
    chromeOnly:真实,  功能:{
    browserName':'铬'
  },  规格:['../test/protractor/publisher_list_e2e.js'],
    allScriptsTimeout:60000,
  //选项要传递给茉莉节点。  jasmineNodeOpts:{
    showColors:真实,
    defaultTimeoutInterval:30000
  }};


解决方案

您必须改变你的配置文件,所以它看起来是这样的:

  //一个示例配置文件。
exports.config = {
  seleniumAddress:HTTP://本地主机:4444 / WD /中心,
  chromeOnly:真实,  功能:{
    browserName':'铬'
  },  规格:['../test/protractor/publisher_list_e2e.js'],
  allScriptsTimeout:60000,  //选项要传递给茉莉节点。
  在prepare:功能(){
    需要('茉莉记者');
    jasmine.getEnv()。addReporter(
      新jasmine.JUnitXmlReporter(NULL,真正的,真实的,'<目录的路径>')
    );
  },  jasmineNodeOpts:{
    showColors:真实,
    defaultTimeoutInterval:30000
  }

};

整个茉莉花报告功能具有自<$要在上prepare 语句来完成C $ C>茉莉需要有保证的唯一途径就是上prepare内功能。

和将从您的项目的根文件夹为基础。让我知道如果这有助于!

I'm trying to export protractor results to xml files, i found this great link on web: https://github.com/angular/protractor/issues/60

After running : npm install jasmine-reporters

i added the following lines to my protracotr config file:

require('jasmine-reporters');

jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(
    'C:\temp\test', true, true));

and i get the following error:

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

i attached here my config file, please advise what am i doing wrong, and how can i fix this:

require('jasmine-reporters');

jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(
    'C:\temp\test', true, 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
  }

};

解决方案

You have to change your config file so it looks like this:

// 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.
  onPrepare: function() {      
    require('jasmine-reporters');
    jasmine.getEnv().addReporter(
      new jasmine.JUnitXmlReporter(null, true, true, '<path to directory>')
    );
  },

  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000
  }

};

The whole jasmine-reports feature has to be done in the onPrepare statement since jasmine is required the only way that's guaranteed is within the onPrepare function.

And will be based from the root folder of your project. Let me know if this helps!

这篇关于在xml文件量角器+ AngularJS +茉莉得到的输出结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆