-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprotractor.conf.js
56 lines (47 loc) · 1.54 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
var HtmlScreenshotReporter = require("protractor-jasmine2-screenshot-reporter");
//var AllureReporter = require('jasmine-allure-reporter');
var reporter = new HtmlScreenshotReporter({
dest: "target/screenshots",
filename: "my-report.html",
cleanDestination: true,
captureOnlyFailedSpecs: true
});
// An example configuration file.
exports.config = {
//directConnect: true,
seleniumAddress: 'http://localhost:4444/wd/hub',
// Capabilities to be passed to the webdriver instance.
multiCapabilities: [{
browserName: "chrome",
shardTestFiles: true,
maxInstances: 2
}],
// Framework to use. Jasmine is recommended.
framework: "jasmine",
// Spec patterns are relative to the current working directory when
// protractor is called.
specs: ["./tests/calcTests.ts", "./tests/calcTests2.ts"],
// Options to be passed to Jasmine.
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
},
// Setup the report before any tests start
beforeLaunch: function () {
return new Promise(function (resolve) {
reporter.beforeLaunch(resolve);
});
},
// Assign the test reporter to each running instance
onPrepare: function () {
require("ts-node").register({
project: require("path").join(__dirname, "./tsconfig.json") // Relative path of tsconfig.json file
});
jasmine.getEnv().addReporter(reporter);
},
// Close the report after all tests finish
afterLaunch: function (exitCode) {
return new Promise(function (resolve) {
reporter.afterLaunch(resolve.bind(this, exitCode));
});
}
};