Skip to content

Instantly share code, notes, and snippets.

@marcelmokos
Created January 3, 2017 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelmokos/43d9b20f87fd63e20f2bde88277a9509 to your computer and use it in GitHub Desktop.
Save marcelmokos/43d9b20f87fd63e20f2bde88277a9509 to your computer and use it in GitHub Desktop.
protractor-config.js with jasmine-spec-reporter
//noinspection JSUnusedGlobalSymbols
import {SpecReporter} from "jasmine-spec-reporter";
export const config = {
framework: "jasmine2",
specs: ["spec/**/*.spec.js"],
directConnect: true,
chromeDriver: "node_modules/.bin/chromedriver",
jasmineNodeOpts: {
// remove ugly protractor dot reporter
print: function () {},
},
onPrepare: function () {
/**
* If you are testing against a non-angular site - set ignoreSynchronization setting to true
*
* If true, Protractor will not attempt to synchronize with the page before
* performing actions. This can be harmful because Protractor will not wait
* until $timeouts and $http calls have been processed, which can cause
* tests to become flaky. This should be used only when necessary, such as
* when a page continuously polls an API using $timeout.
*
* @type {boolean}
*/
browser.ignoreSynchronization = true;
jasmine.getEnv().addReporter(
new SpecReporter({
// Defaults: https://github.com/bcaudan/jasmine-spec-reporter#default-options
// Configuration: https://github.com/bcaudan/jasmine-spec-reporter/blob/master/src/configuration.ts
suite: {
displayNumber: true, // display each suite number (hierarchical)
},
spec: {
displayPending: true, // display each pending spec
displayDuration: true, // display each spec duration
},
summary: {
displaySuccesses: false, // display summary of all successes after execution
displayFailed: false, // display summary of all failures after execution
displayPending: false, // display summary of all pending specs after execution
},
})
);
},
capabilities: {
browserName: "chrome",
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment