Skip to content

Commit

Permalink
[py] cleanup options classes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmtierney committed Aug 2, 2019
1 parent d0198ec commit f7b9b9e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
8 changes: 0 additions & 8 deletions py/selenium/webdriver/chrome/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@


class Options(ChromiumOptions):
KEY = "goog:chromeOptions"

@property
def default_capabilities(self):
return DesiredCapabilities.CHROME.copy()

def to_capabilities(self):
"""
Creates a capabilities with all the options that have been set and
:Returns: A dictionary with everything
"""
return super(Options, self).to_capabilities(self.KEY)
8 changes: 5 additions & 3 deletions py/selenium/webdriver/chromium/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
import base64
import os

from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.common.options import ArgOptions


class ChromiumOptions(ArgOptions):
KEY = "goog:chromeOptions"

def __init__(self):
super(ChromiumOptions, self).__init__()
Expand Down Expand Up @@ -145,7 +147,7 @@ def headless(self, value):
else:
self._arguments = list(set(self._arguments) - args)

def to_capabilities(self, capabilityKey):
def to_capabilities(self):
"""
Creates a capabilities with all the options that have been set
:Returns: A dictionary with everything
Expand All @@ -159,10 +161,10 @@ def to_capabilities(self, capabilityKey):
if self.debugger_address:
chrome_options["debuggerAddress"] = self.debugger_address

caps[capabilityKey] = chrome_options
caps[self.KEY] = chrome_options

return caps

@property
def default_capabilities(self):
pass
return DesiredCapabilities.CHROME.copy()
3 changes: 1 addition & 2 deletions py/selenium/webdriver/edge/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@


class Options(ChromiumOptions):
KEY = "goog:chromeOptions"

def __init__(self, is_legacy=True):
super(Options, self).__init__()
Expand Down Expand Up @@ -51,7 +50,7 @@ def to_capabilities(self):
:Returns: A dictionary with everything
"""
if not self._is_legacy:
return super(Options, self).to_capabilities(self.KEY)
return super(Options, self).to_capabilities()

caps = self._caps
caps['pageLoadStrategy'] = self._page_load_strategy
Expand Down

0 comments on commit f7b9b9e

Please sign in to comment.