首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >量角器- trx -报告不创建trx文件

量角器- trx -报告不创建trx文件
EN

Stack Overflow用户
提问于 2016-05-31 19:37:50
回答 2查看 802关注 0票数 1

我第一次与量角器合作,我已经安装了一些模块,包括量角器、量角器-trx-记者、茉莉花-trx-记者和网络驱动程序经理。Selenium服务器运行在默认的4444端口上,当我通过命令行(打开浏览器,测试通过)在本地运行时,测试似乎运行良好。

一切似乎没有任何错误,但我找不到trx文件发表的量角器-trx-记者。当我运行protractor conf.js时,测试就开始了,命令行输出显示它正在导出trx报告并将输出文件设置为ProtractorTestResults.trx,但是.trx文件不会出现在任何地方,因此我怀疑它不是发布文件,而是没有抛出错误。

如果量角器- trx -记者没有导出trx文件,有什么想法吗?

下面是我的配置文件和规范文件的样子(这两个文件都是从量角器和量角器-trx-报告站点获取的)

代码语言:javascript
运行
复制
    //conf.js
    exports.config = {
      framework: 'jasmine',
      seleniumAddress: 'http://localhost:4444/wd/hub',
      specs: ['spec.js'],
      onPrepare: function () {
           console.log('Adding TRX reporter');
        require('protractor-trx-reporter');
           jasmine.getEnv().addReporter(new jasmine.TrxReporter('ProtractorTestResults.trx'));
      }
}

 //spec.js
 describe('angularjs homepage todo list', function() {
     it('should add a todo', function() {
        browser.get('https://angularjs.org');

        element(by.model('todoList.todoText')).sendKeys('write first protractor test');
        element(by.css('[value="add"]')).click();

        var todoList = element.all(by.repeater('todo in todoList.todos'));
        expect(todoList.count()).toEqual(3);
        expect(todoList.get(2).getText()).toEqual('write first protractor test');

        // You wrote your first test, cross it off the list
        todoList.get(2).element(by.css('input')).click();
        var completedAmount = element.all(by.css('.done-true'));
        expect(completedAmount.count()).toEqual(2);
     });
 });
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-06-22 23:27:58

最后,我使用了jasmine记者,下面是conf.js的样子:

代码语言:javascript
运行
复制
// conf.js
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
  directConnect: true,
  specs: ['spec.js'],
  capabilities: {
    'browserName': 'chrome'
  },
onPrepare: function () {
        var trx = require('jasmine-trx-reporter');
        return browser.getCapabilities().then(function (caps) {
        var browserName = caps.get('browserName').toUpperCase();

        var jasmineTrxConfig = {
            reportName: 'Protractor Test Results',
            folder: 'testResults',
            outputFile: 'Test.trx',
            browser: browserName,
            groupSuitesIntoSingleFile: false
        };

        jasmine.getEnv().addReporter(new trx(jasmineTrxConfig));
    });
}
};
票数 2
EN

Stack Overflow用户

发布于 2016-06-22 19:57:35

我认为这可能是答案:

"...short术语我们不会增加对Jasmin2.0的支持。稍后可能会的,但我不能向你保证约会。“

这太让人心烦了。我也有同样的问题。茉莉花-trx-记者也不为我工作。

来源:[https://github.com/hatchteam/protractor-trx-reporter/issues/2]

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37554261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档