Newer
Older
const HtmlReporter = require('protractor-beautiful-reporter');
const {SpecReporter} = require('jasmine-spec-reporter');
seleniumAddress: 'http://localhost:4444/wd/hub',
// The port to start the selenium server on, or null if the server should
// find its own unused port.
seleniumPort: null,
seleniumArgs: [],
specs: [
],
capabilities: {
browserName: 'chrome',
chromeOptions: {
},
// A base URL for your application under test. Calls to protractor.get()
// with relative paths will be prepended with this.
baseUrl: 'http://localhost:9999',
// Add a screenshot reporter:
jasmine.getEnv().addReporter(new HtmlReporter({
preserveDirectory: false,
takeScreenShotsOnlyForFailedSpecs: true,
screenshotsSubfolder: 'images',
jsonsSubfolder: 'jsons',
baseDirectory: 'reports-tmp',
clientDefaults: {
columnSettings: {
},
pathBuilder: function pathBuilder(spec, descriptions, results, capabilities) {
// Return '<30-12-2016>/<browser>/<specname>' as path for screenshots:
// Example: '30-12-2016/firefox/list-should work'.
const currentDate = new Date();
const day = currentDate.getDate();
const month = currentDate.getMonth() + 1;
const year = currentDate.getFullYear();
const validDescriptions = descriptions.map(function(description) {
return description.replace('/', '@');
});
return path.join(
// capabilities.get('browserName'),
validDescriptions.join('-'));
}).getJasmine2Reporter());
},
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));