Skip to content

Commit

Permalink
[py] Fix TypeError when init Safari webdriver (#14699)
Browse files Browse the repository at this point in the history
* [py] Fix TypeError when init Safari webdriver
* Try to enable test safari in CI

---------

Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 authored Nov 1, 2024
1 parent 76fadd7 commit 7c389f9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 2 additions & 3 deletions py/selenium/webdriver/safari/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions py/test/selenium/webdriver/safari/launcher_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7c389f9

Please sign in to comment.