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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
// An example configuration file.
exports.config = {
// Do not start a Selenium Standalone sever - only run this using chrome.
chromeOnly: true,
chromeDriver: './node_modules/protractor/selenium/chromedriver',
// Capabilities to be passed to the webdriver instance.
// See https://sites.google.com/a/chromium.org/chromedriver/capabilities
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['show-fps-counter=true', '--test-type', '--ignore-certificate-errors']
}
},
// Use on Commmandline:
// protractor ... --params.login.user=abc --params.login.password=123
params: {
baseUrl: "http://127.0.0.1/",
login: {
user: 'admin',
password: 'password'
}
},
suites: {
install: 'tests/install/**/*_spec.js',
login: 'tests/login/**/*_spec.js',
apps: 'tests/apps/**/*_spec.js',
files: 'tests/files/**/*_spec.js',
share: 'tests/share/**/*_spec.js',
},
// seleniumAddress: 'http://0.0.0.0:4444/wd/hub',
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
silent: true,
showColors: true,
onComplete: null,
isVerbose: true,
includeStackTrace: true,
defaultTimeoutInterval: 180000
},
onPrepare: function(){
global.isAngularSite = function(flag){
browser.ignoreSynchronization = !flag;
};
browser.driver.manage().window().setSize(1000, 800);
browser.driver.manage().window().maximize();
require('jasmine-spec-reporter');
// add jasmine spec reporter
var spec_reporter = new jasmine.SpecReporter({
displayStacktrace: false, // display stacktrace for each failed assertion
displayFailuresSummary: false, // display summary of all failures after execution
displaySuccessfulSpec: true, // display each successful spec
displayFailedSpec: true, // display each failed spec
displaySkippedSpec: false, // display each skipped spec
displaySpecDuration: true, // display each spec duration
colors: {
success: 'green',
failure: 'red',
skipped: 'cyan'
},
prefixes: {
success: '✓ ',
failure: '✗ ',
skipped: '- '
}
});
global.display = spec_reporter.display;
jasmine.getEnv().addReporter(spec_reporter);
}
};
// Headless testing with Phantomjs
// capabilities: {
// 'browserName': 'phantomjs',
//
// /*
// * Can be used to specify the phantomjs binary path.
// * This can generally be ommitted if you installed phantomjs globally.
// */
// 'phantomjs.binary.path':'./node_modules/phantomjs/bin/phantomjs',
//
// /*
// * Command line arugments to pass to phantomjs.
// * Can be ommitted if no arguments need to be passed.
// * Acceptable cli arugments: https://github.com/ariya/phantomjs/wiki/API-Reference#wiki-command-line-options
// */
// 'phantomjs.cli.args':['--logfile=PATH', '--loglevel=DEBUG']
// },
// TODO: Mobile? See: https://github.com/angular/protractor/blob/master/docs/browser-setup.md#setting-up-protractor-with-appium---androidchrome
// multiCapabilities: [{
// 'browserName': 'firefox'
// }, {
// 'browserName': 'chrome'
// }]
|