selenium-webdriver 3.6.0 → 4.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGES.md +181 -0
  2. package/README.md +25 -27
  3. package/chrome.js +113 -127
  4. package/edge.js +42 -117
  5. package/example/chrome_android.js +8 -8
  6. package/example/chrome_mobile_emulation.js +8 -8
  7. package/example/firefox_channels.js +22 -18
  8. package/example/google_search_test.js +39 -26
  9. package/example/logging.js +39 -6
  10. package/firefox.js +769 -0
  11. package/http/index.js +41 -4
  12. package/http/util.js +11 -6
  13. package/ie.js +56 -97
  14. package/index.js +178 -114
  15. package/jasmine.json +11 -0
  16. package/lib/actions.js +68 -63
  17. package/lib/by.js +1 -1
  18. package/lib/capabilities.js +255 -192
  19. package/lib/command.js +26 -50
  20. package/lib/error.js +85 -44
  21. package/lib/http.js +133 -110
  22. package/lib/input.js +1044 -8
  23. package/lib/promise.js +222 -3323
  24. package/lib/proxy.js +134 -39
  25. package/lib/test/bootstrap_jasmine.js +28 -0
  26. package/lib/test/data/actions/click.html +24 -0
  27. package/lib/test/data/actions/drag.html +77 -0
  28. package/lib/test/data/actions/record_click.html +21 -0
  29. package/lib/test/data/chrome/download.html +2 -0
  30. package/lib/test/data/inputs.html +42 -0
  31. package/lib/test/data/selectPage.html +12 -0
  32. package/lib/test/data/simpleTest.html +5 -0
  33. package/lib/test/data/upload_invisible.html +45 -0
  34. package/lib/test/fileserver.js +23 -19
  35. package/lib/test/index.js +30 -212
  36. package/lib/test/resources.js +0 -1
  37. package/lib/webdriver.js +675 -936
  38. package/net/index.js +21 -25
  39. package/net/portprober.js +51 -68
  40. package/package.json +5 -3
  41. package/remote/index.js +5 -19
  42. package/safari.js +41 -128
  43. package/test/actions_test.js +173 -18
  44. package/test/{session_test.js → builder_test.js} +44 -37
  45. package/test/chrome/devtools_test.js +93 -0
  46. package/test/chrome/options_test.js +48 -154
  47. package/test/chrome/service_test.js +7 -7
  48. package/test/cookie_test.js +77 -63
  49. package/test/element_finding_test.js +206 -201
  50. package/test/execute_script_test.js +115 -114
  51. package/test/fingerprint_test.js +16 -15
  52. package/test/firefox_test.js +251 -0
  53. package/test/http/http_test.js +0 -1
  54. package/test/http/util_test.js +2 -2
  55. package/test/io/zip_test.js +6 -7
  56. package/test/lib/error_test.js +34 -7
  57. package/test/lib/http_test.js +8 -128
  58. package/test/lib/input_test.js +1379 -0
  59. package/test/lib/promise_test.js +473 -908
  60. package/test/lib/webdriver_test.js +296 -868
  61. package/test/logging_test.js +37 -43
  62. package/test/page_loading_test.js +71 -81
  63. package/test/proxy_test.js +64 -72
  64. package/test/rect_test.js +14 -25
  65. package/test/remote_test.js +10 -29
  66. package/test/safari_test.js +7 -71
  67. package/test/stale_element_test.js +20 -23
  68. package/test/tag_name_test.js +10 -9
  69. package/test/upload_test.js +27 -35
  70. package/test/window_test.js +72 -85
  71. package/testing/index.js +386 -314
  72. package/.npmignore +0 -2
  73. package/example/async_await_test.js +0 -69
  74. package/example/google_search_generator.js +0 -47
  75. package/example/parallel_flows.js +0 -51
  76. package/firefox/binary.js +0 -347
  77. package/firefox/extension.js +0 -224
  78. package/firefox/index.js +0 -576
  79. package/firefox/profile.js +0 -311
  80. package/lib/events.js +0 -210
  81. package/lib/test/data/firefox/jetpack-sample.xpi +0 -0
  82. package/lib/test/data/firefox/sample.xpi +0 -0
  83. package/lib/test/promise.js +0 -79
  84. package/opera.js +0 -405
  85. package/phantomjs.js +0 -282
  86. package/test/firefox/extension_test.js +0 -120
  87. package/test/firefox/firefox_test.js +0 -244
  88. package/test/firefox/profile_test.js +0 -140
  89. package/test/lib/events_test.js +0 -177
  90. package/test/lib/promise_aplus_test.js +0 -78
  91. package/test/lib/promise_error_test.js +0 -884
  92. package/test/lib/promise_flow_test.js +0 -2288
  93. package/test/lib/promise_generator_test.js +0 -310
  94. package/test/phantomjs/execute_phantomjs_test.js +0 -59
  95. package/test/testing/assert_test.js +0 -373
  96. package/test/testing/index_test.js +0 -224
  97. package/testing/assert.js +0 -378
