Skip to content

Commit b940299

Browse files
committed
fix: geckodriver session with node 18.x.x (issue 2 in #10970)
1 parent af5ab00 commit b940299

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

javascript/node/selenium-webdriver/io/exec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,5 @@ module.exports = {
162162
Command,
163163
Options,
164164
Result,
165-
exec
165+
exec,
166166
}

javascript/node/selenium-webdriver/lib/test/httpserver.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ let Server = function (requestHandler) {
5656
typeof opt_port !== 'function',
5757
'start invoked with function, not port (mocha callback)?'
5858
)
59-
const port = opt_port || portprober.findFreePort('localhost')
59+
const port = opt_port || portprober.findFreePort('127.0.0.1')
6060
return Promise.resolve(port)
6161
.then((port) => {
6262
return promise.checkedNodeCall(
63-
server.listen.bind(server, port, 'localhost')
63+
server.listen.bind(server, port, '127.0.0.1')
6464
)
6565
})
6666
.then(function () {

javascript/node/selenium-webdriver/net/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,7 @@ function getAddress(family = 'IPv4') {
7676
* @return {(string|undefined)} The IP address or undefined if not available.
7777
*/
7878
function getLoopbackAddress(family = 'IPv4') {
79-
let address = getIPAddress(true, family)
80-
if (address === '127.0.0.1') {
81-
address = 'localhost'
82-
}
83-
return address
79+
return getIPAddress(true, family)
8480
}
8581

8682
/**

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ suite(function (env) {
136136

137137
beforeEach(async function () {
138138
driver = await env.builder().build()
139-
await driver.get(fileServer.Pages.virtualAuthenticator)
139+
await driver.get(
140+
fileServer.Pages.virtualAuthenticator.replace('127.0.0.1', 'localhost')
141+
)
140142
assert.strictEqual(await driver.getTitle(), 'Virtual Authenticator Tests')
141143
})
142144

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ test.suite(function (env) {
5252
it('can set size of the current window from iframe', async function () {
5353
await driver.get(test.Pages.iframePage)
5454

55-
const frame = await driver.findElement({ css: 'iframe[name="iframe1-name"]' })
55+
const frame = await driver.findElement({
56+
css: 'iframe[name="iframe1-name"]',
57+
})
5658
await driver.switchTo().frame(frame)
5759
await changeSizeBy(-20, -20)
5860
})

0 commit comments

Comments
 (0)