Skip to content

Commit 1c25126

Browse files
committed
[py] Enable all test-safari
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent b35f289 commit 1c25126

11 files changed

+27
-4
lines changed

.github/workflows/ci-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ jobs:
9797
os: macos
9898
cache-key: py-safari
9999
run: |
100-
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-safari-test/selenium/webdriver/safari/launcher_tests.py
100+
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-safari

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/executing_async_javascript_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def test_should_catch_errors_when_executing_initial_script(driver, pages):
152152
driver.execute_async_script("throw Error('you should catch this!');")
153153

154154

155+
@pytest.mark.xfail_safari
155156
def test_should_be_able_to_execute_asynchronous_scripts(driver, pages):
156157
pages.load("ajaxy_page.html")
157158

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
@@ -20,6 +20,7 @@
2020
from unittest import mock
2121

2222
import pytest
23+
import platform
2324

2425
import selenium
2526
from selenium.common.exceptions import WebDriverException
@@ -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/w3c_interaction_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def test_dragging_element_with_mouse_fires_events(driver, pages):
176176

177177
@pytest.mark.xfail_firefox
178178
@pytest.mark.xfail_remote
179+
@pytest.mark.xfail_safari
179180
def test_pen_pointer_properties(driver, pages):
180181
pages.load("pointerActionsPage.html")
181182

@@ -223,6 +224,7 @@ def test_pen_pointer_properties(driver, pages):
223224

224225
@pytest.mark.xfail_firefox
225226
@pytest.mark.xfail_remote
227+
@pytest.mark.xfail_safari
226228
def test_touch_pointer_properties(driver, pages):
227229
pages.load("pointerActionsPage.html")
228230
pointerArea = driver.find_element(By.CSS_SELECTOR, "#pointerArea")

py/test/selenium/webdriver/common/webdriverwait_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def throw_sere(driver):
3535

3636
@pytest.mark.xfail_chrome(reason="https://bugs.chromium.org/p/chromedriver/issues/detail?id=4743")
3737
@pytest.mark.xfail_edge(reason="https://bugs.chromium.org/p/chromedriver/issues/detail?id=4743")
38+
@pytest.mark.xfail_safari
3839
def test_should_fail_with_invalid_selector_exception(driver, pages):
3940
pages.load("dynamic.html")
4041
with pytest.raises(InvalidSelectorException):
@@ -283,6 +284,7 @@ def test_expected_condition_element_to_be_clickable(driver, pages):
283284
assert element.is_displayed() is False
284285

285286

287+
@pytest.mark.xfail_safari
286288
def test_expected_condition_staleness_of(driver, pages):
287289
pages.load("dynamicallyModifiedPage.html")
288290
element = driver.find_element(By.ID, "element-to-remove")

0 commit comments

Comments
 (0)