Skip to content

Update dependency selenium-webdriver to v4.33.0 #2316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/js-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
uses: nick-invision/[email protected]
with:
timeout_minutes: 20
max_attempts: 3
max_attempts: 2
command: |
cd examples/javascript
npm test
4 changes: 2 additions & 2 deletions .github/workflows/ruby-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.2
bundler-cache: true
- name: Install Gems Nightly non-Windows
if: matrix.release == 'nightly' && matrix.os != 'windows'
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.2
bundler-cache: true
- name: Install dependencies
working-directory: ./examples/ruby
Expand Down
15 changes: 7 additions & 8 deletions examples/javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "Apache-2.0",
"dependencies": {
"assert": "2.1.0",
"selenium-webdriver": "4.32.0"
"selenium-webdriver": "4.33.0"
},
"devDependencies": {
"mocha": "11.2.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {By, Origin, Builder} = require('selenium-webdriver');
const {By, Origin, Builder, until } = require('selenium-webdriver');
const assert = require('assert');

describe('Mouse move by offset', function () {
Expand All @@ -16,7 +16,7 @@ describe('Mouse move by offset', function () {
const actions = driver.actions({async: true});
await actions.move({x: 8, y: 0, origin: mouseTracker}).perform();

await driver.sleep(500);
await driver.wait(until.elementTextContains(await driver.findElement(By.id('relative-location')), ","), 2000);
let result = await driver.findElement(By.id('relative-location')).getText();
result = result.split(', ');
assert.deepStrictEqual((Math.abs(parseInt(result[0]) - 100 - 8) < 2), true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('Browsing Context Inspector', function () {

assert.equal(contextInfo.id, windowHandle)
assert.equal(contextInfo.url, 'about:blank')
assert.equal(contextInfo.children, null)
assert.equal(contextInfo.children.length, 0)
assert.equal(contextInfo.parentBrowsingContext, null)
})
})
2 changes: 1 addition & 1 deletion examples/javascript/test/bidirectional/input.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Input module', function () {

let resultElement = await driver.findElement(By.id('result'))
await resultElement.getText().then(function (text) {
assert(text.includes('oquefort parmigiano cheddar'))
assert(text.includes('oquefort parmigiano cheddar'), `text is: ${text}`)
})
})

Expand Down
21 changes: 10 additions & 11 deletions examples/javascript/test/bidirectional/network_events.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ describe('Network events', function () {
})

it('can listen to event before request is sent', async function () {
let beforeRequestEvent = null
let beforeRequestEvent = []
const network = await Network(driver)
await network.beforeRequestSent(function (event) {
beforeRequestEvent = event
beforeRequestEvent.push(event)
})

await driver.get('https://www.selenium.dev/selenium/web/blank.html')

assert.equal(beforeRequestEvent.request.method, 'GET')
const url = beforeRequestEvent.request.url
assert.equal(url, await driver.getCurrentUrl())
const currentUrl = await driver.getCurrentUrl()
const currentUrlFound = beforeRequestEvent.some(event => event.request.url.includes(currentUrl))
assert(currentUrlFound, `${currentUrl} was not requested`)
})

it('can request cookies', async function () {
Expand All @@ -50,8 +50,6 @@ describe('Network events', function () {
assert.equal(beforeRequestEvent.request.method, 'GET')
assert.equal(beforeRequestEvent.request.cookies[0].name, 'north')
assert.equal(beforeRequestEvent.request.cookies[0].value.value, 'biryani')
const url = beforeRequestEvent.request.url
assert.equal(url, await driver.getCurrentUrl())

await driver.manage().addCookie({
name: 'south',
Expand All @@ -70,13 +68,14 @@ describe('Network events', function () {
beforeRequestEvent.push(event)
})

await driver.get('http://www.selenium.dev/selenium/web/bidi/redirected_http_equiv.html')
await driver.get('https://www.selenium.dev/selenium/web/bidi/redirected_http_equiv.html')
await driver.wait(until.urlContains('redirected.html'), 1000)

assert.equal(beforeRequestEvent[0].request.method, 'GET')
assert(beforeRequestEvent[0].request.url.includes('redirected_http_equiv.html'))
assert.equal(beforeRequestEvent[2].request.method, 'GET')
assert(beforeRequestEvent[3].request.url.includes('redirected.html'))
let redirectedFound = beforeRequestEvent.some(event => event.request.url.includes('redirected.html'))
assert(redirectedFound, 'redirected.html was not requested')
redirectedFound = beforeRequestEvent.some(event => event.request.url.includes('redirected_http_equiv.html'))
assert(redirectedFound, 'redirected_http_equiv.html was not requested')
})

it('can subscribe to response started', async function () {
Expand Down
4 changes: 2 additions & 2 deletions examples/javascript/test/drivers/service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Service Test', function () {

options.setChromeBinaryPath(browserPath)

let service = new Chrome.ServiceBuilder().setPath(driverPath)
let service = new Chrome.ServiceBuilder(driverPath)

let driver = new Builder()
.forBrowser(Browser.CHROME)
Expand All @@ -50,4 +50,4 @@ describe('Service Test', function () {
await driver.get('https://www.selenium.dev/selenium/web/blank.html');
await driver.quit();
});
});
});
9 changes: 5 additions & 4 deletions examples/javascript/test/interactions/cookies.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

const {Browser, Builder} = require("selenium-webdriver");
const assert = require('assert')


describe('Cookies', function() {
Expand Down Expand Up @@ -36,7 +37,7 @@ describe('Cookies', function() {

// Get cookie details with named cookie 'foo'
await driver.manage().getCookie('foo').then(function(cookie) {
console.log('cookie details => ', cookie);
assert.equal(cookie.value, 'bar');
});
});

Expand All @@ -49,7 +50,7 @@ describe('Cookies', function() {

// Get all Available cookies
await driver.manage().getCookies().then(function(cookies) {
console.log('cookie details => ', cookies);
assert.equal(cookies.filter(cookie => cookie.name.startsWith('test')).length, 2);
});
});

Expand All @@ -65,7 +66,7 @@ describe('Cookies', function() {

// Get all Available cookies
await driver.manage().getCookies().then(function(cookies) {
console.log('cookie details => ', cookies);
assert.equal(cookies.filter(cookie => cookie.name.startsWith('test')).length, 1);
});
});

Expand All @@ -79,4 +80,4 @@ describe('Cookies', function() {
// Delete all cookies
await driver.manage().deleteAllCookies();
});
});
});
2 changes: 1 addition & 1 deletion examples/ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ gem 'rspec', '~> 3.0'
gem 'rubocop', '~> 1.35'
gem 'rubocop-rspec', '~> 3.0'
gem 'selenium-devtools', '= 0.136.0'
gem 'selenium-webdriver', '= 4.32.0'
gem 'selenium-webdriver', '= 4.33.0'
4 changes: 2 additions & 2 deletions examples/ruby/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ GEM
rubyzip (2.4.1)
selenium-devtools (0.136.0)
selenium-webdriver (~> 4.2)
selenium-webdriver (4.32.0)
selenium-webdriver (4.33.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
Expand All @@ -76,7 +76,7 @@ DEPENDENCIES
rubocop (~> 1.35)
rubocop-rspec (~> 3.0)
selenium-devtools (= 0.136.0)
selenium-webdriver (= 4.32.0)
selenium-webdriver (= 4.33.0)

BUNDLED WITH
2.5.6
6 changes: 3 additions & 3 deletions examples/ruby/spec/drivers/remote_webdriver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let(:target_directory) { File.join(Dir.tmpdir, SecureRandom.uuid) }
let(:wait) { Selenium::WebDriver::Wait.new(timeout: 2) }
let(:server) do
Selenium::Server.get(:latest,
Selenium::Server.new(File.expand_path(File.join('..', '..', '..', 'selenium-server-4.33.0.jar'), __dir__),
background: true,
args: %w[--selenium-manager true --enable-managed-downloads true])
end
Expand Down Expand Up @@ -35,8 +35,8 @@
file_input.send_keys(upload_file)
driver.find_element(id: 'file-submit').click

file_name = driver.find_element(id: 'uploaded-files')
expect(file_name.text).to eq 'selenium-snapshot.png'
wait.until { driver.find_element(id: 'uploaded-files') }
expect(driver.find_element(id: 'uploaded-files').text).to eq 'selenium-snapshot.png'
end

it 'downloads' do
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ This section contains the APIs related to network events.
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-version version="4.18" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L83-L89" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L82-L88" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand All @@ -177,7 +177,7 @@ This section contains the APIs related to network events.
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-version version="4.18" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L97-L103" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L96-L102" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ This section contains the APIs related to network events.
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-version version="4.18" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L83-L89" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L82-L88" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand All @@ -187,7 +187,7 @@ This section contains the APIs related to network events.
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-version version="4.18" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L97-L103" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L96-L102" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ This section contains the APIs related to network events.
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-version version="4.18" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L83-L89" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L82-L88" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand All @@ -187,7 +187,7 @@ This section contains the APIs related to network events.
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-version version="4.18" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L97-L103" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L96-L102" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ This section contains the APIs related to network events.
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-version version="4.18" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L83-L89" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L82-L88" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand All @@ -187,7 +187,7 @@ This section contains the APIs related to network events.
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-version version="4.18" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L97-L103" >}}
{{< gh-codeblock path="/examples/javascript/test/bidirectional/network_events.spec.js#L96-L102" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand All @@ -210,4 +210,4 @@ This section contains the APIs related to network events.
{{< tab header="Kotlin" >}}
{{< badge-code >}}
{{< /tab >}}
{{< /tabpane >}}
{{< /tabpane >}}
Loading