【问题标题】:How to send the success of a test to testingBot from a Protractor project?如何从量角器项目将测试成功发送到 testingBot?
【发布时间】:2016-10-26 03:40:40
【问题描述】:

按照基于量角器的项目的 testingBot 示例,我得到了这段代码

var TestingBot = require('testingbot-api');

 describe('Protractor Demo App', function () {
 var tb;
 beforeEach(function () {
     tb = new TestingBot({
         api_key: "master_key",
         api_secret: "secret_007"
     });
 });

 afterEach(function () {
     browser.getSession().then(function (session) {
         tb.updateTest({

             'test[success]': true/*where do I get this 'test[success]' attribute?  */

         }, session.getId(), function () {
             console.log("Hi! :D");
         });
     })
 });

 it('should have a title', function () {
     browser.get('http://juliemr.github.io/protractor-demo/');
     expect(browser.getTitle()).toEqual('Super Calculator');
 });
});

我需要通过 tb.updateTest() 将测试成功发送回,但我不知道从哪里获得通过或失败测试的值。现在这个值是静态的。我也很欣赏茉莉花的方法。

【问题讨论】:

    标签: jasmine protractor automated-tests


    【解决方案1】:

    您可以在 Jasmine 中使用 custom reporter。 在那里你可以连接到specDonesuiteDone,它有一个result 参数,包含测试的成功状态。

    然后您可以使用此状态编写自定义报告或将其发送到其他地方。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-08
      • 2014-02-11
      • 1970-01-01
      • 1970-01-01
      • 2021-10-20
      相关资源
      最近更新 更多