From 7c389f9e12cf98dff0c1e8031f925d1d012138be Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 1 Nov 2024 02:54:22 +0000 Subject: [PATCH] [py] Fix TypeError when init Safari webdriver (#14699) * [py] Fix TypeError when init Safari webdriver * Try to enable test safari in CI --------- Signed-off-by: Viet Nguyen Duc --- .github/workflows/ci-python.yml | 12 ++++++++++++ py/selenium/webdriver/safari/webdriver.py | 5 ++--- py/test/selenium/webdriver/safari/launcher_tests.py | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml index 9749fd4e7ad82..cebe68597d063 100644 --- a/.github/workflows/ci-python.yml +++ b/.github/workflows/ci-python.yml @@ -86,3 +86,15 @@ jobs: browser: firefox cache-key: py-remote run: bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-remote + + safari-tests: + name: Safari Tests + needs: build + uses: ./.github/workflows/bazel.yml + with: + name: Integration Tests (safari) + browser: safari + 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 diff --git a/py/selenium/webdriver/safari/webdriver.py b/py/selenium/webdriver/safari/webdriver.py index 1480f5dfdd7bb..2c37a4bd7abde 100644 --- a/py/selenium/webdriver/safari/webdriver.py +++ b/py/selenium/webdriver/safari/webdriver.py @@ -16,7 +16,6 @@ # under the License. from selenium.common.exceptions import WebDriverException -from selenium.webdriver.remote.client_config import ClientConfig from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver from ..common.driver_finder import DriverFinder @@ -51,10 +50,10 @@ def __init__( if not self.service.reuse_service: self.service.start() - client_config = ClientConfig(remote_server_addr=self.service.service_url, keep_alive=keep_alive, timeout=120) executor = SafariRemoteConnection( + remote_server_addr=self.service.service_url, + keep_alive=keep_alive, ignore_proxy=options._ignore_local_proxy, - client_config=client_config, ) try: diff --git a/py/test/selenium/webdriver/safari/launcher_tests.py b/py/test/selenium/webdriver/safari/launcher_tests.py index 1d08a226d2fcd..77a57c313aa2e 100644 --- a/py/test/selenium/webdriver/safari/launcher_tests.py +++ b/py/test/selenium/webdriver/safari/launcher_tests.py @@ -52,6 +52,7 @@ def test_launch(self, driver): assert driver.capabilities["browserName"] == "safari" +@pytest.mark.skip(reason="Need to be updated") def test_launch_safari_with_legacy_flag(mocker, driver_class): import subprocess