package/firefox/index.js DELETED
@@ -1,576 +0,0 @@
1
- // Licensed to the Software Freedom Conservancy (SFC) under one
2
- // or more contributor license agreements. See the NOTICE file
3
- // distributed with this work for additional information
4
- // regarding copyright ownership. The SFC licenses this file
5
- // to you under the Apache License, Version 2.0 (the
6
- // "License"); you may not use this file except in compliance
7
- // with the License. You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing,
12
- // software distributed under the License is distributed on an
13
- // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- // KIND, either express or implied. See the License for the
15
- // specific language governing permissions and limitations
16
- // under the License.
17
-
18
- /**
19
- * @fileoverview Defines the {@linkplain Driver WebDriver} client for Firefox.
20
- * Before using this module, you must download the latest
21
- * [geckodriver release] and ensure it can be found on your system [PATH].
22
- *
23
- * Each FirefoxDriver instance will be created with an anonymous profile,
24
- * ensuring browser historys do not share session data (cookies, history, cache,
25
- * offline storage, etc.)
26
- *
27
- * __Customizing the Firefox Profile__
28
- *
29
- * The {@linkplain Profile} class may be used to configure the browser profile
30
- * used with WebDriver, with functions to install additional
31
- * {@linkplain Profile#addExtension extensions}, configure browser
32
- * {@linkplain Profile#setPreference preferences}, and more. For example, you
33
- * may wish to include Firebug:
34
- *
35
- * const {Builder} = require('selenium-webdriver');
36
- * const firefox = require('selenium-webdriver/firefox');
37
- *
38
- * let profile = new firefox.Profile();
39
- * profile.addExtension('/path/to/firebug.xpi');
40
- * profile.setPreference('extensions.firebug.showChromeErrors', true);
41
- *
42
- * let options = new firefox.Options().setProfile(profile);
43
- * let driver = new Builder()
44
- * .forBrowser('firefox')
45
- * .setFirefoxOptions(options)
46
- * .build();
47
- *
48
- * The {@linkplain Profile} class may also be used to configure WebDriver based
49
- * on a pre-existing browser profile:
50
- *
51
- * let profile = new firefox.Profile(
52
- * '/usr/local/home/bob/.mozilla/firefox/3fgog75h.testing');
53
- * let options = new firefox.Options().setProfile(profile);
54
- *
55
- * The FirefoxDriver will _never_ modify a pre-existing profile; instead it will
56
- * create a copy for it to modify. By extension, there are certain browser
57
- * preferences that are required for WebDriver to function properly and they
58
- * will always be overwritten.
59
- *
60
- * __Using a Custom Firefox Binary__
61
- *
62
- * On Windows and MacOS, the FirefoxDriver will search for Firefox in its
63
- * default installation location:
64
- *
65
- * - Windows: C:\Program Files and C:\Program Files (x86).
66
- * - MacOS: /Applications/Firefox.app
67
- *
68
- * For Linux, Firefox will always be located on the PATH: `$(where firefox)`.
69
- *
70
- * Several methods are provided for starting Firefox with a custom executable.
71
- * First, on Windows and MacOS, you may configure WebDriver to check the default
72
- * install location for a non-release channel. If the requested channel cannot
73
- * be found in its default location, WebDriver will fallback to searching your
74
- * PATH. _Note:_ on Linux, Firefox is _always_ located on your path, regardless
75
- * of the requested channel.
76
- *
77
- * const {Builder} = require('selenium-webdriver');
78
- * const firefox = require('selenium-webdriver/firefox');
79
- *
80
- * let options = new firefox.Options().setBinary(firefox.Channel.NIGHTLY);
81
- * let driver = new Builder()
82
- * .forBrowser('firefox')
83
- * .setFirefoxOptions(options)
84
- * .build();
85
- *
86
- * On all platforms, you may configrue WebDriver to use a Firefox specific
87
- * executable:
88
- *
89
- * let options = new firefox.Options()
90
- * .setBinary('/my/firefox/install/dir/firefox-bin');
91
- *
92
- * __Remote Testing__
93
- *
94
- * You may customize the Firefox binary and profile when running against a
95
- * remote Selenium server. Your custom profile will be packaged as a zip and
96
- * transfered to the remote host for use. The profile will be transferred
97
- * _once for each new session_. The performance impact should be minimal if
98
- * you've only configured a few extra browser preferences. If you have a large
99
- * profile with several extensions, you should consider installing it on the
100
- * remote host and defining its path via the {@link Options} class. Custom
101
- * binaries are never copied to remote machines and must be referenced by
102
- * installation path.
103
- *
104
- * const {Builder} = require('selenium-webdriver');
105
- * const firefox = require('selenium-webdriver/firefox');
106
- *
107
- * let options = new firefox.Options()
108
- * .setProfile('/profile/path/on/remote/host')
109
- * .setBinary('/install/dir/on/remote/host/firefox-bin');
110
- *
111
- * let driver = new Builder()
112
- * .forBrowser('firefox')
113
- * .usingServer('http://127.0.0.1:4444/wd/hub')
114
- * .setFirefoxOptions(options)
115
- * .build();
116
- *
117
- * [geckodriver release]: https://github.com/mozilla/geckodriver/releases/
118
- * [PATH]: http://en.wikipedia.org/wiki/PATH_%28variable%29
119
- */
120
-
121
- 'use strict';
122
-
123
- const url = require('url');
124
-
125
- const {Binary, Channel} = require('./binary'),
126
- Profile = require('./profile').Profile,
127
- http = require('../http'),
128
- httpUtil = require('../http/util'),
129
- io = require('../io'),
130
- capabilities = require('../lib/capabilities'),
131
- command = require('../lib/command'),
132
- logging = require('../lib/logging'),
133
- promise = require('../lib/promise'),
134
- webdriver = require('../lib/webdriver'),
135
- net = require('../net'),
136
- portprober = require('../net/portprober'),
137
- remote = require('../remote');
138
-
139
-
140
- /**
141
- * Configuration options for the FirefoxDriver.
142
- */
143
- class Options {
144
- constructor() {
145
- /** @private {Profile} */
146
- this.profile_ = null;
147
-
148
- /** @private {(Binary|Channel|string|null)} */
149
- this.binary_ = null;
150
-
151
- /** @private {!Array<string>} */
152
- this.args_ = [];
153
-
154
- /** @private {logging.Preferences} */
155
- this.logPrefs_ = null;
156
-
157
- /** @private {?capabilities.ProxyConfig} */
158
- this.proxy_ = null;
159
- }
160
-
161
- /**
162
- * Specify additional command line arguments that should be used when starting
163
- * the Firefox browser.
164
- *
165
- * @param {...(string|!Array<string>)} args The arguments to include.
166
- * @return {!Options} A self reference.
167
- */
168
- addArguments(...args) {
169
- this.args_ = this.args_.concat(...args);
170
- return this;
171
- }
172
-
173
- /**
174
- * Configures the geckodriver to start Firefox in headless mode.
175
- *
176
- * @return {!Options} A self reference.
177
- */
178
- headless() {
179
- return this.addArguments('-headless');
180
- }
181
-
182
- /**
183
- * Sets the initial window size when running in
184
- * {@linkplain #headless headless} mode.
185
- *
186
- * @param {{width: number, height: number}} size The desired window size.
187
- * @return {!Options} A self reference.
188
- * @throws {TypeError} if width or height is unspecified, not a number, or
189
- * less than or equal to 0.
190
- */
191
- windowSize({width, height}) {
192
- function checkArg(arg) {
193
- if (typeof arg !== 'number' || arg <= 0) {
194
- throw TypeError('Arguments must be {width, height} with numbers > 0');
195
- }
196
- }
197
- checkArg(width);
198
- checkArg(height);
199
- return this.addArguments(`--window-size=${width},${height}`);
200
- }
201
-
202
- /**
203
- * Sets the profile to use. The profile may be specified as a
204
- * {@link Profile} object or as the path to an existing Firefox profile to use
205
- * as a template.
206
- *
207
- * @param {(string|!Profile)} profile The profile to use.
208
- * @return {!Options} A self reference.
209
- */
210
- setProfile(profile) {
211
- if (typeof profile === 'string') {
212
- profile = new Profile(profile);
213
- }
214
- this.profile_ = profile;
215
- return this;
216
- }
217
-
218
- /**
219
- * Sets the binary to use. The binary may be specified as the path to a
220
- * Firefox executable, a specific {@link Channel}, or as a {@link Binary}
221
- * object.
222
- *
223
- * @param {(string|!Binary|!Channel)} binary The binary to use.
224
- * @return {!Options} A self reference.
225
- * @throws {TypeError} If `binary` is an invalid type.
226
- */
227
- setBinary(binary) {
228
- if (binary instanceof Binary
229
- || binary instanceof Channel
230
- || typeof binary === 'string') {
231
- this.binary_ = binary;
232
- return this;
233
- }
234
- throw TypeError(
235
- 'binary must be a string path, Channel, or Binary object');
236
- }
237
-
238
- /**
239
- * Sets the logging preferences for the new session.
240
- * @param {logging.Preferences} prefs The logging preferences.
241
- * @return {!Options} A self reference.
242
- */
243
- setLoggingPreferences(prefs) {
244
- this.logPrefs_ = prefs;
245
- return this;
246
- }
247
-
248
- /**
249
- * Sets the proxy to use.
250
- *
251
- * @param {capabilities.ProxyConfig} proxy The proxy configuration to use.
252
- * @return {!Options} A self reference.
253
- */
254
- setProxy(proxy) {
255
- this.proxy_ = proxy;
256
- return this;
257
- }
258
-
259
- /**
260
- * Converts these options to a {@link capabilities.Capabilities} instance.
261
- *
262
- * @return {!capabilities.Capabilities} A new capabilities object.
263
- */
264
- toCapabilities() {
265
- let caps = capabilities.Capabilities.firefox();
266
- let firefoxOptions = {};
267
- caps.set('moz:firefoxOptions', firefoxOptions);
268
-
269
- if (this.logPrefs_) {
270
- caps.set(capabilities.Capability.LOGGING_PREFS, this.logPrefs_);
271
- }
272
-
273
- if (this.proxy_) {
274
- caps.set(capabilities.Capability.PROXY, this.proxy_);
275
- }
276
-
277
- if (this.args_.length) {
278
- firefoxOptions['args'] = this.args_.concat();
279
- }
280
-
281
- if (this.binary_) {
282
- if (this.binary_ instanceof Binary) {
283
- let exe = this.binary_.getExe();
284
- if (exe) {
285
- firefoxOptions['binary'] = exe;
286
- }
287
-
288
- let args = this.binary_.getArguments();
289
- if (args.length) {
290
- if (this.args_.length) {
291
- throw Error(
292
- 'You may specify browser arguments with Options.addArguments'
293
- + ' (preferred) or Binary.addArguments, but not both');
294
- }
295
- firefoxOptions['args'] = args;
296
- }
297
- } else if (this.binary_ instanceof Channel) {
298
- firefoxOptions['binary'] = this.binary_.locate();
299
-
300
- } else if (typeof this.binary_ === 'string') {
301
- firefoxOptions['binary'] = this.binary_;
302
- }
303
- }
304
-
305
- if (this.profile_) {
306
- // If the user specified a template directory or any extensions to
307
- // install, we need to encode the profile as a base64 string (which
308
- // requires writing it to disk first). Otherwise, if the user just
309
- // specified some custom preferences, we can send those directly.
310
- let profile = this.profile_;
311
- if (profile.getTemplateDir() || profile.getExtensions().length) {
312
- firefoxOptions['profile'] = profile.encode();
313
-
314
- } else {
315
- let prefs = profile.getPreferences();
316
- if (Object.keys(prefs).length) {
317
- firefoxOptions['prefs'] = prefs;
318
- }
319
- }
320
- }
321
-
322
- return caps;
323
- }
324
- }
325
-
326
-
327
- /**
328
- * Enum of available command contexts.
329
- *
330
- * Command contexts are specific to Marionette, and may be used with the
331
- * {@link #context=} method. Contexts allow you to direct all subsequent
332
- * commands to either "content" (default) or "chrome". The latter gives
333
- * you elevated security permissions.
334
- *
335
- * @enum {string}
336
- */
337
- const Context = {
338
- CONTENT: "content",
339
- CHROME: "chrome",
340
- };
341
-
342
-
343
- const GECKO_DRIVER_EXE =
344
- process.platform === 'win32' ? 'geckodriver.exe' : 'geckodriver';
345
-
346
-
347
- /**
348
- * @return {string} .
349
- * @throws {Error}
350
- */
351
- function findGeckoDriver() {
352
- let exe = io.findInPath(GECKO_DRIVER_EXE, true);
353
- if (!exe) {
354
- throw Error(
355
- 'The ' + GECKO_DRIVER_EXE + ' executable could not be found on the current ' +
356
- 'PATH. Please download the latest version from ' +
357
- 'https://github.com/mozilla/geckodriver/releases/ ' +
358
- 'and ensure it can be found on your PATH.');
359
- }
360
- return exe;
361
- }
362
-
363
-
364
- function normalizeProxyConfiguration(config) {
365
- if ('manual' === config.proxyType) {
366
- if (config.ftpProxy && !config.ftpProxyPort) {
367
- let hostAndPort = net.splitHostAndPort(config.ftpProxy);
368
- config.ftpProxy = hostAndPort.host;
369
- config.ftpProxyPort = hostAndPort.port;
370
- }
371
-
372
- if (config.httpProxy && !config.httpProxyPort) {
373
- let hostAndPort = net.splitHostAndPort(config.httpProxy);
374
- config.httpProxy = hostAndPort.host;
375
- config.httpProxyPort = hostAndPort.port;
376
- }
377
-
378
- if (config.sslProxy && !config.sslProxyPort) {
379
- let hostAndPort = net.splitHostAndPort(config.sslProxy);
380
- config.sslProxy = hostAndPort.host;
381
- config.sslProxyPort = hostAndPort.port;
382
- }
383
-
384
- if (config.socksProxy && !config.socksProxyPort) {
385
- let hostAndPort = net.splitHostAndPort(config.socksProxy);
386
- config.socksProxy = hostAndPort.host;
387
- config.socksProxyPort = hostAndPort.port;
388
- }
389
- } else if ('pac' === config.proxyType) {
390
- if (config.proxyAutoconfigUrl && !config.pacUrl) {
391
- config.pacUrl = config.proxyAutoconfigUrl;
392
- }
393
- }
394
- return config;
395
- }
396
-
397
-
398
- /** @enum {string} */
399
- const ExtensionCommand = {
400
- GET_CONTEXT: 'getContext',
401
- SET_CONTEXT: 'setContext',
402
- };
403
-
404
-
405
- /**
406
- * Creates a command executor with support for Marionette's custom commands.
407
- * @param {!Promise<string>} serverUrl The server's URL.
408
- * @return {!command.Executor} The new command executor.
409
- */
410
- function createExecutor(serverUrl) {
411
- let client = serverUrl.then(url => new http.HttpClient(url));
412
- let executor = new http.Executor(client);
413
- configureExecutor(executor);
414
- return executor;
415
- }
416
-
417
-
418
- /**
419
- * Configures the given executor with Firefox-specific commands.
420
- * @param {!http.Executor} executor the executor to configure.
421
- */
422
- function configureExecutor(executor) {
423
- executor.defineCommand(
424
- ExtensionCommand.GET_CONTEXT,
425
- 'GET',
426
- '/session/:sessionId/moz/context');
427
-
428
- executor.defineCommand(
429
- ExtensionCommand.SET_CONTEXT,
430
- 'POST',
431
- '/session/:sessionId/moz/context');
432
- }
433
-
434
-
435
- /**
436
- * Creates {@link selenium-webdriver/remote.DriverService} instances that manage
437
- * a [geckodriver](https://github.com/mozilla/geckodriver) server in a child
438
- * process.
439
- */
440
- class ServiceBuilder extends remote.DriverService.Builder {
441
- /**
442
- * @param {string=} opt_exe Path to the server executable to use. If omitted,
443
- * the builder will attempt to locate the geckodriver on the system PATH.
444
- */
445
- constructor(opt_exe) {
446
- super(opt_exe || findGeckoDriver());
447
- this.setLoopback(true); // Required.
448
- }
449
-
450
- /**
451
- * Enables verbose logging.
452
- *
453
- * @param {boolean=} opt_trace Whether to enable trace-level logging. By
454
- * default, only debug logging is enabled.
455
- * @return {!ServiceBuilder} A self reference.
456
- */
457
- enableVerboseLogging(opt_trace) {
458
- return this.addArguments(opt_trace ? '-vv' : '-v');
459
- }
460
- }
461
-
462
-
463
- /**
464
- * A WebDriver client for Firefox.
465
- */
466
- class Driver extends webdriver.WebDriver {
467
- /**
468
- * Creates a new Firefox session.
469
- *
470
- * @param {(Options|capabilities.Capabilities|Object)=} opt_config The
471
- * configuration options for this driver, specified as either an
472
- * {@link Options} or {@link capabilities.Capabilities}, or as a raw hash
473
- * object.
474
- * @param {(http.Executor|remote.DriverService)=} opt_executor Either a
475
- * pre-configured command executor to use for communicating with an
476
- * externally managed remote end (which is assumed to already be running),
477
- * or the `DriverService` to use to start the geckodriver in a child
478
- * process.
479
- *
480
- * If an executor is provided, care should e taken not to use reuse it with
481
- * other clients as its internal command mappings will be updated to support
482
- * Firefox-specific commands.
483
- *
484
- * _This parameter may only be used with Mozilla's GeckoDriver._
485
- *
486
- * @param {promise.ControlFlow=} opt_flow The flow to
487
- * schedule commands through. Defaults to the active flow object.
488
- * @throws {Error} If a custom command executor is provided and the driver is
489
- * configured to use the legacy FirefoxDriver from the Selenium project.
490
- * @return {!Driver} A new driver instance.
491
- */
492
- static createSession(opt_config, opt_executor, opt_flow) {
493
- let caps;
494
- if (opt_config instanceof Options) {
495
- caps = opt_config.toCapabilities();
496
- } else {
497
- caps = new capabilities.Capabilities(opt_config);
498
- }
499
-
500
- if (caps.has(capabilities.Capability.PROXY)) {
501
- let proxy =
502
- normalizeProxyConfiguration(caps.get(capabilities.Capability.PROXY));
503
- caps.set(capabilities.Capability.PROXY, proxy);
504
- }
505
-
506
- let executor;
507
- let onQuit;
508
-
509
- if (opt_executor instanceof http.Executor) {
510
- executor = opt_executor;
511
- configureExecutor(executor);
512
- } else if (opt_executor instanceof remote.DriverService) {
513
- executor = createExecutor(opt_executor.start());
514
- onQuit = () => opt_executor.kill();
515
- } else {
516
- let service = new ServiceBuilder().build();
517
- executor = createExecutor(service.start());
518
- onQuit = () => service.kill();
519
- }
520
-
521
- return /** @type {!Driver} */(super.createSession(
522
- executor, caps, opt_flow, onQuit));
523
- }
524
-
525
- /**
526
- * This function is a no-op as file detectors are not supported by this
527
- * implementation.
528
- * @override
529
- */
530
- setFileDetector() {
531
- }
532
-
533
- /**
534
- * Get the context that is currently in effect.
535
- *
536
- * @return {!promise.Thenable<Context>} Current context.
537
- */
538
- getContext() {
539
- return this.schedule(
540
- new command.Command(ExtensionCommand.GET_CONTEXT),
541
- 'get WebDriver.context');
542
- }
543
-
544
- /**
545
- * Changes target context for commands between chrome- and content.
546
- *
547
- * Changing the current context has a stateful impact on all subsequent
548
- * commands. The {@link Context.CONTENT} context has normal web
549
- * platform document permissions, as if you would evaluate arbitrary
550
- * JavaScript. The {@link Context.CHROME} context gets elevated
551
- * permissions that lets you manipulate the browser chrome itself,
552
- * with full access to the XUL toolkit.
553
- *
554
- * Use your powers wisely.
555
- *
556
- * @param {!promise.Thenable<void>} ctx The context to switch to.
557
- */
558
- setContext(ctx) {
559
- return this.schedule(
560
- new command.Command(ExtensionCommand.SET_CONTEXT)
561
- .setParameter("context", ctx),
562
- 'set WebDriver.context');
563
- }
564
- }
565
-
566
-
567
- // PUBLIC API
568
-
569
-
570
- exports.Binary = Binary;
571
- exports.Channel = Channel;
572
- exports.Context = Context;
573
- exports.Driver = Driver;
574
- exports.Options = Options;
575
- exports.Profile = Profile;
576
- exports.ServiceBuilder = ServiceBuilder;