Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onPrepare: function () {
/* global angular: false, browser: false, jasmine: false */
browser.driver.manage().window().maximize();
if (process.env.TEAMCITY_VERSION) {
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.TeamCityReporter());
} else {
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: true
}
}));
/*
jasmine.getEnv().addReporter(new jasmineReporters.TerminalReporter({
verbosity: browser.params.verbosity, // [0 to 3, jasmine default 2]
color: true,
showStack: true
}));
*/
var pauseOnFailure = {
specDone: function (spec) {
browser.driver.manage().window().maximize();
// Disable animations so e2e tests run more quickly
var disableNgAnimate = function () {
angular.module('disableNgAnimate', []).run(['$animate', function ($animate) {
$animate.enabled(false);
}]);
};
// This seemed to make the tests more flaky rather than less. IJH 2014-12
// browser.addMockModule('disableNgAnimate', disableNgAnimate);
if (process.env.TEAMCITY_VERSION) {
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.TeamCityReporter());
}
}
};
var addReporters = function addReporters(jasmine) {
jasmine.env.clearReporters();
var ropts = options.jasmine.reporters;
var reporter;
if (ropts.teamcity) {
reporter = new reporters.TeamCityReporter(); // no options to set
reporter.name = 'TeamCity Reporter';
jasmine.addReporter(reporter);
}
else {
reporter = new SpecReporter(ropts.spec);
reporter.name = 'Spec Reporter';
jasmine.addReporter(reporter);
}
};
reporter.name = 'NUnit XML Reporter';
addReporter(reporter);
}
// We will not allow reporters producing command-line output to run at
// the same time, to prevent puzzled outputs.
var conflict = Boolean(ropts.console);
if (!conflict && ropts.terminal) {
conflict = true;
reporter = new reporters.TerminalReporter(ropts.terminal);
reporter.name = 'Terminal Reporter';
addReporter(reporter);
}
if (!conflict && ropts.teamcity) {
conflict = true;
reporter = new reporters.TeamCityReporter(); // no options to set
reporter.name = 'TeamCity Reporter';
addReporter(reporter);
}
if (!conflict && ropts.tap) {
conflict = true;
reporter = new reporters.TapReporter(); // no options to set
reporter.name = 'TAP Reporter';
addReporter(reporter);
}
// CUSTOM JASMINE REPORTERS
if (Array.isArray(options.customReporters)) {
options.customReporters.forEach(function (customReporter, index) {
customReporter.name = customReporter.name
|| 'Custom Reporter #' + (index + 1);
onPrepare: function () {
if (process.env.TEAMCITY_VERSION) {
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.TeamCityReporter());
} else {
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: true
}
}));
var pauseOnFailure = {
specDone: function (spec) {
if (spec.status === 'failed') {
browser.pause();
}
}
};
}
}
onPrepare() {
if (process.env.TEAMCITY_VERSION) {
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.TeamCityReporter());
} else {
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: true
}
}));
}
},
onPrepare: function () {
if (process.env.TEAMCITY_VERSION) {
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.TeamCityReporter());
} else {
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: true
}
}));
var pauseOnFailure = {
specDone: function (spec) {
if (spec.status === 'failed') {
browser.pause();
}
}
};
}
}
onPrepare: function () {
if (process.env.TEAMCITY_VERSION) {
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.TeamCityReporter());
}
}
};