Skip to content

Commit

Permalink
[py] Enable all test-safari
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Nov 3, 2024
1 parent b35f289 commit 1c25126
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ jobs:
os: macos
cache-key: py-safari
run: |
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-safari-test/selenium/webdriver/safari/launcher_tests.py
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-safari
1 change: 1 addition & 0 deletions py/test/selenium/webdriver/common/alerts_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ def test_alert_should_not_allow_additional_commands_if_dismissed(driver, pages):
@pytest.mark.xfail_remote(reason="https://bugzilla.mozilla.org/show_bug.cgi?id=1279211")
@pytest.mark.xfail_chrome
@pytest.mark.xfail_edge
@pytest.mark.xfail_safari
def test_unexpected_alert_present_exception_contains_alert_text(driver, pages):
pages.load("alerts.html")
driver.find_element(by=By.ID, value="alert").click()
Expand Down
1 change: 1 addition & 0 deletions py/test/selenium/webdriver/common/api_example_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def test_is_element_displayed(driver, pages):


@pytest.mark.xfail_chrome
@pytest.mark.xfail_safari
def test_move_window_position(driver, pages):
pages.load("blank.html")
loc = driver.get_window_position()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def test_should_catch_errors_when_executing_initial_script(driver, pages):
driver.execute_async_script("throw Error('you should catch this!');")


@pytest.mark.xfail_safari
def test_should_be_able_to_execute_asynchronous_scripts(driver, pages):
pages.load("ajaxy_page.html")

Expand Down
4 changes: 4 additions & 0 deletions py/test/selenium/webdriver/common/interactions_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ def test_can_pause(driver, pages):

@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
@pytest.mark.xfail_safari
def test_can_scroll_to_element(driver, pages):
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
iframe = driver.find_element(By.TAG_NAME, "iframe")
Expand All @@ -266,6 +267,7 @@ def test_can_scroll_to_element(driver, pages):

@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
@pytest.mark.xfail_safari
def test_can_scroll_from_element_by_amount(driver, pages):
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
iframe = driver.find_element(By.TAG_NAME, "iframe")
Expand All @@ -280,6 +282,7 @@ def test_can_scroll_from_element_by_amount(driver, pages):

@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
@pytest.mark.xfail_safari
def test_can_scroll_from_element_with_offset_by_amount(driver, pages):
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
footer = driver.find_element(By.TAG_NAME, "footer")
Expand Down Expand Up @@ -314,6 +317,7 @@ def test_can_scroll_from_viewport_by_amount(driver, pages):
assert _in_viewport(driver, footer)


@pytest.mark.xfail_safari
def test_can_scroll_from_viewport_with_offset_by_amount(driver, pages):
pages.load("scrolling_tests/frame_with_nested_scrolling_frame.html")
scroll_origin = ScrollOrigin.from_viewport(10, 10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def test_can_pause_with_pointer(driver, pages):

@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
@pytest.mark.xfail_safari
def test_can_scroll_to_element_with_wheel(driver, pages):
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
iframe = driver.find_element(By.TAG_NAME, "iframe")
Expand All @@ -262,6 +263,7 @@ def test_can_scroll_to_element_with_wheel(driver, pages):

@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
@pytest.mark.xfail_safari
def test_can_scroll_from_element_by_amount_with_wheel(driver, pages):
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
iframe = driver.find_element(By.TAG_NAME, "iframe")
Expand All @@ -278,6 +280,7 @@ def test_can_scroll_from_element_by_amount_with_wheel(driver, pages):

@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
@pytest.mark.xfail_safari
def test_can_scroll_from_element_with_offset_by_amount_with_wheel(driver, pages):
pages.load("scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html")
footer = driver.find_element(By.TAG_NAME, "footer")
Expand Down Expand Up @@ -320,6 +323,7 @@ def test_can_scroll_from_viewport_by_amount_with_wheel(driver, pages):


@pytest.mark.xfail_firefox
@pytest.mark.xfail_safari
def test_can_scroll_from_viewport_with_offset_by_amount_with_wheel(driver, pages):
pages.load("scrolling_tests/frame_with_nested_scrolling_frame.html")
scroll_origin = ScrollOrigin.from_viewport(10, 10)
Expand Down
2 changes: 2 additions & 0 deletions py/test/selenium/webdriver/common/position_and_size_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def test_should_get_coordinates_of_an_invisible_element(driver, pages):
_check_location(element.location, x=0, y=0)


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


@pytest.mark.xfail_safari
def test_should_get_coordinates_of_an_element_with_fixed_position(driver, pages):
pages.load("coordinates_tests/page_with_fixed_element.html")
element = driver.find_element(By.ID, "fixed")
Expand Down
11 changes: 8 additions & 3 deletions py/test/selenium/webdriver/common/selenium_manager_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from unittest import mock

import pytest
import platform

import selenium
from selenium.common.exceptions import WebDriverException
Expand Down Expand Up @@ -59,10 +60,14 @@ def test_uses_windows(monkeypatch):

def test_uses_linux(monkeypatch):
monkeypatch.setattr(sys, "platform", "linux")
binary = SeleniumManager()._get_binary()

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


def test_uses_mac(monkeypatch):
Expand Down
2 changes: 2 additions & 0 deletions py/test/selenium/webdriver/common/w3c_interaction_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def test_dragging_element_with_mouse_fires_events(driver, pages):

@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
@pytest.mark.xfail_safari
def test_pen_pointer_properties(driver, pages):
pages.load("pointerActionsPage.html")

Expand Down Expand Up @@ -223,6 +224,7 @@ def test_pen_pointer_properties(driver, pages):

@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
@pytest.mark.xfail_safari
def test_touch_pointer_properties(driver, pages):
pages.load("pointerActionsPage.html")
pointerArea = driver.find_element(By.CSS_SELECTOR, "#pointerArea")
Expand Down
2 changes: 2 additions & 0 deletions py/test/selenium/webdriver/common/webdriverwait_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def throw_sere(driver):

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


@pytest.mark.xfail_safari
def test_expected_condition_staleness_of(driver, pages):
pages.load("dynamicallyModifiedPage.html")
element = driver.find_element(By.ID, "element-to-remove")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def test_should_throw_no_such_window_exception_on_any_element_operation_if_awind
element.text


@pytest.mark.xfail_safari
def test_clicking_on_abutton_that_closes_an_open_window_does_not_cause_the_browser_to_hang(driver, pages):
pages.load("xhtmlTest.html")
current = driver.current_window_handle
Expand Down

0 comments on commit 1c25126

Please sign in to comment.