Skip to content

Commit

Permalink
[py] allow logging diagnose in safari driver (#14606)
Browse files Browse the repository at this point in the history
  • Loading branch information
Delta456 authored Oct 17, 2024
1 parent a98248d commit e9fb68b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions py/selenium/webdriver/safari/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Service(service.Service):
:param port: Port for the service to run on, defaults to 0 where the operating system will decide.
:param service_args: (Optional) List of args to be passed to the subprocess when launching the executable.
:param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`.
:param enable_logging: (Optional) Enable logging of the service. Logs can be located at `~/Library/Logs/com.apple.WebDriver/`
"""

def __init__(
Expand All @@ -37,12 +38,16 @@ def __init__(
service_args: typing.Optional[typing.List[str]] = None,
env: typing.Optional[typing.Mapping[str, str]] = None,
reuse_service=False,
enable_logging: bool = False,
driver_path_env_key: str = None,
**kwargs,
) -> None:
self.service_args = service_args or []
driver_path_env_key = driver_path_env_key or "SE_SAFARIDRIVER"

if enable_logging:
self.service_args.append("--diagnose")

self.reuse_service = reuse_service
super().__init__(
executable_path=executable_path,
Expand Down

0 comments on commit e9fb68b

Please sign in to comment.