diff --git a/javascript/node/selenium-webdriver/test/builder_test.js b/javascript/node/selenium-webdriver/test/builder_test.js index ead53a34f670f..a9bccf93f9792 100644 --- a/javascript/node/selenium-webdriver/test/builder_test.js +++ b/javascript/node/selenium-webdriver/test/builder_test.js @@ -21,13 +21,14 @@ const assert = require('assert') const chrome = require('../chrome') const edge = require('../edge') +const error = require('../lib/error') const firefox = require('../firefox') const ie = require('../ie') const safari = require('../safari') const test = require('../lib/test') const { Browser } = require('../lib/capabilities') const { Pages } = require('../lib/test') -const { Builder } = require('../../selenium-webdriver/index') +const { Builder, Capabilities } = require('..') test.suite(function (env) { const BROWSER_MAP = new Map([ @@ -92,31 +93,31 @@ test.suite(function (env) { async function getCaps(driver) { return driver.getCapabilities(); } -}) - -describe('Builder', function () { - describe('catches incorrect use of browser options class', function () { - function test(key, options) { - it(key, async function () { - let builder = new Builder().withCapabilities( - new Capabilities() - .set('browserName', 'fake-browser-should-not-try-to-start') - .set(key, new options()) - ) - try { - let driver = await builder.build() - await driver.quit() - return Promise.reject(Error('should have failed')) - } catch (ex) { - if (!(ex instanceof error.InvalidArgumentError)) { - throw ex + + describe('Builder', function () { + describe('catches incorrect use of browser options class', function () { + function test(key, options) { + it(key, async function () { + let builder = new Builder().withCapabilities( + new Capabilities() + .set('browserName', 'fake-browser-should-not-try-to-start') + .set(key, new options()) + ) + try { + let driver = await builder.build() + await driver.quit() + return Promise.reject(Error('should have failed')) + } catch (ex) { + if (!(ex instanceof error.InvalidArgumentError)) { + throw ex + } } - } - }) - } + }) + } - test('chromeOptions', chrome.Options) - test('moz:firefoxOptions', firefox.Options) - test('safari.options', safari.Options) + test('chromeOptions', chrome.Options) + test('moz:firefoxOptions', firefox.Options) + test('safari.options', safari.Options) + }) }) }) \ No newline at end of file