Recently we have configured our e2e-tests to be on Jenkins & soon we realized that we have to use shared test files: true options as complete suite run is taking very lo
I am currently struggling with the same problem, however in my prototype setup it IS working, and I am using the BASE config, and nothing more.
var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['**-spec**.js'],
capabilities: {
browserName: 'chrome',
shardTestFiles: true,
maxInstances: 2
},
onPrepare: function() {
jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
savePath: 'target/',
screenshotsFolder: 'images',
consolidate: true,
consolidateAll: false // false in my saved config - true in tut.
})
);
}
}
Can you see if you can get shard reporting working with just the bare minimum ?
Edit : Also keep a eye on what is happening in the target folder, Jasmine might be overwriting/cleaning when you dont want it.
Edit 2: if you go for the solution below me, make sure you are launching enough browsers as you have specs - the solution below me makes reports based on browser ID, if you split your specs :
capabilities: {
browserName: 'chrome',
shardTestFiles: true,
maxInstances: **2**
},
it will still overwrite your reporter HTML if you want more than 2. It creates a HTML file based on the browser/session ID used to test it - If you use 2 browsers instances you will get 2 HTML files, no more no less.
Edit 3 : A quick fix would be to not let jasmine clean up...
cleanDestination: false,
But this does not seem to do anything, so after searching and searching - I do not think the jasmine html reporter is going to let us consolidate more specs than we have shards. Issue tracker on github is not showing any progress.
So the only solution I can think of, is to use the solution below me, with enough shards to support your ammount of specs, and then parse it back to one file when your done.
Edit 4: You can always abuse Jenkins to concate the HTML files between actual test runs.