Protractor-html-screenshot-reporter does not show all tests run on reporter file
I 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 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'
}));
}
}
Console o / p:
Failures:
1) Four and six posts should be added on the angularjs main page: Expected "0" is "10". Stack trace: Error: Wait failed on Object. (/Users/bgowda1/Work/Projects/Demos/protractor-tests/firsttest.js:35:36)
Completed in 6.191 seconds 6 tests, 6 assertions, 1 failure
The HTML report only shows 5 tests.
source to share
I was able to reproduce it - it is always the very last block it
missing from the final HTML report. This should be reported in the protractor-html-screenshot-reporter error debugger.
As a current workaround, migrating to protractor 1.4.0 (tested, crafted for me). Or add an empty block it()
to the end of the file. I'll update the post if I come up with a fix or better workaround.
source to share