summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--selenium/webdriver/chrome/service.py14
-rw-r--r--selenium/webdriver/phantomjs/service.py12
-rw-r--r--selenium/webdriver/phantomjs/webdriver.py2
-rw-r--r--selenium/webdriver/support/expected_conditions.py18
4 files changed, 23 insertions, 23 deletions
diff --git a/selenium/webdriver/chrome/service.py b/selenium/webdriver/chrome/service.py
index db7b724..a611b8d 100644
--- a/selenium/webdriver/chrome/service.py
+++ b/selenium/webdriver/chrome/service.py
@@ -29,7 +29,7 @@ class Service(object):
def __init__(self, executable_path, port=0, service_args=None, log_path=None):
"""
Creates a new instance of the Service
-
+
:Args:
- executable_path : Path to the ChromeDriver
- port : Port the service is running on
@@ -46,8 +46,8 @@ class Service(object):
def start(self):
"""
- Starts the ChromeDriver Service.
-
+ Starts the ChromeDriver Service.
+
:Exceptions:
- WebDriverException : Raised either when it can't start the service
or when it can't connect to the service
@@ -68,7 +68,7 @@ class Service(object):
time.sleep(1)
if count == 30:
raise WebDriverException("Can not connect to the ChromeDriver")
-
+
@property
def service_url(self):
"""
@@ -77,7 +77,7 @@ class Service(object):
return "http://localhost:%d" % self.port
def stop(self):
- """
+ """
Tells the ChromeDriver to stop and cleans up the process
"""
#If its dead dont worry
@@ -90,10 +90,10 @@ class Service(object):
count = 0
while utils.is_connectable(self.port):
if count == 30:
- break
+ break
count += 1
time.sleep(1)
-
+
#Tell the Server to properly die in case
try:
if self.process:
diff --git a/selenium/webdriver/phantomjs/service.py b/selenium/webdriver/phantomjs/service.py
index 21c5e5f..8d969c7 100644
--- a/selenium/webdriver/phantomjs/service.py
+++ b/selenium/webdriver/phantomjs/service.py
@@ -27,10 +27,10 @@ class Service(object):
def __init__(self, executable_path, port=0, service_args=None):
"""
Creates a new instance of the Service
-
+
:Args:
- executable_path : Path to PhantomJS binary
- - port : Port the service is running on
+ - port : Port the service is running on
- service_args : A List of other command line options to pass to PhantomJS
"""
@@ -47,8 +47,8 @@ class Service(object):
def start(self):
"""
- Starts PhantomJS with GhostDriver.
-
+ Starts PhantomJS with GhostDriver.
+
:Exceptions:
- WebDriverException : Raised either when it can't start the service
or when it can't connect to the service
@@ -64,7 +64,7 @@ class Service(object):
time.sleep(1)
if count == 30:
raise WebDriverException("Can not connect to GhostDriver")
-
+
@property
def service_url(self):
"""
@@ -73,7 +73,7 @@ class Service(object):
return "http://localhost:%d/wd/hub" % self.port
def stop(self):
- """
+ """
Cleans up the process
"""
if self._log:
diff --git a/selenium/webdriver/phantomjs/webdriver.py b/selenium/webdriver/phantomjs/webdriver.py
index 62f8d19..25eca5a 100644
--- a/selenium/webdriver/phantomjs/webdriver.py
+++ b/selenium/webdriver/phantomjs/webdriver.py
@@ -52,7 +52,7 @@ class WebDriver(RemoteWebDriver):
desired_capabilities=desired_capabilities)
except:
self.quit()
- raise
+ raise
def quit(self):
"""
diff --git a/selenium/webdriver/support/expected_conditions.py b/selenium/webdriver/support/expected_conditions.py
index ecc8d3a..a88c277 100644
--- a/selenium/webdriver/support/expected_conditions.py
+++ b/selenium/webdriver/support/expected_conditions.py
@@ -83,7 +83,7 @@ class visibility_of(object):
def __init__(self, element):
self.element = element
- def __call__(self, ignored):
+ def __call__(self, ignored):
return _element_if_visible(self.element)
def _element_if_visible(element):
@@ -110,12 +110,12 @@ class text_to_be_present_in_element(object):
self.locator = locator
self.text = text_
- def __call__(self, driver):
+ def __call__(self, driver):
try :
element_text = _find_element(driver, self.locator).text
return self.text in element_text
except StaleElementReferenceException:
- return False
+ return False
class text_to_be_present_in_element_value(object):
"""
@@ -161,7 +161,7 @@ class invisibility_of_element_located(object):
def __init__(self, locator):
self.locator = locator
- def __call__(self, driver):
+ def __call__(self, driver):
try:
return not _find_element(driver, self.locator).is_displayed()
except (NoSuchElementException, StaleElementReferenceException):
@@ -178,7 +178,7 @@ class element_to_be_clickable(object):
def __init__(self, locator):
self.locator = locator
- def __call__(self, driver):
+ def __call__(self, driver):
element = visibility_of_element_located(self.locator)(driver)
if element and element.is_enabled():
return element
@@ -229,7 +229,7 @@ class element_selection_state_to_be(object):
self.element = element
self.is_selected = is_selected
- def __call__(self, ignored):
+ def __call__(self, ignored):
return self.element.is_selected() == self.is_selected
class element_located_selection_state_to_be(object):
@@ -242,7 +242,7 @@ class element_located_selection_state_to_be(object):
self.locator = locator
self.is_selected = is_selected
- def __call__(self, driver):
+ def __call__(self, driver):
try:
element = _find_element(driver, self.locator)
return element.is_selected() == self.is_selected
@@ -263,7 +263,7 @@ class alert_is_present(object):
return False
def _find_element(driver, by):
- """ Looks up an element. Logs and re-raises WebDriverException if thrown.
+ """ Looks up an element. Logs and re-raises WebDriverException if thrown.
Method exists to gather data for
http://code.google.com/p/selenium/issues/detail?id=1800
"""
@@ -272,7 +272,7 @@ def _find_element(driver, by):
except NoSuchElementException as e:
raise e
except WebDriverException as e:
- raise e
+ raise e
def _find_elements(driver, by):