forked from brabete/and-microservices-course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprotractor.conf.js
82 lines (68 loc) · 2.74 KB
/
protractor.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const os = require('os');
const HtmlScreenshotReporter = require("protractor-jasmine2-screenshot-reporter");
const JasmineReporters = require('jasmine-reporters');
const prefix = 'src/test/javascript/'.replace(/[^/]+/g,'..');
var webbrowserDriver= '';
if (os.platform() === 'win32') {
webbrowserDriver = prefix + 'node_modules/webdriver-manager/selenium/chromedriver_2.26.exe';
} else {
webbrowserDriver = prefix + 'node_modules/webdriver-manager/selenium/chromedriver_2.26';
}
exports.config = {
seleniumServerJar: prefix + 'node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar',
chromeDriver: webbrowserDriver,
allScriptsTimeout: 20000,
suites: {
account: './e2e/account/*.js',
admin: './e2e/admin/*.js',
entity: './e2e/entities/*.js'
},
capabilities: {
'browserName': 'chrome',
'phantomjs.binary.path': require('phantomjs-prebuilt').path,
'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG']
},
directConnect: true,
baseUrl: 'http://localhost:8080/',
framework: 'jasmine2',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
},
onPrepare: function() {
// Disable animations so e2e tests run more quickly
var disableNgAnimate = function() {
angular
.module('disableNgAnimate', [])
.run(['$animate', function($animate) {
$animate.enabled(false);
}]);
};
var disableCssAnimate = function() {
angular
.module('disableCssAnimate', [])
.run(function() {
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = 'body * {' +
'-webkit-transition: none !important;' +
'-moz-transition: none !important;' +
'-o-transition: none !important;' +
'-ms-transition: none !important;' +
'transition: none !important;' +
'}';
document.getElementsByTagName('head')[0].appendChild(style);
});
};
browser.addMockModule('disableNgAnimate', disableNgAnimate);
browser.addMockModule('disableCssAnimate', disableCssAnimate);
browser.driver.manage().window().setSize(1280, 1024);
jasmine.getEnv().addReporter(new JasmineReporters.JUnitXmlReporter({
savePath: 'target/reports/e2e',
consolidateAll: false
}));
jasmine.getEnv().addReporter(new HtmlScreenshotReporter({
dest: "target/reports/e2e/screenshots"
}));
}
};