-
Notifications
You must be signed in to change notification settings - Fork 9
/
protractor.conf.js
120 lines (116 loc) · 4.61 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
* Copyright 2018 herd-ui contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const conf = require('./e2e/config/conf.e2e.json');
const { SpecReporter } = require('jasmine-spec-reporter');
const jasmineReporters = require('jasmine-reporters');
const fs = require('fs');
const path = require('path');
exports.config = {
SELENIUM_PROMISE_MANAGER: 0,
allScriptsTimeout: 11000,
suites: {
home: './e2e/**/home/**/*.e2e-spec.ts',
search: './e2e/**/search/**/*.e2e-spec.ts',
category: './e2e/**/category/**/*.e2e-spec.ts',
format: './e2e/**/format/**/*.e2e-spec.ts',
formatExternalInterfaces:'./e2e/**/format/externalinterfaces/*.e2e-spec.ts',
dataEntityOverview: './e2e/**/data-entity/overview/**/*.e2e-spec.ts',
dataEntityDocumentSchema: './e2e/**/data-entity/documentschema/**/*.e2e-spec.ts',
dataEntitySme: './e2e/**/data-entity/sme/**/*.e2e-spec.ts',
dataEntitySampleData: './e2e/**/data-entity/sampledata/**/*.e2e-spec.ts',
dataEntityList: './e2e/**/data-entity/list/**/*.e2e-spec.ts',
dataEntityColumns: './e2e/**/data-entity/columns/**/*.e2e-spec.ts',
dataObjectList: './e2e/**/data-objects/list/**/*.e2e-spec.ts',
dataObjectDetail: './e2e/**/data-objects/detail/*.e2e-spec.ts',
dataObjectDetailLineage: './e2e/**/data-objects/detail/lineage/**/*.e2e-spec.ts',
dataObjectDetailStorageUnits: './e2e/**/data-objects/detail/storage-units/**/*.e2e-spec.ts'
},
baseUrl: 'http://localhost:4200/',
// suite: 'dataObjectDetailStorageUnits',
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
prefs: {
'credentials_enable_service': false,
'profile': {
'password_manager_enabled': false
},
'download': {
'prompt_for_download': false,
'default_directory': 'C:/Temp'
}
},
args: [
'--disable-cache',
'--disable-application-cache',
'--disable-offline-load-stale-cache',
'--disk-cache-size=0',
'--v8-cache-options=off',
'--no-sandbox',
'--test-type=browser'
]
}
},
// 4 minute timeout set for browser page loads
getPageTimeout: 240000,
// 4 minute timeout set for protractor scripts
allScriptsTimeout: 240000,
directConnect: true,
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
// 4 minute Async test timeout for jasmine
defaultTimeoutInterval: 240000,
print: function () { }
},
beforeLaunch: function () {
if (fs.existsSync('processed.txt')) {
fs.unlinkSync("processed.txt");
}
},
afterLaunch: function () {
// tear down all data that was setup.
const dataManager = require(path.resolve(__dirname + '/e2e/util/DataManager.ts')).DataManager;
return dataManager.tearDownData();
},
onPrepare: function () {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
return browser.getProcessedConfig().then((c) => {
// used to change the namespace for the data.
process.env.CURRENT_BROWSER = c.capabilities.browserName.replace(new RegExp(' ', 'g'), '-');
// shorten the browser idetifier for herd requests.
process.env.CURRENT_BROWSER = process.env.CURRENT_BROWSER.replace('internet-explorer', 'ie');
process.env.CURRENT_BROWSER = process.env.CURRENT_BROWSER.replace('microsoftedge', 'edge');
jasmine.getEnv().addReporter(
new jasmineReporters.JUnitXmlReporter({
filePrefix: c.capabilities.browserName,
consolidateAll: true,
modifySuiteName: function (generatedSuiteName, suite) {
// this will produce distinct suite names for each capability,
// e.g. 'firefox.login tests' and 'chrome.login tests'
return c.capabilities.browserName + '.' + generatedSuiteName;
}
})
);
// for each browser run, ask that browser's process to try to initialize as much data a possible.
const dataManager = require(path.resolve(__dirname + '/e2e/util/DataManager.ts')).DataManager;
return dataManager.initializeData(c.specs);
});
}
};