Skip to content

Commit 279f0d6

Browse files
Deprecates withCapabilities method and removes tests (#9701)
Co-authored-by: David Burns <[email protected]>
1 parent b934a75 commit 279f0d6

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

javascript/node/selenium-webdriver/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ class Builder {
318318
}
319319

320320
/**
321+
* @deprecated Since Selenium 4.0 withCapabilities is deprecated, use set*Options instead where * is the browser(eg setChromeOptions)
322+
*
321323
* Sets the desired capabilities when requesting a new session. This will
322324
* overwrite any previously set capabilities.
323325
* @param {!(Object|Capabilities)} capabilities The desired capabilities for

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

-29
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ const assert = require('assert')
2121

2222
const chrome = require('../chrome')
2323
const edge = require('../edge')
24-
const error = require('../lib/error')
2524
const firefox = require('../firefox')
2625
const ie = require('../ie')
2726
const safari = require('../safari')
2827
const test = require('../lib/test')
2928
const { Browser } = require('../lib/capabilities')
3029
const { Pages } = require('../lib/test')
31-
const { Builder, Capabilities } = require('..')
3230

3331
test.suite(function (env) {
3432
const BROWSER_MAP = new Map([
@@ -71,30 +69,3 @@ test.suite(function (env) {
7169
})
7270
}
7371
})
74-
75-
describe('Builder', function () {
76-
describe('catches incorrect use of browser options class', function () {
77-
function test(key, options) {
78-
it(key, async function () {
79-
let builder = new Builder().withCapabilities(
80-
new Capabilities()
81-
.set('browserName', 'fake-browser-should-not-try-to-start')
82-
.set(key, new options())
83-
)
84-
try {
85-
let driver = await builder.build()
86-
await driver.quit()
87-
return Promise.reject(Error('should have failed'))
88-
} catch (ex) {
89-
if (!(ex instanceof error.InvalidArgumentError)) {
90-
throw ex
91-
}
92-
}
93-
})
94-
}
95-
96-
test('chromeOptions', chrome.Options)
97-
test('moz:firefoxOptions', firefox.Options)
98-
test('safari.options', safari.Options)
99-
})
100-
})

0 commit comments

Comments
 (0)