-
Notifications
You must be signed in to change notification settings - Fork 25
/
protractor.conf.js
89 lines (80 loc) · 3.52 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
83
84
85
86
87
88
89
var failFast = require('protractor-fail-fast');
/* global browser */
exports.config = {
allScriptsTimeout: 20000,
specs: [
// E2E test specs are organized by user stories, not necessarily reflecting the code structure of the project.
// Imagine things your users might do, and write e2e tests around those behaviors.
'test/e2e/**/*.spec.js',
],
capabilities: {
// You can use other browsers like firefox, phantoms, safari, IE, etc.
'browserName': 'chrome'
},
baseUrl: 'http://localhost:8100',
// Configuration needed if you use a "permanently running" Selenium server (instead of starting a server each time):
//seleniumAddress: 'http://localhost:4444/wd/hub',
// http://stackoverflow.com/questions/31662828/how-to-access-chromedriver-logs-for-protractor-test/31662935
//seleniumArgs: [
// '-Dwebdriver.chrome.logfile=_chromedriver.log',
//],
// http://stackoverflow.com/questions/30600738/difference-running-protractor-with-without-selenium
//directConnect: false,
directConnect: true, // BY DEFAULT WE NOW USE DIRECTCONNECT = TRUE, AND NO NPM/SELENIUM - YOUR TESTS RUN WAY FASTER!
// http://stackoverflow.com/questions/31662828/how-to-access-chromedriver-logs-for-protractor-test/31840996#31840996
chromeDriver: 'bin/protractor-chromedriver.sh',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
//
// Increased "defaultTimeoutInterval" from 30000 to 60000 to prevent "Async callback was not invoked within timeout
// specified by jasmine.DEFAULT_TIMEOUT_INTERVAL", see Stackoverflow post:
//
// stackoverflow.com/questions/29218981/jasmine-2-async-callback-was-not-invoked-within-timeout-specified-by-jasmine-d
//
defaultTimeoutInterval: 60000,
//isVerbose: true,
isVerbose: false,
//stackoverflow.com/questions/28893436/how-to-stop-protractor-from-running-further-testcases-on-failure
//realtimeFailure: true,
realtimeFailure: false,
// https://github.com/bcaudan/jasmine-spec-reporter/blob/master/docs/protractor-configuration.md
print: function () {}
},
plugins: [{
package: 'protractor-fail-fast'
}],
onPrepare: function () {
jasmine.getEnv().addReporter(failFast.init());
// add jasmine spec reporter: https://github.com/bcaudan/jasmine-spec-reporter
var SpecReporter = require('jasmine-spec-reporter');
var opts = {
displayStacktrace: 'none', // display stacktrace for each failed assertion, values: (all|specs|summary|none)
displayFailuresSummary: true, // display summary of all failures after execution
displayPendingSummary: true, // display summary of all pending specs after execution
displaySuccessfulSpec: true, // display each successful spec
displayFailedSpec: true, // display each failed spec
displayPendingSpec: false, // display each pending spec
displaySpecDuration: false, // display each spec duration
displaySuiteNumber: true, // display each suite number (hierarchical)
colors: {
success: 'green',
failure: 'red',
pending: 'yellow'
},
prefixes: {
success: '✓ ',
failure: '✗ ',
pending: '* '
},
customProcessors: []
};
jasmine.getEnv().addReporter(new SpecReporter(opts));
// Removed this because it caused the Protractor tests to fail ...
//browser.driver.manage().window().setSize(900, 750);
//browser.driver.manage().window().setPosition(400, 0);
},
afterLaunch: function () {
failFast.clean(); // cleans up the "fail file"
}
};