Skip to content

Commit 3c1fa13

Browse files
Delta456M1troll
authored andcommitted
[py] allow logging diagnose in safari driver (SeleniumHQ#14606)
1 parent 3a2c864 commit 3c1fa13

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

py/selenium/webdriver/safari/service.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Service(service.Service):
2828
:param port: Port for the service to run on, defaults to 0 where the operating system will decide.
2929
:param service_args: (Optional) List of args to be passed to the subprocess when launching the executable.
3030
:param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`.
31+
:param enable_logging: (Optional) Enable logging of the service. Logs can be located at `~/Library/Logs/com.apple.WebDriver/`
3132
"""
3233

3334
def __init__(
@@ -37,12 +38,16 @@ def __init__(
3738
service_args: typing.Optional[typing.List[str]] = None,
3839
env: typing.Optional[typing.Mapping[str, str]] = None,
3940
reuse_service=False,
41+
enable_logging: bool = False,
4042
driver_path_env_key: str = None,
4143
**kwargs,
4244
) -> None:
4345
self.service_args = service_args or []
4446
driver_path_env_key = driver_path_env_key or "SE_SAFARIDRIVER"
4547

48+
if enable_logging:
49+
self.service_args.append("--diagnose")
50+
4651
self.reuse_service = reuse_service
4752
super().__init__(
4853
executable_path=executable_path,

0 commit comments

Comments
 (0)