Skip to content

Commit fdb9c27

Browse files
committed
[js] Running format script
1 parent 0795c03 commit fdb9c27

File tree

7 files changed

+1911
-1972
lines changed

7 files changed

+1911
-1972
lines changed

javascript/node/selenium-webdriver/chrome.js

+84-85
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@
122122
* @module selenium-webdriver/chrome
123123
*/
124124

125-
"use strict";
125+
'use strict'
126126

127-
const { Browser } = require("./lib/capabilities");
128-
const chromium = require("./chromium");
129-
const CHROME_CAPABILITY_KEY = "goog:chromeOptions";
127+
const { Browser } = require('./lib/capabilities')
128+
const chromium = require('./chromium')
129+
const CHROME_CAPABILITY_KEY = 'goog:chromeOptions'
130130

131131
/** @type {remote.DriverService} */
132132

@@ -136,105 +136,104 @@ const CHROME_CAPABILITY_KEY = "goog:chromeOptions";
136136
* server in a child process.
137137
*/
138138
class ServiceBuilder extends chromium.ServiceBuilder {
139-
/**
140-
* @param {string=} opt_exe Path to the server executable to use. If omitted,
141-
* the builder will attempt to locate the chromedriver on the current
142-
* PATH. If the chromedriver is not available in path, selenium-manager will
143-
* download the chromedriver
144-
* @throws {Error} If provided executable does not exist, or the chromedriver
145-
* cannot be found on the PATH.
146-
*/
147-
constructor (opt_exe) {
148-
super(opt_exe);
149-
}
139+
/**
140+
* @param {string=} opt_exe Path to the server executable to use. If omitted,
141+
* the builder will attempt to locate the chromedriver on the current
142+
* PATH. If the chromedriver is not available in path, selenium-manager will
143+
* download the chromedriver
144+
* @throws {Error} If provided executable does not exist, or the chromedriver
145+
* cannot be found on the PATH.
146+
*/
147+
constructor(opt_exe) {
148+
super(opt_exe)
149+
}
150150
}
151151

152152
/**
153153
* Class for managing ChromeDriver specific options.
154154
*/
155155
class Options extends chromium.Options {
156-
/**
157-
* Sets the path to the Chrome binary to use. On Mac OS X, this path should
158-
* reference the actual Chrome executable, not just the application binary
159-
* (e.g. "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome").
160-
*
161-
* The binary path be absolute or relative to the chromedriver server
162-
* executable, but it must exist on the machine that will launch Chrome.
163-
*
164-
* @param {string} path The path to the Chrome binary to use.
165-
* @return {!Options} A self reference.
166-
*/
167-
setChromeBinaryPath (path) {
168-
return this.setBinaryPath(path);
169-
}
156+
/**
157+
* Sets the path to the Chrome binary to use. On Mac OS X, this path should
158+
* reference the actual Chrome executable, not just the application binary
159+
* (e.g. "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome").
160+
*
161+
* The binary path be absolute or relative to the chromedriver server
162+
* executable, but it must exist on the machine that will launch Chrome.
163+
*
164+
* @param {string} path The path to the Chrome binary to use.
165+
* @return {!Options} A self reference.
166+
*/
167+
setChromeBinaryPath(path) {
168+
return this.setBinaryPath(path)
169+
}
170170

171-
/**
172-
* Configures the ChromeDriver to launch Chrome on Android via adb. This
173-
* function is shorthand for
174-
* {@link #androidPackage options.androidPackage('com.android.chrome')}.
175-
* @return {!Options} A self reference.
176-
*/
177-
androidChrome () {
178-
return this.androidPackage("com.android.chrome");
179-
}
171+
/**
172+
* Configures the ChromeDriver to launch Chrome on Android via adb. This
173+
* function is shorthand for
174+
* {@link #androidPackage options.androidPackage('com.android.chrome')}.
175+
* @return {!Options} A self reference.
176+
*/
177+
androidChrome() {
178+
return this.androidPackage('com.android.chrome')
179+
}
180180

181-
/**
182-
* Sets the path to Chrome's log file. This path should exist on the machine
183-
* that will launch Chrome.
184-
* @param {string} path Path to the log file to use.
185-
* @return {!Options} A self reference.
186-
*/
187-
setChromeLogFile (path) {
188-
return this.setBrowserLogFile(path);
189-
}
181+
/**
182+
* Sets the path to Chrome's log file. This path should exist on the machine
183+
* that will launch Chrome.
184+
* @param {string} path Path to the log file to use.
185+
* @return {!Options} A self reference.
186+
*/
187+
setChromeLogFile(path) {
188+
return this.setBrowserLogFile(path)
189+
}
190190

191-
/**
192-
* Sets the directory to store Chrome minidumps in. This option is only
193-
* supported when ChromeDriver is running on Linux.
194-
* @param {string} path The directory path.
195-
* @return {!Options} A self reference.
196-
*/
197-
setChromeMinidumpPath (path) {
198-
return this.setBrowserMinidumpPath(path);
199-
}
191+
/**
192+
* Sets the directory to store Chrome minidumps in. This option is only
193+
* supported when ChromeDriver is running on Linux.
194+
* @param {string} path The directory path.
195+
* @return {!Options} A self reference.
196+
*/
197+
setChromeMinidumpPath(path) {
198+
return this.setBrowserMinidumpPath(path)
199+
}
200200
}
201201

