From 1f88231e2bdc79f2aecf23e1412a95e116583864 Mon Sep 17 00:00:00 2001 From: Puja Jagani Date: Mon, 1 Apr 2024 10:19:16 +0530 Subject: [PATCH] [js] Fix linting (#13753) --- javascript/node/selenium-webdriver/test/bidi/script_test.js | 6 ------ .../selenium-webdriver/test/bidi/setFiles_command_test.js | 2 +- .../node/selenium-webdriver/test/bidi/storage_test.js | 2 +- javascript/node/selenium-webdriver/test/driver_factory.js | 5 +++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/javascript/node/selenium-webdriver/test/bidi/script_test.js b/javascript/node/selenium-webdriver/test/bidi/script_test.js index 9e31d18703f55..8f64270704d6c 100644 --- a/javascript/node/selenium-webdriver/test/bidi/script_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/script_test.js @@ -586,7 +586,6 @@ suite( }) it('can access preload script properties', async function () { - const id = await driver.getWindowHandle() const manager = await ScriptManager([], driver) await manager.addPreloadScript('() => { window.preloadScriptFunction = () => window.baz = 42; }') @@ -602,7 +601,6 @@ suite( }) it('can add preload script to sandbox', async function () { - const id = await driver.getWindowHandle() const manager = await ScriptManager([], driver) await manager.addPreloadScript('() => { window.foo = 1; }') @@ -638,7 +636,6 @@ suite( }) it('can remove properties set by preload script', async function () { - const id = await driver.getWindowHandle() const manager = await ScriptManager([], driver) await manager.addPreloadScript('() => { window.foo = 42; }') @@ -657,7 +654,6 @@ suite( }) it('can remove preload script', async function () { - const id = await driver.getWindowHandle() const manager = await ScriptManager([], driver) let script = await manager.addPreloadScript("() => { window.foo='bar'; }") @@ -682,7 +678,6 @@ suite( }) it('cannot remove same preload script twice', async function () { - const id = await driver.getWindowHandle() const manager = await ScriptManager([], driver) let script = await manager.addPreloadScript("() => { window.foo='bar'; }") @@ -695,7 +690,6 @@ suite( }) it('can remove one of preload script', async function () { - const id = await driver.getWindowHandle() const manager = await ScriptManager([], driver) let script_1 = await manager.addPreloadScript("() => { window.bar='foo'; }") diff --git a/javascript/node/selenium-webdriver/test/bidi/setFiles_command_test.js b/javascript/node/selenium-webdriver/test/bidi/setFiles_command_test.js index cc855c078840c..185bfec99c840 100644 --- a/javascript/node/selenium-webdriver/test/bidi/setFiles_command_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/setFiles_command_test.js @@ -24,8 +24,8 @@ const { Pages, suite } = require('../../lib/test') const { Browser, By } = require('../..') const Input = require('../../bidi/input') const io = require('../../io') -const fs = require('node:fs') const { ReferenceValue, RemoteReferenceType } = require('../../bidi/protocolValue') +const fs = require('fs') suite( function (env) { diff --git a/javascript/node/selenium-webdriver/test/bidi/storage_test.js b/javascript/node/selenium-webdriver/test/bidi/storage_test.js index 1c20b83c9c95e..8c4fac523fb38 100644 --- a/javascript/node/selenium-webdriver/test/bidi/storage_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/storage_test.js @@ -20,7 +20,7 @@ const assert = require('assert') require('../../lib/test/fileserver') const firefox = require('../../firefox') -const { ignore, suite } = require('../../lib/test') +const { suite } = require('../../lib/test') const { Browser } = require('../..') const Storage = require('../../bidi/storage') const fileserver = require('../../lib/test/fileserver') diff --git a/javascript/node/selenium-webdriver/test/driver_factory.js b/javascript/node/selenium-webdriver/test/driver_factory.js index fd103894bbdd0..32e2d2ea9c8da 100644 --- a/javascript/node/selenium-webdriver/test/driver_factory.js +++ b/javascript/node/selenium-webdriver/test/driver_factory.js @@ -19,10 +19,11 @@ const fs = require('fs') const os = require('os') const path = require('path') -const { Builder, Browser } = require('../index') +const { Browser } = require('../index') const { Environment } = require('../testing') const chrome = require('../chrome') const firefox = require('../firefox') +// eslint-disable-next-line node/no-missing-require const { runfiles } = require('@bazel/runfiles') function GetBrowserForTests() { @@ -90,7 +91,7 @@ function GetBrowserForTests() { break case 'safari': - builder.forBrowser(webdriver.Browser.SAFARI) + builder.forBrowser(Browser.SAFARI) break default: