Skip to content

Commit 6d2a782

Browse files
committed
[JS] Fixes lint issues and updates npm packages
1 parent b0057b5 commit 6d2a782

33 files changed

+830
-1329
lines changed

javascript/node/selenium-webdriver/chrome.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,8 @@ Driver.prototype.VENDOR_COMMAND_PREFIX = 'goog'
290290
module.exports = {
291291
Driver: Driver,
292292
Options,
293-
ServiceBuilder ,
293+
ServiceBuilder,
294294
getDefaultService,
295295
setDefaultService,
296-
locateSynchronously
296+
locateSynchronously,
297297
}
298-

javascript/node/selenium-webdriver/chromium.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ class Driver extends webdriver.WebDriver {
860860
* @return {!promise.Thenable<void>} A promise that will be resolved
861861
* when the mirror command has been issued to the device.
862862
*/
863-
startDesktopMirroring(deviceName) {
863+
startDesktopMirroring(deviceName) {
864864
return this.schedule(
865865
new command.Command(Command.START_CAST_DESKTOP_MIRRORING).setParameter(
866866
'sinkName',

javascript/node/selenium-webdriver/devtools/CDPConnection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CDPConnection {
1919
constructor(wsConnection) {
2020
this._wsConnection = wsConnection
2121
this.cmd_id = 0
22-
this.targetID = null;
22+
this.targetID = null
2323
this.sessionId = null
2424
}
2525

javascript/node/selenium-webdriver/firefox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ class Driver extends webdriver.WebDriver {
672672
*/
673673
async installAddon(path, temporary = false) {
674674
let stats = fs.statSync(path)
675-
let buf;
675+
let buf
676676
if (stats.isDirectory()) {
677677
let zip = new Zip()
678678
await zip.addDir(path)

javascript/node/selenium-webdriver/ie.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,9 @@ function createServiceFromCapabilities(capabilities) {
402402
if (!exe || !fs.existsSync(exe)) {
403403
throw Error(
404404
`${IEDRIVER_EXE} could not be found on the current PATH. Please ` +
405-
`download the latest version of ${IEDRIVER_EXE} from ` +
406-
'https://www.selenium.dev/downloads/ and ' +
407-
'ensure it can be found on your system PATH.'
405+
`download the latest version of ${IEDRIVER_EXE} from ` +
406+
'https://www.selenium.dev/downloads/ and ' +
407+
'ensure it can be found on your system PATH.'
408408
)
409409
}
410410

javascript/node/selenium-webdriver/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function startSeleniumServer(jar) {
7777
function ensureFileDetectorsAreEnabled(ctor) {
7878
return class extends ctor {
7979
/** @param {input.FileDetector} detector */
80-
setFileDetector (detector) {
80+
setFileDetector(detector) {
8181
webdriver.WebDriver.prototype.setFileDetector.call(this, detector)
8282
}
8383
}

javascript/node/selenium-webdriver/lib/command.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ const Name = {
165165
FIND_ELEMENTS_FROM_SHADOWROOT: 'findElementsFromShadowRoot',
166166

167167
// Virtual Authenticator Commands
168-
ADD_VIRTUAL_AUTHENTICATOR : 'addVirtualAuthenticator',
169-
REMOVE_VIRTUAL_AUTHENTICATOR : 'removeVirtualAuthenticator',
170-
ADD_CREDENTIAL : 'addCredential',
171-
GET_CREDENTIALS : 'getCredentials',
172-
REMOVE_CREDENTIAL : 'removeCredential',
173-
REMOVE_ALL_CREDENTIALS : 'removeAllCredentials',
174-
SET_USER_VERIFIED : 'setUserVerified',
168+
ADD_VIRTUAL_AUTHENTICATOR: 'addVirtualAuthenticator',
169+
REMOVE_VIRTUAL_AUTHENTICATOR: 'removeVirtualAuthenticator',
170+
ADD_CREDENTIAL: 'addCredential',
171+
GET_CREDENTIALS: 'getCredentials',
172+
REMOVE_CREDENTIAL: 'removeCredential',
173+
REMOVE_ALL_CREDENTIALS: 'removeAllCredentials',
174+
SET_USER_VERIFIED: 'setUserVerified',
175175

176176
GET_AVAILABLE_LOG_TYPES: 'getAvailableLogTypes',
177177
GET_LOG: 'getLog',

javascript/node/selenium-webdriver/lib/http.js

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,42 @@ const W3C_COMMAND_MAP = new Map([
349349
[cmd.Name.UPLOAD_FILE, post('/session/:sessionId/se/file')],
350350

351351
// Virtual Authenticator
352-
[cmd.Name.ADD_VIRTUAL_AUTHENTICATOR, post('/session/:sessionId/webauthn/authenticator')],
353-
[cmd.Name.REMOVE_VIRTUAL_AUTHENTICATOR, del('/session/:sessionId/webauthn/authenticator/:authenticatorId')],
354-
[cmd.Name.ADD_CREDENTIAL, post('/session/:sessionId/webauthn/authenticator/:authenticatorId/credential')],
355-
[cmd.Name.GET_CREDENTIALS, get('/session/:sessionId/webauthn/authenticator/:authenticatorId/credentials')],
356-
[cmd.Name.REMOVE_CREDENTIAL, del('/session/:sessionId/webauthn/authenticator/:authenticatorId/credentials/:credentialId')],
357-
[cmd.Name.REMOVE_ALL_CREDENTIALS, del('/session/:sessionId/webauthn/authenticator/:authenticatorId/credentials')],
358-
[cmd.Name.SET_USER_VERIFIED, post('/session/:sessionId/webauthn/authenticator/:authenticatorId/uv')],
352+
[
353+
cmd.Name.ADD_VIRTUAL_AUTHENTICATOR,
354+
post('/session/:sessionId/webauthn/authenticator'),
355+
],
356+
[
357+
cmd.Name.REMOVE_VIRTUAL_AUTHENTICATOR,
358+
del('/session/:sessionId/webauthn/authenticator/:authenticatorId'),
359+
],
360+
[
361+
cmd.Name.ADD_CREDENTIAL,
362+
post(
363+
'/session/:sessionId/webauthn/authenticator/:authenticatorId/credential'
364+
),
365+
],
366+
[
367+
cmd.Name.GET_CREDENTIALS,
368+
get(
369+
'/session/:sessionId/webauthn/authenticator/:authenticatorId/credentials'
370+
),
371+
],
372+
[
373+
cmd.Name.REMOVE_CREDENTIAL,
374+
del(
375+
'/session/:sessionId/webauthn/authenticator/:authenticatorId/credentials/:credentialId'
376+
),
377+
],
378+
[
379+
cmd.Name.REMOVE_ALL_CREDENTIALS,
380+
del(
381+
'/session/:sessionId/webauthn/authenticator/:authenticatorId/credentials'
382+
),
383+
],
384+
[
385+
cmd.Name.SET_USER_VERIFIED,
386+
post('/session/:sessionId/webauthn/authenticator/:authenticatorId/uv'),
387+
],
359388
])
360389

361390
/**

javascript/node/selenium-webdriver/lib/input.js

Lines changed: 61 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,30 @@ class Pointer extends Device {
349349
* @return {!Action} An action to press the specified button with this device.
350350
* @package
351351
*/
352-
press(button = Button.LEFT, width = 0, height = 0, pressure = 0,
353-
tangentialPressure = 0, tiltX = 0, tiltY = 0, twist = 0,
354-
altitudeAngle = 0, azimuthAngle = 0) {
352+
press(
353+
button = Button.LEFT,
354+
width = 0,
355+
height = 0,
356+
pressure = 0,
357+
tangentialPressure = 0,
358+
tiltX = 0,
359+
tiltY = 0,
360+
twist = 0,
361+
altitudeAngle = 0,
362+
azimuthAngle = 0
363+
) {
355364
return {
356-
type: Action.Type.POINTER_DOWN, button, width, height,
357-
pressure, tangentialPressure, tiltX, tiltY, twist,
358-
altitudeAngle, azimuthAngle
365+
type: Action.Type.POINTER_DOWN,
366+
button,
367+
width,
368+
height,
369+
pressure,
370+
tangentialPressure,
371+
tiltX,
372+
tiltY,
373+
twist,
374+
altitudeAngle,
375+
azimuthAngle,
359376
}
360377
}
361378

@@ -385,15 +402,36 @@ class Pointer extends Device {
385402
* @return {!Action} The new action.
386403
* @package
387404
*/
388-
move({ x = 0, y = 0, duration = 100, origin = Origin.VIEWPORT,
389-
width = 0, height = 0, pressure = 0,
390-
tangentialPressure = 0, tiltX = 0, tiltY = 0, twist = 0,
391-
altitudeAngle = 0, azimuthAngle = 0
405+
move({
406+
x = 0,
407+
y = 0,
408+
duration = 100,
409+
origin = Origin.VIEWPORT,
410+
width = 0,
411+
height = 0,
412+
pressure = 0,
413+
tangentialPressure = 0,
414+
tiltX = 0,
415+
tiltY = 0,
416+
twist = 0,
417+
altitudeAngle = 0,
418+
azimuthAngle = 0,
392419
}) {
393420
return {
394-
type: Action.Type.POINTER_MOVE, origin, duration, x, y,
395-
width, height, pressure, tangentialPressure, tiltX, tiltY, twist,
396-
altitudeAngle, azimuthAngle
421+
type: Action.Type.POINTER_MOVE,
422+
origin,
423+
duration,
424+
x,
425+
y,
426+
width,
427+
height,
428+
pressure,
429+
tangentialPressure,
430+
tiltX,
431+
tiltY,
432+
twist,
433+
altitudeAngle,
434+
azimuthAngle,
397435
}
398436
}
399437
}
@@ -429,9 +467,12 @@ class Wheel extends Device {
429467
scroll(x, y, deltaX, deltaY, origin, duration) {
430468
return {
431469
type: Action.Type.SCROLL,
432-
duration: duration, x: x, y: y,
433-
deltaX: deltaX, deltaY: deltaY,
434-
origin: origin
470+
duration: duration,
471+
x: x,
472+
y: y,
473+
deltaX: deltaX,
474+
deltaY: deltaY,
475+
origin: origin,
435476
}
436477
}
437478
}
@@ -798,7 +839,10 @@ class Actions {
798839
* @returns {!Action} An action to scroll with this device.
799840
*/
800841
scroll(x, y, targetDeltaX, targetDeltaY, origin, duration) {
801-
return this.insert(this.wheel_, this.wheel_.scroll(x, y, targetDeltaX, targetDeltaY, origin, duration))
842+
return this.insert(
843+
this.wheel_,
844+
this.wheel_.scroll(x, y, targetDeltaX, targetDeltaY, origin, duration)
845+
)
802846
}
803847

804848
/**

javascript/node/selenium-webdriver/lib/virtual_authenticator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class VirtualAuthenticatorOptions {
2727
"CTAP2": 'ctap2',
2828
"U2F": 'ctap1/u2f',
2929
}
30-
30+
3131
static Transport = {
3232
"BLE": 'ble',
3333
"USB": 'usb',

0 commit comments

Comments
 (0)