forked from brownieboy/react-bootstrap-slider
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprotractor.local.conf.js
More file actions
105 lines (88 loc) · 3.12 KB
/
protractor.local.conf.js
File metadata and controls
105 lines (88 loc) · 3.12 KB
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
/* eslint-env node */
/* global browser, jasmine, Promise */
// This config file is to run against webpack-dev-server, which you have start first via "npm run start"
// in a separate console window.
// var HtmlReporter = require("protractor-html-screenshot-reporter");
var HtmlScreenshotReporter = require("protractor-jasmine2-screenshot-reporter");
var TARGET = process.env.npm_lifecycle_event; // This is the name of the package.json script that called this task
var SpecReporter = require("jasmine-spec-reporter");
var path = require("path");
var htmlScreenshotReporterDestination, reportTitle;
switch (TARGET) {
case "testAddEdit":
reportTitle = "Resinsurance Save Tests";
htmlScreenshotReporterDestination = "/screenshots/tablessaved";
break;
default:
reportTitle = "Dev Test";
htmlScreenshotReporterDestination = "/reports";
}
var ROOT_PATH = path.resolve(__dirname);
var today = new Date(),
timeStamp = (("0" + today.getDate()).slice(-2)) + "/" + (("0" + (today.getMonth() + 1)).slice(-2)) + "/" + today.getFullYear() + " " + (("0" + today.getHours()).slice(-2)) + ":" + (("0" + today.getMinutes()).slice(-2));
var reporter = new HtmlScreenshotReporter({
dest: ROOT_PATH + htmlScreenshotReporterDestination,
filename: "index.html",
showSummary: true,
showQuickLinks: false,
showConfiguration: true,
reportTitle: reportTitle + " - run " + timeStamp
});
exports.config = {
specs: [ROOT_PATH + "/tests/e2e/*.js"],
capabilities: {
// browserName: "firefox"
browserName: "chrome",
chromeOptions: {
args: [
"--start-maximized",
"--disable-extensions"
]
}
},
baseUrl: "http://localhost:3000",
beforeLaunch: function() {
return new Promise(function(resolve) {
reporter.beforeLaunch(resolve);
});
},
framework: "jasmine",
onPrepare: function() {
browser.ignoreSynchronization = true; // Important. Stops Protractor waiting on Angular rubbish.
browser.driver.manage().window().maximize(); // Doesn't work with Chrome. Specify in its capabilities
require("babel-register");
jasmine.getEnv().addReporter(new SpecReporter({ displayStacktrace: "summary", displayFailuresSummary: false }));
jasmine.getEnv().addReporter(reporter);
},
afterLaunch: function(exitCode) {
return new Promise(function(resolve) {
reporter.afterLaunch(resolve.bind(this, exitCode));
});
},
allScriptsTimeout: 5000
};
/*
var reporter = new HtmlScreenshotReporter({
dest: 'target/screenshots',
filename: 'my-report.html'
});
exports.config = {
// ...
// 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() {
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));
});
}
}
*/