Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 26366e5

Browse files
committed
docs(referenceConf): organize the reference configuration better
1 parent 19da218 commit 26366e5

File tree

1 file changed

+88
-63
lines changed

1 file changed

+88
-63
lines changed

Diff for: docs/referenceConf.js

+88-63
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,62 @@
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+
27
exports.config = {
3-
// ----- How to setup Selenium -----
8+
// ---------------------------------------------------------------------------
9+
// ----- How to setup Selenium -----------------------------------------------
10+
// ---------------------------------------------------------------------------
411
//
512
// There are three ways to specify how to use Selenium. Specify one of the
613
// following:
714
//
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
1017
// running.
11-
// 3. sauceUser/sauceKey - to use remote Selenium servers via SauceLabs.
18+
// 3. sauceUser/sauceKey - to use remote Selenium Servers via Sauce Labs.
1219
//
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).
1623

17-
// The location of the selenium standalone server .jar file, relative
24+
// The location of the selenium standalone server jar file, relative
1825
// to the location of this config. If no other method of starting selenium
1926
// is found, this will default to
2027
// node_modules/protractor/selenium/selenium-server...
2128
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
2330
// find its own unused port.
2431
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
2738
// the system property webdriver.chrome.driver. If null, selenium will
2839
// attempt to find chromedriver using PATH.
2940
chromeDriver: './selenium/chromedriver',
41+
3042
// If true, only chromedriver will be started, not a standalone selenium.
3143
// Tests for browsers other than chrome will not run.
3244
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: [],
3745

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
4447
// connect to an already running instance of selenium. This usually looks like
4548
// seleniumAddress: 'http://localhost:4444/wd/hub'
4649
seleniumAddress: null,
4750

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+
// ---------------------------------------------------------------------------
5159

52-
// ----- What tests to run -----
53-
//
5460
// Spec patterns are relative to the location of this config.
5561
specs: [
5662
'spec/*_spec.js',
@@ -59,26 +65,26 @@ exports.config = {
5965
// Patterns to exclude.
6066
exclude: [],
6167

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.
6571
suites: {
6672
smoke: 'spec/smoketests/*.js',
6773
full: 'spec/*.js'
6874
},
6975

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+
// ---------------------------------------------------------------------------
7679
//
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+
7784
// For a list of available capabilities, see
7885
// 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.
8288
capabilities: {
8389
browserName: 'chrome',
8490

@@ -91,34 +97,51 @@ exports.config = {
9197
// Default is false.
9298
shardTestFiles: false,
9399

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.
96102
// 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']
98107
},
99108

100109
// If you would like to run more than one instance of webdriver on the same
101110
// tests, use multiCapabilities, which takes an array of capabilities.
102111
// If this is specified, capabilities will be ignored.
103112
multiCapabilities: [],
104113

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+
// ---------------------------------------------------------------------------
106122
//
107123
// A base URL for your application under test. Calls to protractor.get()
108124
// with relative paths will be prepended with this.
109125
baseUrl: 'http://localhost:9876',
110126

111127
// 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>.
113129
rootElement: 'body',
114130

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+
115135
// 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.
117139
// You can specify a file containing code to run by setting onPrepare to
118140
// the filename string.
119141
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:
122145
// jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(
123146
// 'outputdir/', true, true));
124147
},
@@ -129,9 +152,14 @@ exports.config = {
129152
// available.
130153
},
131154

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+
132160
// 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.
135163
// This can be changed via the command line as:
136164
// --params.login.user 'Joe'
137165
params: {
@@ -141,14 +169,18 @@ exports.config = {
141169
}
142170
},
143171

144-
// ----- The test framework -----
172+
// ---------------------------------------------------------------------------
173+
// ----- The test framework --------------------------------------------------
174+
// ---------------------------------------------------------------------------
175+
176+
// Test framework to use. This may be jasmine, cucumber, or mocha.
145177
//
146-
// Jasmine isfully supported as a test and assertion framework.
178+
// Jasmine is fully supported as a test and assertion framework.
147179
// 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.
149181
framework: 'jasmine',
150182

151-
// ----- Options to be passed to minijasminenode -----
183+
// Options to be passed to minijasminenode.
152184
//
153185
// See the full list at https://github.com/juliemr/minijasminenode/tree/jasmine1
154186
jasmineNodeOpts: {
@@ -162,15 +194,15 @@ exports.config = {
162194
defaultTimeoutInterval: 30000
163195
},
164196

165-
// ----- Options to be passed to mocha -----
197+
// Options to be passed to mocha.
166198
//
167199
// See the full list at http://visionmedia.github.io/mocha/
168200
mochaOpts: {
169201
ui: 'bdd',
170202
reporter: 'list'
171203
},
172204

173-
// ----- Options to be passed to cucumber -----
205+
// Options to be passed to cucumber.
174206
cucumberOpts: {
175207
// Require files before executing the features.
176208
require: 'cucumber/stepDefinitions.js',
@@ -179,12 +211,5 @@ exports.config = {
179211
tags: '@dev',
180212
// How to format features (default: progress)
181213
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+
}
190215
};

0 commit comments

Comments
 (0)