1
- // A reference configuration file.
1
+ // Reference Configuration File
2
+ //
3
+ // This file shows all of the configuration options that may be passed
4
+ // to Protractor.
5
+
6
+
2
7
exports . config = {
3
- // ----- How to setup Selenium -----
8
+ // ---------------------------------------------------------------------------
9
+ // ----- How to setup Selenium -----------------------------------------------
10
+ // ---------------------------------------------------------------------------
4
11
//
5
12
// There are three ways to specify how to use Selenium. Specify one of the
6
13
// following:
7
14
//
8
- // 1. seleniumServerJar - to start Selenium Standalone locally.
9
- // 2. seleniumAddress - to connect to a Selenium server which is already
15
+ // 1. seleniumServerJar - to start a standalone Selenium Server locally.
16
+ // 2. seleniumAddress - to connect to a Selenium Server which is already
10
17
// running.
11
- // 3. sauceUser/sauceKey - to use remote Selenium servers via SauceLabs .
18
+ // 3. sauceUser/sauceKey - to use remote Selenium Servers via Sauce Labs .
12
19
//
13
- // If the chromeOnly option is specified, no Selenium server will be started,
14
- // and chromeDriver will be used directly (from the location specified in
15
- // chromeDriver)
20
+ // You can bypass a Selenium Server if you only want to test using chrome.
21
+ // Set chromeOnly to true and chromeDriver will be used directly (from the
22
+ // location specified in chromeDriver).
16
23
17
- // The location of the selenium standalone server . jar file, relative
24
+ // The location of the selenium standalone server jar file, relative
18
25
// to the location of this config. If no other method of starting selenium
19
26
// is found, this will default to
20
27
// node_modules/protractor/selenium/selenium-server...
21
28
seleniumServerJar : null ,
22
- // The port to start the selenium server on, or null if the server should
29
+ // The port to start the Selenium Server on, or null if the server should
23
30
// find its own unused port.
24
31
seleniumPort : null ,
25
- // Chromedriver location is used to help the selenium standalone server
26
- // find chromedriver. This will be passed to the selenium jar as
32
+ // Additional command line options to pass to selenium. For example,
33
+ // if you need to change the browser timeout, use
34
+ // seleniumArgs: ['-browserTimeout=60'],
35
+ seleniumArgs : [ ] ,
36
+ // Chromedriver location is used to help the standalone Selenium Server
37
+ // find the chromedriver binary. This will be passed to the selenium jar as
27
38
// the system property webdriver.chrome.driver. If null, selenium will
28
39
// attempt to find chromedriver using PATH.
29
40
chromeDriver : './selenium/chromedriver' ,
41
+
30
42
// If true, only chromedriver will be started, not a standalone selenium.
31
43
// Tests for browsers other than chrome will not run.
32
44
chromeOnly : false ,
33
- // Additional command line options to pass to selenium. For example,
34
- // if you need to change the browser timeout, use
35
- // seleniumArgs: ['-browserTimeout=60'],
36
- seleniumArgs : [ ] ,
37
45
38
- // If sauceUser and sauceKey are specified, seleniumServerJar will be ignored.
39
- // The tests will be run remotely using SauceLabs.
40
- sauceUser : null ,
41
- sauceKey : null ,
42
-
43
- // The address of a running selenium server. If specified, Protractor will
46
+ // The address of a running Selenium Server. If specified, Protractor will
44
47
// connect to an already running instance of selenium. This usually looks like
45
48
// seleniumAddress: 'http://localhost:4444/wd/hub'
46
49
seleniumAddress : null ,
47
50
48
- // The timeout for each script run on the browser. This should be longer
49
- // than the maximum time your application needs to stabilize between tasks.
50
- allScriptsTimeout : 11000 ,
51
+ // If sauceUser and sauceKey are specified, seleniumServerJar will be ignored.
52
+ // The tests will be run remotely using Sauce Labs.
53
+ sauceUser : null ,
54
+ sauceKey : null ,
55
+
56
+ // ---------------------------------------------------------------------------
57
+ // ----- What tests to run ---------------------------------------------------
58
+ // ---------------------------------------------------------------------------
51
59
52
- // ----- What tests to run -----
53
- //
54
60
// Spec patterns are relative to the location of this config.
55
61
specs : [
56
62
'spec/*_spec.js' ,
@@ -59,26 +65,26 @@ exports.config = {
59
65
// Patterns to exclude.
60
66
exclude : [ ] ,
61
67
62
- // Alternatively, suites may be used. When run without a command line parameter,
63
- // all suites will run. If run with --suite=smoke, only the patterns matched
64
- // by that suite will run.
68
+ // Alternatively, suites may be used. When run without a command line
69
+ // parameter, all suites will run. If run with --suite=smoke, only the
70
+ // patterns matched by that suite will run.
65
71
suites : {
66
72
smoke : 'spec/smoketests/*.js' ,
67
73
full : 'spec/*.js'
68
74
} ,
69
75
70
- // Maximum number of total browser sessions to run. Tests are queued in
71
- // sequence if number of browser sessions is limited by this parameter.
72
- // Use a number less than 1 to denote unlimited. Default is unlimited.
73
- maxSessions : - 1 ,
74
-
75
- // ----- Capabilities to be passed to the webdriver instance ----
76
+ // ---------------------------------------------------------------------------
77
+ // ----- How to set up browsers ----------------------------------------------
78
+ // ---------------------------------------------------------------------------
76
79
//
80
+ // Protractor can launch your tests on one or more browsers. If you are
81
+ // testing on a single browser, use the capabilities option. If you are
82
+ // testing on multiple browsers, use the multiCapabilities array.
83
+
77
84
// For a list of available capabilities, see
78
85
// https://code.google.com/p/selenium/wiki/DesiredCapabilities
79
- // and
80
- // https://code.google.com/p/selenium/source/browse/javascript/webdriver/capabilities.js
81
- // Additionally, you may specify count, shardTestFiles, and maxInstances.
86
+ //
87
+ // In addition, you may specify count, shardTestFiles, and maxInstances.
82
88
capabilities : {
83
89
browserName : 'chrome' ,
84
90
@@ -91,34 +97,51 @@ exports.config = {
91
97
// Default is false.
92
98
shardTestFiles : false ,
93
99
94
- // Maximum number of browser instances that can run in parallel for this
95
- // set of capabilities. This is only needed if shardTestFiles is true.
100
+ // Maximum number of browser instances that can run in parallel for this
101
+ // set of capabilities. This is only needed if shardTestFiles is true.
96
102
// Default is 1.
97
- maxInstances : 1
103
+ maxInstances : 1 ,
104
+
105
+ // Additional spec files to be run on this capability only.
106
+ specs : [ 'spec/chromeOnlySpec.js' ]
98
107
} ,
99
108
100
109
// If you would like to run more than one instance of webdriver on the same
101
110
// tests, use multiCapabilities, which takes an array of capabilities.
102
111
// If this is specified, capabilities will be ignored.
103
112
multiCapabilities : [ ] ,
104
113
105
- // ----- More information for your tests ----
114
+ // Maximum number of total browser sessions to run. Tests are queued in
115
+ // sequence if number of browser sessions is limited by this parameter.
116
+ // Use a number less than 1 to denote unlimited. Default is unlimited.
117
+ maxSessions : - 1 ,
118
+
119
+ // ---------------------------------------------------------------------------
120
+ // ----- Global test information ---------------------------------------------
121
+ // ---------------------------------------------------------------------------
106
122
//
107
123
// A base URL for your application under test. Calls to protractor.get()
108
124
// with relative paths will be prepended with this.
109
125
baseUrl : 'http://localhost:9876' ,
110
126
111
127
// Selector for the element housing the angular app - this defaults to
112
- // body, but is necessary if ng-app is on a descendant of <body>
128
+ // body, but is necessary if ng-app is on a descendant of <body>.
113
129
rootElement : 'body' ,
114
130
131
+ // The timeout for each script run on the browser. This should be longer
132
+ // than the maximum time your application needs to stabilize between tasks.
133
+ allScriptsTimeout : 11000 ,
134
+
115
135
// A callback function called once protractor is ready and available, and
116
- // before the specs are executed
136
+ // before the specs are executed.
137
+ // If multiple capabilities are being run, this will run once per
138
+ // capability.
117
139
// You can specify a file containing code to run by setting onPrepare to
118
140
// the filename string.
119
141
onPrepare : function ( ) {
120
- // At this point, global 'protractor' object will be set up, and jasmine
121
- // will be available. For example, you can add a Jasmine reporter with:
142
+ // At this point, global variable 'protractor' object will be set up, and
143
+ // globals from the test framework will be available. For example, if you
144
+ // are using Jasmine, you can add a reporter with:
122
145
// jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(
123
146
// 'outputdir/', true, true));
124
147
} ,
@@ -129,9 +152,14 @@ exports.config = {
129
152
// available.
130
153
} ,
131
154
155
+ // A callback function called once the tests have finished running and
156
+ // the webdriver instance has been shut down. It is passed the exit code
157
+ // (0 if the tests passed or 1 if not). This is called once per capability.
158
+ onCleanUp : function ( exitCode ) { } ,
159
+
132
160
// The params object will be passed directly to the protractor instance,
133
- // and can be accessed from your test. It is an arbitrary object and can
134
- // contain anything you may need in your test.
161
+ // and can be accessed from your test as browser.params. It is an arbitrary
162
+ // object and can contain anything you may need in your test.
135
163
// This can be changed via the command line as:
136
164
// --params.login.user 'Joe'
137
165
params : {
@@ -141,14 +169,18 @@ exports.config = {
141
169
}
142
170
} ,
143
171
144
- // ----- The test framework -----
172
+ // ---------------------------------------------------------------------------
173
+ // ----- The test framework --------------------------------------------------
174
+ // ---------------------------------------------------------------------------
175
+
176
+ // Test framework to use. This may be jasmine, cucumber, or mocha.
145
177
//
146
- // Jasmine isfully supported as a test and assertion framework.
178
+ // Jasmine is fully supported as a test and assertion framework.
147
179
// Mocha and Cucumber have limited beta support. You will need to include your
148
- // own assertion framework if working with mocha .
180
+ // own assertion framework (such as Chai) if working with Mocha .
149
181
framework : 'jasmine' ,
150
182
151
- // ----- Options to be passed to minijasminenode -----
183
+ // Options to be passed to minijasminenode.
152
184
//
153
185
// See the full list at https://github.com/juliemr/minijasminenode/tree/jasmine1
154
186
jasmineNodeOpts : {
@@ -162,15 +194,15 @@ exports.config = {
162
194
defaultTimeoutInterval : 30000
163
195
} ,
164
196
165
- // ----- Options to be passed to mocha -----
197
+ // Options to be passed to mocha.
166
198
//
167
199
// See the full list at http://visionmedia.github.io/mocha/
168
200
mochaOpts : {
169
201
ui : 'bdd' ,
170
202
reporter : 'list'
171
203
} ,
172
204
173
- // ----- Options to be passed to cucumber -----
205
+ // Options to be passed to cucumber.
174
206
cucumberOpts : {
175
207
// Require files before executing the features.
176
208
require : 'cucumber/stepDefinitions.js' ,
@@ -179,12 +211,5 @@ exports.config = {
179
211
tags : '@dev' ,
180
212
// How to format features (default: progress)
181
213
format : 'summary'
182
- } ,
183
-
184
- // ----- The cleanup step -----
185
- //
186
- // A callback function called once the tests have finished running and
187
- // the webdriver instance has been shut down. It is passed the exit code
188
- // (0 if the tests passed or 1 if not). This is called once per capability.
189
- onCleanUp : function ( exitCode ) { }
214
+ }
190
215
} ;
0 commit comments