Skip to content

Commit cb0e615

Browse files
authored
[js] Fix builder test
1 parent 992cef2 commit cb0e615

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

javascript/node/selenium-webdriver/test/builder_test.js

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ const assert = require('assert')
2121

2222
const chrome = require('../chrome')
2323
const edge = require('../edge')
24+
const error = require('../lib/error')
2425
const firefox = require('../firefox')
2526
const ie = require('../ie')
2627
const safari = require('../safari')
2728
const test = require('../lib/test')
2829
const { Browser } = require('../lib/capabilities')
2930
const { Pages } = require('../lib/test')
30-
const { Builder } = require('../../selenium-webdriver/index')
31+
const { Builder, Capabilities } = require('..')
3132

3233
test.suite(function (env) {
3334
const BROWSER_MAP = new Map([
@@ -92,31 +93,31 @@ test.suite(function (env) {
9293
async function getCaps(driver) {
9394
return driver.getCapabilities();
9495
}
95-
})
96-
97-
describe('Builder', function () {
98-
describe('catches incorrect use of browser options class', function () {
99-
function test(key, options) {
100-
it(key, async function () {
101-
let builder = new Builder().withCapabilities(
102-
new Capabilities()
103-
.set('browserName', 'fake-browser-should-not-try-to-start')
104-
.set(key, new options())
105-
)
106-
try {
107-
let driver = await builder.build()
108-
await driver.quit()
109-
return Promise.reject(Error('should have failed'))
110-
} catch (ex) {
111-
if (!(ex instanceof error.InvalidArgumentError)) {
112-
throw ex
96+
97+
describe('Builder', function () {
98+
describe('catches incorrect use of browser options class', function () {
99+
function test(key, options) {
100+
it(key, async function () {
101+
let builder = new Builder().withCapabilities(
102+
new Capabilities()
103+
.set('browserName', 'fake-browser-should-not-try-to-start')
104+
.set(key, new options())
105+
)
106+
try {
107+
let driver = await builder.build()
108+
await driver.quit()
109+
return Promise.reject(Error('should have failed'))
110+
} catch (ex) {
111+
if (!(ex instanceof error.InvalidArgumentError)) {
112+
throw ex
113+
}
113114
}
114-
}
115-
})
116-
}
115+
})
116+
}
117117

118-
test('chromeOptions', chrome.Options)
119-
test('moz:firefoxOptions', firefox.Options)
120-
test('safari.options', safari.Options)
118+
test('chromeOptions', chrome.Options)
119+
test('moz:firefoxOptions', firefox.Options)
120+
test('safari.options', safari.Options)
121+
})
121122
})
122123
})

0 commit comments

Comments
 (0)