Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[py] remove desired capabilities argument for Webkitgtk #14128

Merged
29 changes: 5 additions & 24 deletions py/selenium/webdriver/webkitgtk/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver

from .options import Options
from .service import DEFAULT_EXECUTABLE_PATH
from .service import Service


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

def __init__(
self,
executable_path=DEFAULT_EXECUTABLE_PATH,
port=0,
options=None,
desired_capabilities=None,
service_log_path=None,
keep_alive=False,
service: Service = None,
):
"""Creates a new instance of the WebKitGTK driver.

Starts the service and then creates new instance of WebKitGTK Driver.

:Args:
- executable_path : path to the executable. If the default is used it assumes the executable is in the $PATH.
- port : port you would like the service to run, if left as 0, a free port will be found.
- options : an instance of WebKitGTKOptions
- desired_capabilities : Dictionary object with desired capabilities
- service_log_path : Path to write service stdout and stderr output.
- keep_alive : Whether to configure RemoteConnection to use HTTP keep-alive.
- service : Service object for handling the browser driver if you need to pass extra details
"""
if not options:
options = Options()
if not desired_capabilities:
desired_capabilities = options.to_capabilities()
else:
capabilities = options.to_capabilities()
if desired_capabilities:
capabilities.update(desired_capabilities)
desired_capabilities = capabilities

self.service = Service(executable_path, port=port, log_path=service_log_path)
options = options if options else Options()
self.service = service if service else Service()
self.service.path = DriverFinder(self.service, options).get_driver_path()
self.service.start()

super().__init__(
command_executor=self.service.service_url, desired_capabilities=desired_capabilities, keep_alive=keep_alive
)
super().__init__(command_executor=self.service.service_url, options=options)
self._is_remote = False

def quit(self):
Expand Down
3 changes: 1 addition & 2 deletions py/selenium/webdriver/wpewebkit/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ def __init__(
- options : an instance of ``WPEWebKitOptions``
- service : Service object for handling the browser driver if you need to pass extra details
"""
if not options:
options = Options()

options = options if options else Options()
self.service = service if service else Service()
self.service.path = DriverFinder(self.service, options).get_driver_path()
self.service.start()
Expand Down
Loading