量角器-HTML的截图,记者未显示所有记者的文件执行的测试量角器、记者、截图、文件

2023-09-14 00:25:04 作者:朱颜辞镜花辞树

我试图运行firsttest.js:

Am trying to run firsttest.js:

// firsttest.js
describe('angularjs homepage', function() {
  var firstNumber = element(by.model('first'));
  var secondNumber = element(by.model('second'));
  var goButton = element(by.id('gobutton'));
  var latestResult = element(by.binding('latest'));

  beforeEach(function() {
    browser.get('http://juliemr.github.io/protractor-demo/');
  });

  it('should have a title', function() {
    expect(browser.getTitle()).toEqual('Super Calculator');
  });

  it('should add one and two', function() {

    firstNumber.sendKeys(1);
    secondNumber.sendKeys(2);

    goButton.click();

    expect(latestResult.getText()).toEqual('3');
  });

  it('should add four and six', function() {
    // Fill this in.
    expect(latestResult.getText()).toEqual('10');
  });

  it('test1', function() {
    // Fill this in.
    expect(true).toEqual(true);
  });

  it('test2', function() {
    // Fill this in.
    expect(true).toEqual(true);
  });

  it('test3', function() {
    // Fill this in.
    expect(true).toEqual(true);
  });

});

的conf文件:

conf file:

var HtmlReporter = require('protractor-html-screenshot-reporter');

exports.config = {

  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['firsttest.js'],
  multiCapabilities: [{
    'browserName': 'chrome'
  }],
  onPrepare: function() {
    // Add a screenshot reporter and store screenshots to `/tmp/screnshots`:
    jasmine.getEnv().addReporter(new HtmlReporter({
      baseDirectory: './e2e-reports',
      takeScreenShotsOnlyForFailedSpecs: true,
      docTitle: 'Pytheas Tests'
    }));
  }
}

控制台O / P:

Console o/p:

失败:

1)angularjs主页应该增加四至六名消息:       预计0等于10。堆栈跟踪:       错误:无法预期      在[对象的对象。 (/Users/bgowda1/Work/Projects/Demos/protractor-tests/firsttest.js:35:36)

1) angularjs homepage should add four and six Message: Expected '0' to equal '10'. Stacktrace: Error: Failed expectation at [object Object]. (/Users/bgowda1/Work/Projects/Demos/protractor-tests/firsttest.js:35:36)

完成了6.191秒6测试,6断言,1失败

Finished in 6.191 seconds 6 tests, 6 assertions, 1 failure

HTML报告显示只有5次测试。

HTML report shows only 5 tests.

推荐答案

我是能够重现它 - 这始终是在最后失踪的最新块HTML报告。这应该是报protractor-html-screenshot-reporter bug跟踪系统。

I was able to reproduce it - this is always the latest it block that is missing in the final HTML report. This should be reported to the protractor-html-screenshot-reporter bug tracker.

作为当前的解决方法,降级到1.4.0量角器(经测试,为我工作)。或者,添加一个空的它()块添加到文件的末尾。我会更新帖子,如果我会想出一个解决方法,或更好的解决办法。

As a current workaround, downgrade to protractor 1.4.0 (tested, worked for me). Or, add an empty it() block to the end of the file. I'll update the post if I'll come up with a fix, or better workaround.

 
精彩推荐
图片推荐