Skip to content

Commit

Permalink
Merge branch 'trunk' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
VietND96 committed Jun 18, 2024
2 parents 0c6e98e + 0f7386e commit 283f4af
Show file tree
Hide file tree
Showing 25 changed files with 437 additions and 76 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ jobs:
run: git reset HEAD~1
- name: Update everything including early release CDP
if: ${{ github.event.inputs.chrome_channel == 'early-stable' }}
run: ./go all:prepare['Beta']
run: ./go all:prepare[${{ github.event.inputs.version }},Beta]
- name: Update everything including released CDP
if: ${{ github.event.inputs.chrome_channel == 'stable' }}
run: ./go "all:prepare[Stable]"
run: ./go "all:prepare[${{ github.event.inputs.version }},Stable]"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ py/selenium/webdriver/remote/isDisplayed.js
py/docs/build/
py/build/
py/LICENSE
py/pytestdebug.log
selenium.egg-info/
third_party/java/jetty/jetty-repacked.jar
*.user
Expand Down
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -1071,8 +1071,9 @@ namespace :all do
end

desc 'Update everything in preparation for a release'
task :prepare, [:channel] do |_task, arguments|
task :prepare, [:version, :channel] do |_task, arguments|
chrome_channel = arguments[:channel] || 'Stable'
version = arguments[:version]
args = Array(chrome_channel) ? ['--', "--chrome_channel=#{chrome_channel.capitalize}"] : []
Bazel.execute('run', args, '//scripts:pinned_browsers')
commit!('Update pinned browser versions', ['common/repositories.bzl'])
Expand Down Expand Up @@ -1102,7 +1103,7 @@ namespace :all do
commit!('Update authors file', ['AUTHORS'])