202202
/**
203203
* Creates a new WebDriver client for Chrome.
204204
*/
205205
class Driver extends chromium.Driver {
206-
/**
207-
* Creates a new session with the ChromeDriver.
208-
*
209-
* @param {(Capabilities|Options)=} opt_config The configuration options.
210-
* @param {(remote.DriverService|http.Executor)=} opt_serviceExecutor Either
211-
* a DriverService to use for the remote end, or a preconfigured executor
212-
* for an externally managed endpoint. If neither is provided, the
213-
* {@linkplain ##getDefaultService default service} will be used by
214-
* default.
215-
* @return {!Driver} A new driver instance.
216-
*/
217-
static createSession (opt_config, opt_serviceExecutor) {
218-
let caps = opt_config || new Options();
219-
return /** @type {!Driver} */ (super.createSession(caps,
220-
opt_serviceExecutor, "goog", CHROME_CAPABILITY_KEY));
221-
}
206+
/**
207+
* Creates a new session with the ChromeDriver.
208+
*
209+
* @param {(Capabilities|Options)=} opt_config The configuration options.
210+
* @param {(remote.DriverService|http.Executor)=} opt_serviceExecutor Either
211+
* a DriverService to use for the remote end, or a preconfigured executor
212+
* for an externally managed endpoint. If neither is provided, the
213+
* {@linkplain ##getDefaultService default service} will be used by
214+
* default.
215+
* @return {!Driver} A new driver instance.
216+
*/
217+
static createSession(opt_config, opt_serviceExecutor) {
218+
let caps = opt_config || new Options()
219+
return /** @type {!Driver} */ (super.createSession(caps, opt_serviceExecutor, 'goog', CHROME_CAPABILITY_KEY))
220+
}
222221

223-
/**
224-
* returns new instance chrome driver service
225-
* @returns {remote.DriverService}
226-
*/
227-
static getDefaultService () {
228-
return new ServiceBuilder().build();
229-
}
222+
/**
223+
* returns new instance chrome driver service
224+
* @returns {remote.DriverService}
225+
*/
226+
static getDefaultService() {
227+
return new ServiceBuilder().build()
228+
}
230229
}
231230

232-
Options.prototype.CAPABILITY_KEY = CHROME_CAPABILITY_KEY;
233-
Options.prototype.BROWSER_NAME_VALUE = Browser.CHROME;
231+
Options.prototype.CAPABILITY_KEY = CHROME_CAPABILITY_KEY
232+
Options.prototype.BROWSER_NAME_VALUE = Browser.CHROME
234233

235234
// PUBLIC API
236235
module.exports = {
237-
Driver,
238-
Options,
239-
ServiceBuilder
240-
};
236+
Driver,
237+
Options,
238+
ServiceBuilder,
239+
}

0 commit comments

Comments
 (0)