Skip to content

Commit 1559f8f

Browse files
authored
Merge branch 'SeleniumHQ:trunk' into py-fedcm
2 parents 484b621 + 71bc491 commit 1559f8f

File tree

16 files changed

+149
-49
lines changed

16 files changed

+149
-49
lines changed

.github/workflows/ci-python.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,4 @@ jobs:
9696
browser: safari
9797
os: macos
9898
cache-key: py-safari
99-
run: |
100-
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-safari-test/selenium/webdriver/safari/launcher_tests.py
99+
run: bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-safari

java/src/org/openqa/selenium/netty/server/RequestConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Ex
9696
length = -1;
9797
}
9898

99-
if (msg instanceof HttpContent) {
99+
if (request != null && msg instanceof HttpContent) {
100100
ByteBuf buf = ((HttpContent) msg).content().retain();
101101
int nBytes = buf.readableBytes();
102102

py/selenium/webdriver/remote/webelement.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ def get_attribute(self, name) -> str | None:
173173
# Check if the "active" CSS class is applied to an element.
174174
is_active = "active" in target_element.get_attribute("class")
175175
"""
176+
177+
warnings.warn(
178+
"using WebElement.get_attribute() has been deprecated. Please use get_dom_attribute() instead.",
179+
DeprecationWarning,
180+
stacklevel=2,
181+
)
182+
176183
if getAttribute_js is None:
177184
_load_js()
178185
attribute_value = self.parent.execute_script(

py/test/selenium/webdriver/common/alerts_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ def test_alert_should_not_allow_additional_commands_if_dismissed(driver, pages):
294294
@pytest.mark.xfail_remote(reason="https://bugzilla.mozilla.org/show_bug.cgi?id=1279211")
295295
@pytest.mark.xfail_chrome
296296
@pytest.mark.xfail_edge
297+
@pytest.mark.xfail_safari
297298
def test_unexpected_alert_present_exception_contains_alert_text(driver, pages):
298299
pages.load("alerts.html")
299300
driver.find_element(by=By.ID, value="alert").click()

py/test/selenium/webdriver/common/api_example_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def test_is_element_displayed(driver, pages):
240240

241241

242242
@pytest.mark.xfail_chrome
243+
@pytest.mark.xfail_safari
243244
def test_move_window_position(driver, pages):
244245
pages.load("blank.html")
245246
loc = driver.get_window_position()

py/test/selenium/webdriver/common/interactions_tests.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ def test_can_pause(driver, pages):
253253

254254
@pytest.mark.xfail_firefox
255255
@pytest.mark.xfail_remote
256+
@pytest.mark.xfail_safari
256257
def test_can_scroll_to_element(driver, pages):
257258
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
258259
iframe = driver.find_element(By.TAG_NAME, "iframe")
@@ -266,6 +267,7 @@ def test_can_scroll_to_element(driver, pages):
266267

267268
@pytest.mark.xfail_firefox
268269
@pytest.mark.xfail_remote
270+
@pytest.mark.xfail_safari
269271
def test_can_scroll_from_element_by_amount(driver, pages):
270272
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
271273
iframe = driver.find_element(By.TAG_NAME, "iframe")
@@ -280,6 +282,7 @@ def test_can_scroll_from_element_by_amount(driver, pages):
280282

281283
@pytest.mark.xfail_firefox
282284
@pytest.mark.xfail_remote
285+
@pytest.mark.xfail_safari
283286
def test_can_scroll_from_element_with_offset_by_amount(driver, pages):
284287
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
285288
footer = driver.find_element(By.TAG_NAME, "footer")
@@ -314,6 +317,7 @@ def test_can_scroll_from_viewport_by_amount(driver, pages):
314317
assert _in_viewport(driver, footer)
315318

316319

320+
@pytest.mark.xfail_safari
317321
def test_can_scroll_from_viewport_with_offset_by_amount(driver, pages):
318322
pages.load("scrolling_tests/frame_with_nested_scrolling_frame.html")
319323
scroll_origin = ScrollOrigin.from_viewport(10, 10)

py/test/selenium/webdriver/common/interactions_with_device_tests.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ def test_can_pause_with_pointer(driver, pages):
247247

248248
@pytest.mark.xfail_firefox
249249
@pytest.mark.xfail_remote
250+
@pytest.mark.xfail_safari
250251
def test_can_scroll_to_element_with_wheel(driver, pages):
251252
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
252253
iframe = driver.find_element(By.TAG_NAME, "iframe")
@@ -262,6 +263,7 @@ def test_can_scroll_to_element_with_wheel(driver, pages):
262263

263264
@pytest.mark.xfail_firefox
264265
@pytest.mark.xfail_remote
266+
@pytest.mark.xfail_safari
265267
def test_can_scroll_from_element_by_amount_with_wheel(driver, pages):
266268
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
267269
iframe = driver.find_element(By.TAG_NAME, "iframe")
@@ -278,6 +280,7 @@ def test_can_scroll_from_element_by_amount_with_wheel(driver, pages):
278280

279281
@pytest.mark.xfail_firefox
280282
@pytest.mark.xfail_remote
283+
@pytest.mark.xfail_safari
281284
def test_can_scroll_from_element_with_offset_by_amount_with_wheel(driver, pages):
282285
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
283286
footer = driver.find_element(By.TAG_NAME, "footer")
@@ -320,6 +323,7 @@ def test_can_scroll_from_viewport_by_amount_with_wheel(driver, pages):
320323

321324

322325
@pytest.mark.xfail_firefox
326+
@pytest.mark.xfail_safari
323327
def test_can_scroll_from_viewport_with_offset_by_amount_with_wheel(driver, pages):
324328
pages.load("scrolling_tests/frame_with_nested_scrolling_frame.html")
325329
scroll_origin = ScrollOrigin.from_viewport(10, 10)

py/test/selenium/webdriver/common/position_and_size_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def test_should_get_coordinates_of_an_invisible_element(driver, pages):
5353
_check_location(element.location, x=0, y=0)
5454

5555

56+
@pytest.mark.xfail_safari
5657
def test_should_scroll_page_and_get_coordinates_of_an_element_that_is_out_of_view_port(driver, pages):
5758
pages.load("coordinates_tests/page_with_element_out_of_view.html")
5859
element = driver.find_element(By.ID, "box")
@@ -89,6 +90,7 @@ def test_should_get_coordinates_of_an_element_in_anested_frame(driver, pages):
8990
_check_location(element.location, x=10, y=10)
9091

9192

93+
@pytest.mark.xfail_safari
9294
def test_should_get_coordinates_of_an_element_with_fixed_position(driver, pages):
9395
pages.load("coordinates_tests/page_with_fixed_element.html")
9496
element = driver.find_element(By.ID, "fixed")

py/test/selenium/webdriver/common/selenium_manager_tests.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
import json
18+
import platform
1819
import sys
1920
from pathlib import Path
2021
from unittest import mock
@@ -59,10 +60,14 @@ def test_uses_windows(monkeypatch):
5960

6061
def test_uses_linux(monkeypatch):
6162
monkeypatch.setattr(sys, "platform", "linux")
62-
binary = SeleniumManager()._get_binary()
6363

64-
project_root = Path(selenium.__file__).parent.parent
65-
assert binary == project_root.joinpath("selenium/webdriver/common/linux/selenium-manager")
64+
if platform.machine() == "arm64":
65+
with pytest.raises(WebDriverException, match="Unsupported platform/architecture combination: linux/arm64"):
66+
SeleniumManager()._get_binary()
67+
else:
68+
binary = SeleniumManager()._get_binary()
69+
project_root = Path(selenium.__file__).parent.parent
70+
assert binary == project_root.joinpath("selenium/webdriver/common/linux/selenium-manager")
6671

6772

6873
def test_uses_mac(monkeypatch):

py/test/selenium/webdriver/common/upload_tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# under the License.
1717

1818
import os
19+
import textwrap
1920

2021
import pytest
2122

@@ -30,11 +31,13 @@ def get_local_path():
3031
current_dir = os.path.dirname(os.path.realpath(__file__))
3132

3233
def wrapped(filename):
33-
return os.path.join(current_dir, filename)
34+
full_path = os.path.join(current_dir, filename)
35+
return textwrap.fill(full_path, width=512)
3436

3537
return wrapped
3638

3739

40+
@pytest.mark.xfail_safari
3841
def test_can_upload_file(driver, pages, get_local_path):
3942
pages.load("upload.html")
4043

@@ -45,6 +48,7 @@ def test_can_upload_file(driver, pages, get_local_path):
4548
WebDriverWait(driver, 10).until(EC.text_to_be_present_in_element((By.CSS_SELECTOR, "body"), "test_file.txt"))
4649

4750

51+
@pytest.mark.xfail_safari
4852
def test_can_upload_two_files(driver, pages, get_local_path):
4953
pages.load("upload.html")
5054
two_file_paths = get_local_path("test_file.txt") + "\n" + get_local_path("test_file2.txt")

0 commit comments

Comments
 (0)