forked from akveo/nebular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protractor.conf.ci.js
92 lines (76 loc) · 2.25 KB
/
protractor.conf.ci.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
90
91
92
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const browserstack = require('browserstack-local');
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
seleniumAddress: 'http://hub-cloud.browserstack.com/wd/hub',
specs: [
'./e2e/**/*.e2e-spec.ts'
],
commonCapabilities: {
'browserstack.user': process.env.BROWSERSTACK_USERNAME,
'browserstack.key': process.env.BROWSERSTACK_ACCESS_KEY,
'build': '@nebular/theme',
'name': '@nebular/theme',
'browserstack.local': true,
'browserstack.debug': true,
'browserName': 'chrome',
'chromeOptions': {
'args': ['show-fps-counter=true', '--no-sandbox']
}
},
multiCapabilities: [
{
browserName: 'IE',
browser_version: '11.0',
},
{
browserName: 'Edge',
},
{
browserName: 'Chrome'
},
{
browserName: 'Safari',
},
{
browserName: 'Firefox',
},
],
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function () { }
},
// Code to start browserstack local before start of test
beforeLaunch: function() {
console.log("Connecting local");
return new Promise(function(resolve, reject) {
exports.bs_local = new browserstack.Local();
exports.bs_local.start({'key': exports.config.commonCapabilities['browserstack.key'] }, function(error) {
if (error) return reject(error);
console.log('Connected. Now testing...');
resolve();
});
});
},
// Code to stop browserstack local after end of test
afterLaunch: function() {
return new Promise(function(resolve, reject) {
exports.bs_local.stop(resolve);
});
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
// Code to support common capabilities
exports.config.multiCapabilities.forEach(function (caps) {
for (var i in exports.config.commonCapabilities) caps[i] = caps[i] || exports.config.commonCapabilities[i];
});