Skip to content

Commit 8b56711

Browse files
authored
[py] remove desired capabilities argument for Webkitgtk (#14128)
* initial changes for capabilities removing remove capabilities and add default Options same in safari.webdriver * make webkitgtk.webdriver same as wpewebkit.webdriver * fix formatting with isort * applying formatting with tox
1 parent 078ff3b commit 8b56711

File tree

2 files changed

+6
-26
lines changed

2 files changed

+6
-26
lines changed

py/selenium/webdriver/webkitgtk/webdriver.py

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
2222

2323
from .options import Options
24-
from .service import DEFAULT_EXECUTABLE_PATH
2524
from .service import Service
2625

2726

@@ -30,42 +29,24 @@ class WebDriver(RemoteWebDriver):
3029

3130
def __init__(
3231
self,
33-
executable_path=DEFAULT_EXECUTABLE_PATH,
34-
port=0,
3532
options=None,
36-
desired_capabilities=None,
37-
service_log_path=None,
38-
keep_alive=False,
33+
service: Service = None,
3934
):
4035
"""Creates a new instance of the WebKitGTK driver.
4136
4237
Starts the service and then creates new instance of WebKitGTK Driver.
4338
4439
:Args:
45-
- executable_path : path to the executable. If the default is used it assumes the executable is in the $PATH.
46-
- port : port you would like the service to run, if left as 0, a free port will be found.
4740
- options : an instance of WebKitGTKOptions
48-
- desired_capabilities : Dictionary object with desired capabilities
49-
- service_log_path : Path to write service stdout and stderr output.
50-
- keep_alive : Whether to configure RemoteConnection to use HTTP keep-alive.
41+
- service : Service object for handling the browser driver if you need to pass extra details
5142
"""
52-
if not options:
53-
options = Options()
54-
if not desired_capabilities:
55-
desired_capabilities = options.to_capabilities()
56-
else:
57-
capabilities = options.to_capabilities()
58-
if desired_capabilities:
59-
capabilities.update(desired_capabilities)
60-
desired_capabilities = capabilities
6143

62-
self.service = Service(executable_path, port=port, log_path=service_log_path)
44+
options = options if options else Options()
45+
self.service = service if service else Service()
6346
self.service.path = DriverFinder(self.service, options).get_driver_path()
6447
self.service.start()
6548

66-
super().__init__(
67-
command_executor=self.service.service_url, desired_capabilities=desired_capabilities, keep_alive=keep_alive
68-
)
49+
super().__init__(command_executor=self.service.service_url, options=options)
6950
self._is_remote = False
7051

7152
def quit(self):

py/selenium/webdriver/wpewebkit/webdriver.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ def __init__(
4040
- options : an instance of ``WPEWebKitOptions``
4141
- service : Service object for handling the browser driver if you need to pass extra details
4242
"""
43-
if not options:
44-
options = Options()
4543

44+
options = options if options else Options()
4645
self.service = service if service else Service()
4746
self.service.path = DriverFinder(self.service, options).get_driver_path()
4847
self.service.start()

0 commit comments

Comments
 (0)