This repository was archived by the owner on Dec 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprotractor.conf.js
More file actions
61 lines (61 loc) · 2.51 KB
/
protractor.conf.js
File metadata and controls
61 lines (61 loc) · 2.51 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
/**
* @file Protractor config file
*
* To run the tests
* ================
* 1. npm install dev dependencies
* 2. Start the selenium server using gulp task 'Run Selenium', this will keep selenium server running. Tests use
* the selenium server to run. Stop the task to stop selenium.
* 3. Run gulp build task, as the test is performed over the 'dist' results foulder.
* 4. Run DeviceHub server, perform at least a 'dummy' update so there is an account.
* 5. Run Webstorm's 'protractorDHC' run config test (or debug it). This opens a browser and runs the tests. Run this
* last one every time you want to test again.
*
* To create a 'protractorDHC' webstorm run configuration
* ======================================================
* 1. Go to run 'Edit configuartions...' window
* 2. Add a new configuration and select Protractor
* 3. Fill:
* 1. Configuration file: abs path pointing at project's *protractor.conf.js*
* 2. Protractor package: Something like .../DeviceHubClient/node_modules/protractor
* More info:
* https://www.jetbrains.com/help/webstorm/2017.1/testing-javascript-with-protractor.html
*
* Interesting websites
* ====================
* * https://jasmine.github.io/api/edge/matchers.html
* * Protractor: http://www.protractortest.org
* * If protractor is almost everything async, why we don't need to use then()? Answer here:
* https://spin.atomicobject.com/2014/12/17/asynchronous-testing-protractor-angular/
* * Deep Debugging protractor (wen webstorm is not enough):
* https://github.com/angular/protractor/blob/master/docs/debugging.md
* * Protractor and timeouts: https://github.com/angular/protractor/blob/master/docs/timeouts.md
*/
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
baseUrl: 'http://localhost:63345/DeviceHubClient/dist/',
specs: ['./tests/e2e/*.test.js'],
plugins: [{
package: 'protractor-console-plugin',
failOnWarning: true,
failOnError: true
}],
jasmineNodeOpts: {defaultTimeoutInterval: 20000},
capabilities: {
browserName: 'chrome',
chromeOptions: {
prefs: { // We avoid Chrome for asking if we want to save our credentials
credentials_enable_service: false,
profile: {
password_manager_enabled: false
},
download: { // We avoid the 'saveAs' prompt (useful when downloading stuff)
prompt_for_download: false,
// Needs to be abs path https://stackoverflow.com/a/27799353
default_directory: '/tmp'
}
}
}
}
}