# Note that this does not include Rust version changes that are handled in separate rake:version task
Rake::Task['all:version'].invoke
Rake::Task['all:version'].invoke(version)
commit!("FIX CHANGELOGS BEFORE MERGING!\n\nUpdate versions and change logs to release Selenium #{java_version}",
['dotnet/CHANGELOG',
'dotnet/selenium-dotnet-version.bzl',
Expand Down
26 changes: 13 additions & 13 deletions common/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ js_library(

http_archive(
name = "linux_beta_firefox",
url = "https://ftp.mozilla.org/pub/firefox/releases/128.0b3/linux-x86_64/en-US/firefox-128.0b3.tar.bz2",
sha256 = "a44bd8e6c0cbdf28e270190f5dcaab0b803103509f556619047990551b7bea2d",
url = "https://ftp.mozilla.org/pub/firefox/releases/128.0b4/linux-x86_64/en-US/firefox-128.0b4.tar.bz2",
sha256 = "1cbcc0b831db1b28cc27122de8925ccc776c11a351e211b8c9361c7392de222b",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
Expand All @@ -72,8 +72,8 @@ js_library(

dmg_archive(
name = "mac_beta_firefox",
url = "https://ftp.mozilla.org/pub/firefox/releases/128.0b3/mac/en-US/Firefox%20128.0b3.dmg",
sha256 = "8941d09bfc01cf0bae0ebd82c93b0a03eeceea374152c4c1d448fd45911311bb",
url = "https://ftp.mozilla.org/pub/firefox/releases/128.0b4/mac/en-US/Firefox%20128.0b4.dmg",
sha256 = "716aa0ee6dff66fd4f0a0183ef91ba5a2ebfcdc16595c5e6c236fd5e4c6f455d",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
Expand Down Expand Up @@ -123,10 +123,10 @@ js_library(

pkg_archive(
name = "mac_edge",
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/afca7d24-09f1-4c8b-825b-0e043b6ad3eb/MicrosoftEdge-126.0.2592.56.pkg",
sha256 = "ab7c962acd1effed05fb71c91e098360299163197a7e2111dfeac1f420430046",
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/7f06ea4d-1753-4d40-aab4-edf087546165/MicrosoftEdge-126.0.2592.61.pkg",
sha256 = "ebadb7f4095b98cb627663bff918f3a7f2601462058fdac65a78818dabd1f68e",
move = {
"MicrosoftEdge-126.0.2592.56.pkg/Payload/Microsoft Edge.app": "Edge.app",
"MicrosoftEdge-126.0.2592.61.pkg/Payload/Microsoft Edge.app": "Edge.app",
},
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
Expand All @@ -143,8 +143,8 @@ js_library(

deb_archive(
name = "linux_edge",
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_126.0.2592.56-1_amd64.deb",
sha256 = "3592e53c6819a3ca3319648b0f8cf31446bcbe22aad5cf16d71c963ae6918d76",
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_126.0.2592.61-1_amd64.deb",
sha256 = "ee0a6adf6dd341ea7570497198ab2a58fb6331c881f999c4f2cecb8d89ca9cdb",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
Expand All @@ -165,8 +165,8 @@ js_library(

http_archive(
name = "linux_edgedriver",
url = "https://msedgedriver.azureedge.net/125.0.2535.92/edgedriver_linux64.zip",
sha256 = "0110e7a091787f3d723ad8dfedcedda3e2b1b9bee6f34e9020da0af10308eaa1",
url = "https://msedgedriver.azureedge.net/126.0.2592.61/edgedriver_linux64.zip",
sha256 = "9b99973dd92d8e1115c6d317f7e3a9586125abb57c4c19a7f14c755ecc1b8cb4",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
Expand All @@ -182,8 +182,8 @@ js_library(

http_archive(
name = "mac_edgedriver",
url = "https://msedgedriver.azureedge.net/125.0.2535.92/edgedriver_mac64.zip",
sha256 = "fcc1057325be98312f6ad66638fde0195c5a88eee87be31c5a63ccd9154c361b",
url = "https://msedgedriver.azureedge.net/126.0.2592.61/edgedriver_mac64.zip",
sha256 = "df6c180720a152b3f7096426cfb722a4ebc4c35715f3e15641323fb45c3c57e6",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/support/WebDriver.Support.StrongNamed.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<id>$packageid$</id>
<version>$version$</version>
<authors>Selenium Committers</authors>
<copyright>Copyright © 2023 Software Freedom Conservancy</copyright>
<copyright>Copyright © 2024 Software Freedom Conservancy</copyright>
<owners>selenium</owners>
<title>WebDriver Support</title>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/support/WebDriver.Support.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<id>$packageid$</id>
<version>$version$</version>
<authors>Selenium Committers</authors>
<copyright>Copyright © 2023 Software Freedom Conservancy</copyright>
<copyright>Copyright © 2024 Software Freedom Conservancy</copyright>
<owners>selenium</owners>
<title>WebDriver Support</title>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/WebDriver.StrongNamed.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<id>$packageid$</id>
<version>$version$</version>
<authors>Selenium Committers</authors>
<copyright>Copyright © 2023 Software Freedom Conservancy</copyright>
<copyright>Copyright © 2024 Software Freedom Conservancy</copyright>
<owners>selenium</owners>
<title>Selenium WebDriver</title>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/WebDriver.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<id>$packageid$</id>
<version>$version$</version>
<authors>Selenium Committers</authors>
<copyright>Copyright © 2023 Software Freedom Conservancy</copyright>
<copyright>Copyright © 2024 Software Freedom Conservancy</copyright>
<owners>selenium</owners>
<title>Selenium WebDriver</title>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import static org.openqa.selenium.testing.TestUtilities.getEffectivePlatform;
import static org.openqa.selenium.testing.drivers.Browser.CHROME;
import static org.openqa.selenium.testing.drivers.Browser.EDGE;
import static org.openqa.selenium.testing.drivers.Browser.IE;
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;

Expand Down Expand Up @@ -200,6 +201,9 @@ void canGenerateKeyboardShortcuts() {
@NotYetImplemented(
value = CHROME,
reason = "https://github.com/GoogleChromeLabs/chromium-bidi/issues/2321")
@NotYetImplemented(
value = EDGE,
reason = "https://github.com/GoogleChromeLabs/chromium-bidi/issues/2321")
public void testSelectionSelectBySymbol() {
driver.get(appServer.whereIs("single_text_input.html"));

Expand Down Expand Up @@ -229,6 +233,9 @@ public void testSelectionSelectBySymbol() {
@NotYetImplemented(
value = CHROME,
reason = "https://github.com/GoogleChromeLabs/chromium-bidi/issues/2321")
@NotYetImplemented(
value = EDGE,
reason = "https://github.com/GoogleChromeLabs/chromium-bidi/issues/2321")
public void testSelectionSelectByWord() {
assumeFalse(getEffectivePlatform(driver).is(Platform.MAC), "MacOS has alternative keyboard");

Expand Down
46 changes: 39 additions & 7 deletions py/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ py_package(
"py.selenium.webdriver.chrome",
"py.selenium.webdriver.chromium",
"py.selenium.webdriver.common",
"py.selenium.webdriver.common.bidi",
"py.selenium.webdriver.common.devtools",
"py.selenium.webdriver.edge",
"py.selenium.webdriver.firefox",
Expand Down Expand Up @@ -380,10 +381,39 @@ py_library(
deps = [],
)

BIDI_TESTS = glob(["test/selenium/webdriver/common/**/*bidi*_tests.py"])

[
py_test_suite(
name = "common-%s" % browser,
size = "large",
srcs = glob(
[
"test/selenium/webdriver/common/**/*.py",
"test/selenium/webdriver/support/**/*.py",
],
exclude = BIDI_TESTS + ["test/selenium/webdriver/common/print_pdf_tests.py"],
),
args = [
"--instafail",
"--bidi=false",
] + BROWSERS[browser]["args"],
data = BROWSERS[browser]["data"],
env_inherit = ["DISPLAY"],
tags = ["no-sandbox"] + BROWSERS[browser]["tags"],
deps = [
":init-tree",
":selenium",
":webserver",
] + TEST_DEPS,
)
for browser in BROWSERS.keys()
]

[
py_test_suite(
name = "common-%s-bidi" % browser,
size = "large",
srcs = glob(
[
"test/selenium/webdriver/common/**/*.py",
Expand All @@ -393,12 +423,11 @@ py_library(
),
args = [
"--instafail",
"--bidi=true",
] + BROWSERS[browser]["args"],
data = BROWSERS[browser]["data"],
env_inherit = ["DISPLAY"],
tags = [
"no-sandbox",
] + BROWSERS[browser]["tags"],
tags = ["no-sandbox"] + BROWSERS[browser]["tags"],
deps = [
":init-tree",
":selenium",
Expand Down Expand Up @@ -504,10 +533,13 @@ py_test_suite(
py_test_suite(
name = "test-remote",
size = "large",
srcs = glob([
"test/selenium/webdriver/common/**/*.py",
"test/selenium/webdriver/support/**/*.py",
]),
srcs = glob(
[
"test/selenium/webdriver/common/**/*.py",
"test/selenium/webdriver/support/**/*.py",
],
exclude = BIDI_TESTS,
),
args = [
"--instafail",
"--driver=remote",
Expand Down
29 changes: 29 additions & 0 deletions py/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ def pytest_addoption(parser):
dest="use_lan_ip",
help="Whether to start test server with lan ip instead of localhost",
)
parser.addoption(
"--bidi",
action="store",
dest="bidi",
metavar="BIDI",
help="Whether to enable BiDi support",
)


def pytest_ignore_collect(path, config):
Expand Down Expand Up @@ -158,6 +165,20 @@ def fin():
driver_instance = getattr(webdriver, driver_class)(**kwargs)
yield driver_instance

# Close the browser after BiDi tests. Those make event subscriptions
# and doesn't seems to be stable enough, causing the flakiness of the
# subsequent tests.
# Remove this when BiDi implementation and API is stable.
if bool(request.config.option.bidi):

def fin():
global driver_instance
if driver_instance is not None:
driver_instance.quit()
driver_instance = None

request.addfinalizer(fin)

if request.node.get_closest_marker("no_driver_after_test"):
driver_instance = None

Expand All @@ -166,6 +187,7 @@ def get_options(driver_class, config):
browser_path = config.option.binary
browser_args = config.option.args
headless = bool(config.option.headless)
bidi = bool(config.option.bidi)
options = None

if browser_path or browser_args:
Expand All @@ -187,6 +209,13 @@ def get_options(driver_class, config):
options.add_argument("--headless=new")
if driver_class == "Firefox":
options.add_argument("-headless")

if bidi:
if not options:
options = getattr(webdriver, f"{driver_class}Options")()

options.web_socket_url = True

return options


Expand Down
1 change: 0 additions & 1 deletion py/docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Webdriver.common
selenium.webdriver.common.actions.pointer_actions
selenium.webdriver.common.actions.wheel_input
selenium.webdriver.common.actions.wheel_actions
selenium.webdriver.common.html5.application_cache
selenium.webdriver.common.virtual_authenticator

Webdriver.support
Expand Down
2 changes: 1 addition & 1 deletion py/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
epub_title = 'Selenium'
epub_author = 'The Selenium Project'
epub_publisher = 'The Selenium Project'
epub_copyright = '2009-2023 Software Freedom Conservancy'
epub_copyright = '2009-2024 Software Freedom Conservancy'

# The language of the text. It defaults to the language option
# or en if the language is not set.
Expand Down

This file was deleted.

Loading

0 comments on commit 283f4af

Please sign in to comment.