Unreviewed. Update Selenium WebDriver imported tests.
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 12:13:40 +0000 (12:13 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 12:13:40 +0000 (12:13 +0000)
Tools:

New version of selenium uses command line options to pass driver and browser binaries to pytest instead of
environment variables.

* Scripts/webkitpy/webdriver_tests/pytest_runner.py:
(collect): Reorder the arguments to make pytest happy.
(run): Ditto.
* Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py:
(WebDriverSeleniumExecutor.__init__): Add driver binary, browser binary and browser args as arguments.

WebDriverTests:

* imported/selenium/importer.json:
* imported/selenium/py/conftest.py:
* imported/selenium/py/selenium/__init__.py:
* imported/selenium/py/selenium/webdriver/__init__.py:
* imported/selenium/py/selenium/webdriver/common/action_chains.py:
* imported/selenium/py/selenium/webdriver/common/service.py:
* imported/selenium/py/selenium/webdriver/remote/remote_connection.py:
* imported/selenium/py/selenium/webdriver/remote/switch_to.py:
* imported/selenium/py/selenium/webdriver/remote/webdriver.py:
* imported/selenium/py/selenium/webdriver/remote/webelement.py:
* imported/selenium/py/selenium/webdriver/support/expected_conditions.py:
* imported/selenium/py/selenium/webdriver/webkitgtk/options.py:
* imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/api_example_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/appcache_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/driver_element_finding_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/executing_async_javascript_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/frame_switching_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/interactions_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/page_load_timeout_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/position_and_size_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/rendered_webelement_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/visibility_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/w3c_interaction_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/window_tests.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226773 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
Tools/ChangeLog
Tools/Scripts/webkitpy/webdriver_tests/pytest_runner.py
Tools/Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py
WebDriverTests/ChangeLog
WebDriverTests/imported/selenium/importer.json
WebDriverTests/imported/selenium/py/conftest.py
WebDriverTests/imported/selenium/py/selenium/__init__.py
WebDriverTests/imported/selenium/py/selenium/webdriver/__init__.py
WebDriverTests/imported/selenium/py/selenium/webdriver/common/action_chains.py
WebDriverTests/imported/selenium/py/selenium/webdriver/common/service.py
WebDriverTests/imported/selenium/py/selenium/webdriver/remote/remote_connection.py
WebDriverTests/imported/selenium/py/selenium/webdriver/remote/switch_to.py
WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webdriver.py
WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py
WebDriverTests/imported/selenium/py/selenium/webdriver/support/expected_conditions.py
WebDriverTests/imported/selenium/py/selenium/webdriver/webkitgtk/options.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/api_example_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/appcache_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/driver_element_finding_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/executing_async_javascript_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/frame_switching_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/interactions_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/page_load_timeout_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/position_and_size_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/rendered_webelement_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/visibility_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/w3c_interaction_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py
WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/window_tests.py

index 6e75ebe..bea2f61 100644 (file)
@@ -1,3 +1,16 @@
+2018-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Unreviewed. Update Selenium WebDriver imported tests.
+
+        New version of selenium uses command line options to pass driver and browser binaries to pytest instead of
+        environment variables.
+
+        * Scripts/webkitpy/webdriver_tests/pytest_runner.py:
+        (collect): Reorder the arguments to make pytest happy.
+        (run): Ditto.
+        * Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py:
+        (WebDriverSeleniumExecutor.__init__): Add driver binary, browser binary and browser args as arguments.
+
 2018-01-11  Ling Ho  <lingcherd_ho@apple.com>
 
         Move Commit Queue and EWS Queues to Sierra on Bot Watcher's Dasboard
index 073d422..cfd1b61 100644 (file)
@@ -132,10 +132,11 @@ def collect(directory, args):
     with open(os.devnull, 'wb') as devnull:
         sys.stdout = devnull
         with TemporaryDirectory() as cache_directory:
-            pytest.main(args + ['--collect-only',
-                                '--basetemp', cache_directory,
-                                directory],
-                        plugins=[collect_recorder])
+            cmd = ['--collect-only',
+                   '--basetemp=%s' % cache_directory]
+            cmd.extend(args)
+            cmd.append(directory)
+            pytest.main(cmd, plugins=[collect_recorder])
     sys.stdout = stdout
     return collect_recorder.tests
 
@@ -149,15 +150,16 @@ def run(path, args, timeout, env={}):
 
     with TemporaryDirectory() as cache_directory:
         try:
-            result = pytest.main(args + ['--verbose',
-                                         '--capture=no',
-                                         '--basetemp', cache_directory,
-                                         '--showlocals',
-                                         '--timeout=%s' % timeout,
-                                         '-p', 'no:cacheprovider',
-                                         '-p', 'pytest_timeout',
-                                         path],
-                                 plugins=[harness_recorder, subtests_recorder])
+            cmd = ['--verbose',
+                   '--capture=no',
+                   '--basetemp=%s' % cache_directory,
+                   '--showlocals',
+                   '--timeout=%s' % timeout,
+                   '-p', 'no:cacheprovider',
+                   '-p', 'pytest_timeout']
+            cmd.extend(args)
+            cmd.append(path)
+            result = pytest.main(cmd, plugins=[harness_recorder, subtests_recorder])
             if result == EXIT_INTERNALERROR:
                 harness_recorder.outcome = ('ERROR', None)
         except Exception as e:
index e4ae1c0..b65ef61 100644 (file)
@@ -41,18 +41,16 @@ _log = logging.getLogger(__name__)
 class WebDriverSeleniumExecutor(object):
 
     def __init__(self, driver, display_driver):
-        self._env = {}
-        self._env['WD_DRIVER_PATH'] = driver.binary_path()
-        browser_path = driver.browser_path()
+        self._env = display_driver._setup_environ_for_test()
+        self._env.update(driver.browser_env())
+
+        self._args = ['--driver=%s' % driver.selenium_name(), '--driver-binary=%s' % driver.binary_path().encode()]
+        browser_path = driver.browser_path().encode()
         if browser_path:
-            self._env['WD_BROWSER_PATH'] = browser_path
+            self._args.extend(['--browser-binary=%s' % browser_path])
         browser_args = driver.browser_args()
         if browser_args:
-            self._env['WD_BROWSER_ARGS'] = ' '.join(browser_args)
-        self._env.update(display_driver._setup_environ_for_test())
-        self._env.update(driver.browser_env())
-
-        self._args = ['--driver=%s' % driver.selenium_name()]
+            self._args.extend(['--browser-args=%s' % ' '.join(browser_args)])
 
         if pytest_runner is None:
             do_delayed_imports()
index daa1cd0..b529148 100644 (file)
@@ -1,3 +1,35 @@
+2018-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Unreviewed. Update Selenium WebDriver imported tests.
+
+        * imported/selenium/importer.json:
+        * imported/selenium/py/conftest.py:
+        * imported/selenium/py/selenium/__init__.py:
+        * imported/selenium/py/selenium/webdriver/__init__.py:
+        * imported/selenium/py/selenium/webdriver/common/action_chains.py:
+        * imported/selenium/py/selenium/webdriver/common/service.py:
+        * imported/selenium/py/selenium/webdriver/remote/remote_connection.py:
+        * imported/selenium/py/selenium/webdriver/remote/switch_to.py:
+        * imported/selenium/py/selenium/webdriver/remote/webdriver.py:
+        * imported/selenium/py/selenium/webdriver/remote/webelement.py:
+        * imported/selenium/py/selenium/webdriver/support/expected_conditions.py:
+        * imported/selenium/py/selenium/webdriver/webkitgtk/options.py:
+        * imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/api_example_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/appcache_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/driver_element_finding_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/executing_async_javascript_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/frame_switching_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/interactions_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/page_load_timeout_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/position_and_size_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/rendered_webelement_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/visibility_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/w3c_interaction_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py:
+        * imported/selenium/py/test/selenium/webdriver/common/window_tests.py:
+
 2018-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Update W3C WebDriver imported tests.
index 993d729..7d28500 100644 (file)
@@ -1,6 +1,6 @@
 {
     "repository": "https://github.com/SeleniumHQ/selenium.git",
-    "revision": "57fe00346d1c4d6d3f8e33ae4d7426940e795a30",
+    "revision": "c5e4a585f1e3c4b3468ec93ab50d3668d47aef1b",
     "paths_to_import": [
         "common",
         "py/conftest.py",
index ef11e01..e2edcfa 100644 (file)
@@ -41,7 +41,6 @@ drivers = (
     'Firefox',
     'Ie',
     'Marionette',
-    'PhantomJS',
     'Remote',
     'Safari',
     'WebKitGTK',
@@ -49,13 +48,15 @@ drivers = (
 
 
 def pytest_addoption(parser):
-    parser.addoption(
-        '--driver',
-        action='append',
-        choices=drivers,
-        dest='drivers',
-        metavar='DRIVER',
-        help='driver to run tests against ({0})'.format(', '.join(drivers)))
+    parser.addoption('--driver', action='append', choices=drivers, dest='drivers',
+                     metavar='DRIVER',
+                     help='driver to run tests against ({})'.format(', '.join(drivers)))
+    parser.addoption('--browser-binary', action='store', dest='binary',
+                     help='location of the browser binary')
+    parser.addoption('--driver-binary', action='store', dest='executable',
+                     help='location of the service executable binary')
+    parser.addoption('--browser-args', action='store', dest='args',
+                     help='arguments to start the browser with')
 
 
 def pytest_ignore_collect(path, config):
@@ -94,40 +95,52 @@ def driver(request):
                 yield
                 return
 
+    driver_path = request.config.option.executable
+    options = None
+
     global driver_instance
     if driver_instance is None:
         if driver_class == 'BlackBerry':
             kwargs.update({'device_password': 'password'})
         if driver_class == 'Firefox':
             kwargs.update({'capabilities': {'marionette': False}})
+            options = get_options(driver_class, request.config)
         if driver_class == 'Marionette':
             driver_class = 'Firefox'
+            options = get_options(driver_class, request.config)
         if driver_class == 'Remote':
             capabilities = DesiredCapabilities.FIREFOX.copy()
             capabilities['marionette'] = False
             kwargs.update({'desired_capabilities': capabilities})
+            options = get_options('Firefox', request.config)
         if driver_class == 'WebKitGTK':
-            additional_args = {}
-            options = webdriver.WebKitGTKOptions()
-            options.overlay_scrollbars_enabled = False
-            browser_path = os.environ.get('WD_BROWSER_PATH')
-            if browser_path is not None:
-                options.browser_executable_path = browser_path
-            browser_args = os.environ.get('WD_BROWSER_ARGS')
-            if browser_args is not None:
-                for arg in browser_args.split():
-                    options.add_browser_argument(arg)
-            additional_args['options'] = options
-            driver_path = os.environ.get('WD_DRIVER_PATH')
-            if driver_path is not None:
-                additional_args['executable_path'] = driver_path
-            kwargs.update(additional_args)
+            options = get_options(driver_class, request.config)
+        if driver_path is not None:
+            kwargs['executable_path'] = driver_path
+        if options is not None:
+            kwargs['options'] = options
         driver_instance = getattr(webdriver, driver_class)(**kwargs)
     yield driver_instance
     if MarkEvaluator(request.node, 'no_driver_after_test').istrue():
         driver_instance = None
 
 
+def get_options(driver_class, config):
+    browser_path = config.option.binary
+    browser_args = config.option.args
+    options = None
+    if browser_path or browser_args:
+        options = getattr(webdriver, '{}Options'.format(driver_class))()
+        if driver_class == 'WebKitGTK':
+            options.overlay_scrollbars_enabled = False
+        if browser_path is not None:
+            options.binary_location = browser_path
+        if browser_args is not None:
+            for arg in browser_args.split():
+                options.add_argument(arg)
+    return options
+
+
 @pytest.fixture(scope='session', autouse=True)
 def stop_driver(request):
     def fin():
index bada50a..6146680 100644 (file)
@@ -24,4 +24,4 @@ from .common.action_chains import ActionChains  # noqa
 from .common.touch_actions import TouchActions  # noqa
 from .common.proxy import Proxy  # noqa
 
-__version__ = '3.8.0'
+__version__ = '3.8.1'
index 19d4ac1..4ed297e 100644 (file)
@@ -331,12 +331,12 @@ class ActionChains(object):
          - on_element: The element to mouse up.
            If None, releases on current mouse position.
         """
+        if on_element:
+                self.move_to_element(on_element)
         if self._driver.w3c:
             self.w3c_actions.pointer_action.release()
             self.w3c_actions.key_action.pause()
         else:
-            if on_element:
-                self.move_to_element(on_element)
             self._actions.append(lambda: self._driver.execute(Command.MOUSE_UP, {}))
         return self
 
index 8984f5f..af04a9f 100644 (file)
@@ -71,7 +71,9 @@ class Service(object):
             cmd.extend(self.command_line_args())
             self.process = subprocess.Popen(cmd, env=self.env,
                                             close_fds=platform.system() != 'Windows',
-                                            stdout=self.log_file, stderr=self.log_file)
+                                            stdout=self.log_file,
+                                            stderr=self.log_file,
+                                            stdin=PIPE)
         except TypeError:
             raise
         except OSError as err:
index 9f19423..25dcd81 100644 (file)
@@ -200,6 +200,10 @@ class RemoteConnection(object):
             port = parsed_url.port or None
             if parsed_url.scheme == "https":
                 ip = parsed_url.hostname
+            elif port and not common_utils.is_connectable(port, parsed_url.hostname):
+                ip = None
+                LOGGER.info('Could not connect to port {} on host '
+                            '{}'.format(port, parsed_url.hostname))
             else:
                 ip = common_utils.find_connectable_ip(parsed_url.hostname,
                                                       port=port)
@@ -454,8 +458,10 @@ class RemoteConnection(object):
         """
         command_info = self._commands[command]
         assert command_info is not None, 'Unrecognised command %s' % command
-        data = utils.dump_json(params)
         path = string.Template(command_info[1]).substitute(params)
+        if hasattr(self, 'w3c') and self.w3c and isinstance(params, dict) and 'sessionId' in params:
+            del params['sessionId']
+        data = utils.dump_json(params)
         url = '%s%s' % (self._url, path)
         return self._request(command_info[0], url, body=data)
 
@@ -558,5 +564,5 @@ class RemoteConnection(object):
                 data = {'status': 0, 'value': body.strip()}
                 return data
         finally:
-            LOGGER.debug("Finished Request")
+            LOGGER.debug(u"Finished Request {}".format(data))
             resp.close()
index 43f5708..3f57e7a 100644 (file)
@@ -51,7 +51,9 @@ class SwitchTo:
         :Usage:
             alert = driver.switch_to.alert
         """
-        return Alert(self._driver)
+        alert = Alert(self._driver)
+        alert.text
+        return alert
 
     def default_content(self):
         """
index 51ea5a3..a4b1592 100644 (file)
@@ -198,7 +198,7 @@ class WebDriver(object):
         """Returns the name of the underlying browser for this instance.
 
         :Usage:
-         - driver.name
+            name = driver.name
         """
         if 'browserName' in self.capabilities:
             return self.capabilities['browserName']
@@ -253,6 +253,7 @@ class WebDriver(object):
 
         # Double check to see if we have a W3C Compliant browser
         self.w3c = response.get('status') is None
+        self.command_executor.w3c = self.w3c
 
     def _wrap_value(self, value):
         if isinstance(value, dict):
@@ -327,7 +328,7 @@ class WebDriver(object):
         """Returns the title of the current page.
 
         :Usage:
-            driver.title
+            title = driver.title
         """
         resp = self.execute(Command.GET_TITLE)
         return resp['value'] if resp['value'] is not None else ""
@@ -338,8 +339,14 @@ class WebDriver(object):
         :Args:
          - id\_ - The id of the element to be found.
 
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
         :Usage:
-            driver.find_element_by_id('foo')
+            element = driver.find_element_by_id('foo')
         """
         return self.find_element(by=By.ID, value=id_)
 
@@ -350,8 +357,12 @@ class WebDriver(object):
         :Args:
          - id\_ - The id of the elements to be found.
 
+        :Returns:
+         - list of WebElement - a list with elements if any was found.  An
+           empty list if not
+
         :Usage:
-            driver.find_elements_by_id('foo')
+            elements = driver.find_elements_by_id('foo')
         """
         return self.find_elements(by=By.ID, value=id_)
 
@@ -362,8 +373,14 @@ class WebDriver(object):
         :Args:
          - xpath - The xpath locator of the element to find.
 
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
         :Usage:
-            driver.find_element_by_xpath('//div/td[1]')
+            element = driver.find_element_by_xpath('//div/td[1]')
         """
         return self.find_element(by=By.XPATH, value=xpath)
 
@@ -374,8 +391,12 @@ class WebDriver(object):
         :Args:
          - xpath - The xpath locator of the elements to be found.
 
+        :Returns:
+         - list of WebElement - a list with elements if any was found.  An
+           empty list if not
+
         :Usage:
-            driver.find_elements_by_xpath("//div[contains(@class, 'foo')]")
+            elements = driver.find_elements_by_xpath("//div[contains(@class, 'foo')]")
         """
         return self.find_elements(by=By.XPATH, value=xpath)
 
@@ -386,8 +407,14 @@ class WebDriver(object):
         :Args:
          - link_text: The text of the element to be found.
 
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
         :Usage:
-            driver.find_element_by_link_text('Sign In')
+            element = driver.find_element_by_link_text('Sign In')
         """
         return self.find_element(by=By.LINK_TEXT, value=link_text)
 
@@ -398,8 +425,12 @@ class WebDriver(object):
         :Args:
          - link_text: The text of the elements to be found.
 
+        :Returns:
+         - list of webelement - a list with elements if any was found.  an
+           empty list if not
+
         :Usage:
-            driver.find_elements_by_link_text('Sign In')
+            elements = driver.find_elements_by_link_text('Sign In')
         """
         return self.find_elements(by=By.LINK_TEXT, value=text)
 
@@ -410,8 +441,14 @@ class WebDriver(object):
         :Args:
          - link_text: The text of the element to partially match on.
 
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
         :Usage:
-            driver.find_element_by_partial_link_text('Sign')
+            element = driver.find_element_by_partial_link_text('Sign')
         """
         return self.find_element(by=By.PARTIAL_LINK_TEXT, value=link_text)
 
@@ -422,8 +459,12 @@ class WebDriver(object):
         :Args:
          - link_text: The text of the element to partial match on.
 
+        :Returns:
+         - list of webelement - a list with elements if any was found.  an
+           empty list if not
+
         :Usage:
-            driver.find_element_by_partial_link_text('Sign')
+            elements = driver.find_elements_by_partial_link_text('Sign')
         """
         return self.find_elements(by=By.PARTIAL_LINK_TEXT, value=link_text)
 
@@ -434,8 +475,14 @@ class WebDriver(object):
         :Args:
          - name: The name of the element to find.
 
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
         :Usage:
-            driver.find_element_by_name('foo')
+            element = driver.find_element_by_name('foo')
         """
         return self.find_element(by=By.NAME, value=name)
 
@@ -446,8 +493,12 @@ class WebDriver(object):
         :Args:
          - name: The name of the elements to find.
 
+        :Returns:
+         - list of webelement - a list with elements if any was found.  an
+           empty list if not
+
         :Usage:
-            driver.find_elements_by_name('foo')
+            elements = driver.find_elements_by_name('foo')
         """
         return self.find_elements(by=By.NAME, value=name)
 
@@ -456,10 +507,16 @@ class WebDriver(object):
         Finds an element by tag name.
 
         :Args:
-         - name: The tag name of the element to find.
+         - name - name of html tag (eg: h1, a, span)
+
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
 
         :Usage:
-            driver.find_element_by_tag_name('foo')
+            element = driver.find_element_by_tag_name('h1')
         """
         return self.find_element(by=By.TAG_NAME, value=name)
 
@@ -468,10 +525,14 @@ class WebDriver(object):
         Finds elements by tag name.
 
         :Args:
-         - name: The tag name the use when finding elements.
+         - name - name of html tag (eg: h1, a, span)
+
+        :Returns:
+         - list of WebElement - a list with elements if any was found.  An
+           empty list if not
 
         :Usage:
-            driver.find_elements_by_tag_name('foo')
+            elements = driver.find_elements_by_tag_name('h1')
         """
         return self.find_elements(by=By.TAG_NAME, value=name)
 
@@ -482,8 +543,14 @@ class WebDriver(object):
         :Args:
          - name: The class name of the element to find.
 
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
         :Usage:
-            driver.find_element_by_class_name('foo')
+            element = driver.find_element_by_class_name('foo')
         """
         return self.find_element(by=By.CLASS_NAME, value=name)
 
@@ -494,8 +561,12 @@ class WebDriver(object):
         :Args:
          - name: The class name of the elements to find.
 
+        :Returns:
+         - list of WebElement - a list with elements if any was found.  An
+           empty list if not
+
         :Usage:
-            driver.find_elements_by_class_name('foo')
+            elements = driver.find_elements_by_class_name('foo')
         """
         return self.find_elements(by=By.CLASS_NAME, value=name)
 
@@ -504,10 +575,16 @@ class WebDriver(object):
         Finds an element by css selector.
 
         :Args:
-         - css_selector: The css selector to use when finding elements.
+         - css_selector - CSS selector string, ex: 'a.nav#home'
+
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
 
         :Usage:
-            driver.find_element_by_css_selector('#foo')
+            element = driver.find_element_by_css_selector('#foo')
         """
         return self.find_element(by=By.CSS_SELECTOR, value=css_selector)
 
@@ -516,10 +593,14 @@ class WebDriver(object):
         Finds elements by css selector.
 
         :Args:
-         - css_selector: The css selector to use when finding elements.
+         - css_selector - CSS selector string, ex: 'a.nav#home'
+
+        :Returns:
+         - list of WebElement - a list with elements if any was found.  An
+           empty list if not
 
         :Usage:
-            driver.find_elements_by_css_selector('.foo')
+            elements = driver.find_elements_by_css_selector('.foo')
         """
         return self.find_elements(by=By.CSS_SELECTOR, value=css_selector)
 
@@ -532,7 +613,7 @@ class WebDriver(object):
          - \*args: Any applicable arguments for your JavaScript.
 
         :Usage:
-            driver.execute_script('document.title')
+            driver.execute_script('return document.title;')
         """
         converted_args = list(args)
         command = None
@@ -554,7 +635,9 @@ class WebDriver(object):
          - \*args: Any applicable arguments for your JavaScript.
 
         :Usage:
-            driver.execute_async_script('document.title')
+            script = "var callback = arguments[arguments.length - 1]; " \
+                     "window.setTimeout(function(){ callback('timeout') }, 3000);"
+            driver.execute_async_script(script)
         """
         converted_args = list(args)
         if self.w3c:
@@ -656,6 +739,20 @@ class WebDriver(object):
 
     @property
     def switch_to(self):
+        """
+        :Returns:
+            - SwitchTo: an object containing all options to switch focus into
+
+        :Usage:
+            element = driver.switch_to.active_element
+            alert = driver.switch_to.alert
+            driver.switch_to.default_content()
+            driver.switch_to.frame('frame_name')
+            driver.switch_to.frame(1)
+            driver.switch_to.frame(driver.find_elements_by_tag_name("iframe")[0])
+            driver.switch_to.parent_frame()
+            driver.switch_to.window('main')
+        """
         return self._switch_to
 
     # Target Locators
index b87cc50..03dacfb 100644 (file)
@@ -103,7 +103,6 @@ class WebElement(object):
 
         Example::
 
-            # Check if the "active" CSS class is applied to an element.
             text_length = target_element.get_property("text_length")
         """
         try:
@@ -163,15 +162,32 @@ class WebElement(object):
         """Finds element within this element's children by ID.
 
         :Args:
-            - id\_ - ID of child element to locate.
+         - id\_ - ID of child element to locate.
+
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
+        :Usage:
+            foo_element = element.find_element_by_id('foo')
         """
         return self.find_element(by=By.ID, value=id_)
 
     def find_elements_by_id(self, id_):
         """Finds a list of elements within this element's children by ID.
+        Will return a list of webelements if found, or an empty list if not.
 
         :Args:
-            - id\_ - Id of child element to find.
+         - id\_ - Id of child element to find.
+
+        :Returns:
+         - list of WebElement - a list with elements if any was found.  An
+           empty list if not
+
+        :Usage:
+            elements = element.find_elements_by_id('foo')
         """
         return self.find_elements(by=By.ID, value=id_)
 
@@ -179,7 +195,16 @@ class WebElement(object):
         """Finds element within this element's children by name.
 
         :Args:
-            - name - name property of the element to find.
+         - name - name property of the element to find.
+
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
+        :Usage:
+            element = element.find_element_by_name('foo')
         """
         return self.find_element(by=By.NAME, value=name)
 
@@ -187,7 +212,14 @@ class WebElement(object):
         """Finds a list of elements within this element's children by name.
 
         :Args:
-            - name - name property to search for.
+         - name - name property to search for.
+
+        :Returns:
+         - list of webelement - a list with elements if any was found.  an
+           empty list if not
+
+        :Usage:
+            elements = element.find_elements_by_name('foo')
         """
         return self.find_elements(by=By.NAME, value=name)
 
@@ -195,7 +227,16 @@ class WebElement(object):
         """Finds element within this element's children by visible link text.
 
         :Args:
-            - link_text - Link text string to search for.
+         - link_text - Link text string to search for.
+
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
+        :Usage:
+            element = element.find_element_by_link_text('Sign In')
         """
         return self.find_element(by=By.LINK_TEXT, value=link_text)
 
@@ -203,7 +244,14 @@ class WebElement(object):
         """Finds a list of elements within this element's children by visible link text.
 
         :Args:
-            - link_text - Link text string to search for.
+         - link_text - Link text string to search for.
+
+        :Returns:
+         - list of webelement - a list with elements if any was found.  an
+           empty list if not
+
+        :Usage:
+            elements = element.find_elements_by_link_text('Sign In')
         """
         return self.find_elements(by=By.LINK_TEXT, value=link_text)
 
@@ -211,7 +259,16 @@ class WebElement(object):
         """Finds element within this element's children by partially visible link text.
 
         :Args:
-            - link_text - Link text string to search for.
+         - link_text: The text of the element to partially match on.
+
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
+        :Usage:
+            element = element.find_element_by_partial_link_text('Sign')
         """
         return self.find_element(by=By.PARTIAL_LINK_TEXT, value=link_text)
 
@@ -219,7 +276,14 @@ class WebElement(object):
         """Finds a list of elements within this element's children by link text.
 
         :Args:
-            - link_text - Link text string to search for.
+         - link_text: The text of the element to partial match on.
+
+        :Returns:
+         - list of webelement - a list with elements if any was found.  an
+           empty list if not
+
+        :Usage:
+            elements = element.find_elements_by_partial_link_text('Sign')
         """
         return self.find_elements(by=By.PARTIAL_LINK_TEXT, value=link_text)
 
@@ -227,7 +291,16 @@ class WebElement(object):
         """Finds element within this element's children by tag name.
 
         :Args:
-            - name - name of html tag (eg: h1, a, span)
+         - name - name of html tag (eg: h1, a, span)
+
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
+        :Usage:
+            element = element.find_element_by_tag_name('h1')
         """
         return self.find_element(by=By.TAG_NAME, value=name)
 
@@ -235,7 +308,14 @@ class WebElement(object):
         """Finds a list of elements within this element's children by tag name.
 
         :Args:
-            - name - name of html tag (eg: h1, a, span)
+         - name - name of html tag (eg: h1, a, span)
+
+        :Returns:
+         - list of WebElement - a list with elements if any was found.  An
+           empty list if not
+
+        :Usage:
+            elements = element.find_elements_by_tag_name('h1')
         """
         return self.find_elements(by=By.TAG_NAME, value=name)
 
@@ -243,7 +323,7 @@ class WebElement(object):
         """Finds element by xpath.
 
         :Args:
-            xpath - xpath of element to locate.  "//input[@class='myelement']"
+         - xpath - xpath of element to locate.  "//input[@class='myelement']"
 
         Note: The base path will be relative to this element's location.
 
@@ -251,14 +331,22 @@ class WebElement(object):
 
         ::
 
-            myelement.find_elements_by_xpath(".//a")
+            myelement.find_element_by_xpath(".//a")
 
         However, this will select the first link on the page.
 
         ::
 
-            myelement.find_elements_by_xpath("//a")
+            myelement.find_element_by_xpath("//a")
+
+        :Returns:
+         - WebElement - the element if it was found
 
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
+        :Usage:
+            element = element.find_element_by_xpath('//div/td[1]')
         """
         return self.find_element(by=By.XPATH, value=xpath)
 
@@ -266,7 +354,7 @@ class WebElement(object):
         """Finds elements within the element by xpath.
 
         :Args:
-            - xpath - xpath locator string.
+         - xpath - xpath locator string.
 
         Note: The base path will be relative to this element's location.
 
@@ -282,6 +370,13 @@ class WebElement(object):
 
             myelement.find_elements_by_xpath("//a")
 
+        :Returns:
+         - list of WebElement - a list with elements if any was found.  An
+           empty list if not
+
+        :Usage:
+            elements = element.find_elements_by_xpath("//div[contains(@class, 'foo')]")
+
         """
         return self.find_elements(by=By.XPATH, value=xpath)
 
@@ -289,7 +384,16 @@ class WebElement(object):
         """Finds element within this element's children by class name.
 
         :Args:
-            - name - class name to search for.
+         - name: The class name of the element to find.
+
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
+        :Usage:
+            element = element.find_element_by_class_name('foo')
         """
         return self.find_element(by=By.CLASS_NAME, value=name)
 
@@ -297,7 +401,14 @@ class WebElement(object):
         """Finds a list of elements within this element's children by class name.
 
         :Args:
-            - name - class name to search for.
+         - name: The class name of the elements to find.
+
+        :Returns:
+         - list of WebElement - a list with elements if any was found.  An
+           empty list if not
+
+        :Usage:
+            elements = element.find_elements_by_class_name('foo')
         """
         return self.find_elements(by=By.CLASS_NAME, value=name)
 
@@ -305,7 +416,16 @@ class WebElement(object):
         """Finds element within this element's children by CSS selector.
 
         :Args:
-            - css_selector - CSS selctor string, ex: 'a.nav#home'
+         - css_selector - CSS selector string, ex: 'a.nav#home'
+
+        :Returns:
+         - WebElement - the element if it was found
+
+        :Raises:
+         - NoSuchElementException - if the element wasn't found
+
+        :Usage:
+            element = element.find_element_by_css_selector('#foo')
         """
         return self.find_element(by=By.CSS_SELECTOR, value=css_selector)
 
@@ -313,7 +433,14 @@ class WebElement(object):
         """Finds a list of elements within this element's children by CSS selector.
 
         :Args:
-            - css_selector - CSS selctor string, ex: 'a.nav#home'
+         - css_selector - CSS selector string, ex: 'a.nav#home'
+
+        :Returns:
+         - list of WebElement - a list with elements if any was found.  An
+           empty list if not
+
+        :Usage:
+            elements = element.find_elements_by_css_selector('.foo')
         """
         return self.find_elements(by=By.CSS_SELECTOR, value=css_selector)
 
index 7921552..7584937 100644 (file)
@@ -385,7 +385,6 @@ class alert_is_present(object):
     def __call__(self, driver):
         try:
             alert = driver.switch_to.alert
-            alert.text
             return alert
         except NoAlertPresentException:
             return False
index 8b79fc3..5dc28ca 100644 (file)
@@ -22,35 +22,35 @@ class Options(object):
     KEY = 'webkitgtk:browserOptions'
 
     def __init__(self):
-        self._browser_executable_path = ''
-        self._browser_arguments = []
+        self._binary_location = ''
+        self._arguments = []
         self._overlay_scrollbars_enabled = True
 
     @property
-    def browser_executable_path(self):
+    def binary_location(self):
         """
         Returns the location of the browser binary otherwise an empty string
         """
-        return self._browser_executable_path
+        return self._binary_location
 
-    @browser_executable_path.setter
-    def browser_executable_path(self, value):
+    @binary_location.setter
+    def binary_location(self, value):
         """
         Allows you to set the browser binary to launch
 
         :Args:
          - value : path to the browser binary
         """
-        self._browser_executable_path = value
+        self._binary_location = value
 
     @property
-    def browser_arguments(self):
+    def arguments(self):
         """
         Returns a list of arguments needed for the browser
         """
-        return self._browser_arguments
+        return self._arguments
 
-    def add_browser_argument(self, argument):
+    def add_argument(self, argument):
         """
         Adds an argument to the list
 
@@ -58,7 +58,7 @@ class Options(object):
          - Sets the arguments
         """
         if argument:
-            self._browser_arguments.append(argument)
+            self._arguments.append(argument)
         else:
             raise ValueError("argument can not be null")
 
@@ -87,10 +87,10 @@ class Options(object):
         webkitgtk = DesiredCapabilities.WEBKITGTK.copy()
 
         browser_options = {}
-        if self.browser_executable_path:
-            browser_options["binary"] = self.browser_executable_path
-        if self.browser_arguments:
-            browser_options["args"] = self.browser_arguments
+        if self.binary_location:
+            browser_options["binary"] = self.binary_location
+        if self.arguments:
+            browser_options["args"] = self.arguments
         browser_options["useOverlayScrollbars"] = self.overlay_scrollbars_enabled
 
         webkitgtk[Options.KEY] = browser_options
index 16ab12c..990e1c5 100644 (file)
@@ -25,8 +25,7 @@ from selenium.webdriver.support.wait import WebDriverWait
 from selenium.common.exceptions import (
     InvalidElementStateException,
     NoAlertPresentException,
-    UnexpectedAlertPresentException,
-    WebDriverException)
+    UnexpectedAlertPresentException)
 
 
 @pytest.fixture(autouse=True)
@@ -57,9 +56,6 @@ def testShouldBeAbleToOverrideTheWindowAlertMethod(driver, pages):
         raise e
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testShouldAllowUsersToAcceptAnAlertManually(driver, pages):
@@ -71,9 +67,6 @@ def testShouldAllowUsersToAcceptAnAlertManually(driver, pages):
     assert "Testing Alerts" == driver.title
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testShouldAllowUsersToAcceptAnAlertWithNoTextManually(driver, pages):
@@ -86,9 +79,6 @@ def testShouldAllowUsersToAcceptAnAlertWithNoTextManually(driver, pages):
     assert "Testing Alerts" == driver.title
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testShouldGetTextOfAlertOpenedInSetTimeout(driver, pages):
@@ -109,9 +99,6 @@ def testShouldGetTextOfAlertOpenedInSetTimeout(driver, pages):
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=26 and https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500',
     run=False)
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 def testShouldAllowUsersToDismissAnAlertManually(driver, pages):
     pages.load("alerts.html")
     driver.find_element(by=By.ID, value="alert").click()
@@ -121,9 +108,6 @@ def testShouldAllowUsersToDismissAnAlertManually(driver, pages):
     assert "Testing Alerts" == driver.title
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testShouldAllowAUserToAcceptAPrompt(driver, pages):
@@ -136,9 +120,6 @@ def testShouldAllowAUserToAcceptAPrompt(driver, pages):
     assert "Testing Alerts" == driver.title
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testShouldAllowAUserToDismissAPrompt(driver, pages):
@@ -153,9 +134,6 @@ def testShouldAllowAUserToDismissAPrompt(driver, pages):
 
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 def testShouldAllowAUserToSetTheValueOfAPrompt(driver, pages):
     pages.load("alerts.html")
     driver.find_element(by=By.ID, value="prompt").click()
@@ -169,9 +147,6 @@ def testShouldAllowAUserToSetTheValueOfAPrompt(driver, pages):
 
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1353')
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 def testSettingTheValueOfAnAlertThrows(driver, pages):
     pages.load("alerts.html")
     driver.find_element(By.ID, "alert").click()
@@ -186,9 +161,6 @@ def testSettingTheValueOfAnAlertThrows(driver, pages):
     condition=sys.platform == 'darwin',
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=26',
     run=False)
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 def testAlertShouldNotAllowAdditionalCommandsIfDimissed(driver, pages):
     pages.load("alerts.html")
     driver.find_element(By.ID, "alert").click()
@@ -200,9 +172,6 @@ def testAlertShouldNotAllowAdditionalCommandsIfDimissed(driver, pages):
         alert.text
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 @pytest.mark.xfail_marionette(reason='Fails on travis')
@@ -217,9 +186,6 @@ def testShouldAllowUsersToAcceptAnAlertInAFrame(driver, pages):
     assert "Testing Alerts" == driver.title
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 @pytest.mark.xfail_marionette(reason='Fails on travis')
@@ -241,9 +207,6 @@ def testShouldThrowAnExceptionIfAnAlertHasNotBeenDealtWithAndDismissTheAlert():
     # //TODO(David) Complete this test
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testPromptShouldUseDefaultValueIfNoKeysSent(driver, pages):
@@ -257,9 +220,6 @@ def testPromptShouldUseDefaultValueIfNoKeysSent(driver, pages):
     assert "This is a default value" == txt
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testPromptShouldHaveNullValueIfDismissed(driver, pages):
@@ -271,9 +231,6 @@ def testPromptShouldHaveNullValueIfDismissed(driver, pages):
     assert "null" == driver.find_element(By.ID, "text").text
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testHandlesTwoAlertsFromOneInteraction(driver, pages):
@@ -293,9 +250,6 @@ def testHandlesTwoAlertsFromOneInteraction(driver, pages):
     assert driver.find_element(By.ID, "text2").text == "cheddar"
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testShouldHandleAlertOnPageLoad(driver, pages):
@@ -307,9 +261,6 @@ def testShouldHandleAlertOnPageLoad(driver, pages):
     assert "onload" == value
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 def testShouldHandleAlertOnPageLoadUsingGet(driver, pages):
     pages.load("pageWithOnLoad.html")
     alert = _waitForAlert(driver)
@@ -320,9 +271,6 @@ def testShouldHandleAlertOnPageLoadUsingGet(driver, pages):
     WebDriverWait(driver, 3).until(EC.text_to_be_present_in_element((By.TAG_NAME, "p"), "Page with onload event handler"))
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testShouldHandleAlertOnPageBeforeUnload(driver, pages):
@@ -341,9 +289,6 @@ def testShouldHandleAlertOnPageBeforeUnload(driver, pages):
     WebDriverWait(driver, 3).until(EC.title_is("Testing Alerts"))
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def _testShouldHandleAlertOnPageBeforeUnloadAtQuit(driver, pages):
@@ -358,9 +303,6 @@ def _testShouldHandleAlertOnPageBeforeUnloadAtQuit(driver, pages):
     driver.quit()
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testShouldAllowTheUserToGetTheTextOfAnAlert(driver, pages):
@@ -374,9 +316,6 @@ def testShouldAllowTheUserToGetTheTextOfAnAlert(driver, pages):
 
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 def testShouldAllowTheUserToGetTheTextOfAPrompt(driver, pages):
     pages.load("alerts.html")
     driver.find_element(By.ID, "prompt").click()
@@ -388,9 +327,6 @@ def testShouldAllowTheUserToGetTheTextOfAPrompt(driver, pages):
     assert "Enter something" == value
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
 def testAlertShouldNotAllowAdditionalCommandsIfDismissed(driver, pages):
@@ -408,9 +344,6 @@ def testAlertShouldNotAllowAdditionalCommandsIfDismissed(driver, pages):
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1537')
 @pytest.mark.xfail_marionette(
     reason='https://bugzilla.mozilla.org/show_bug.cgi?id=1279211')
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 def testUnexpectedAlertPresentExceptionContainsAlertText(driver, pages):
     pages.load("alerts.html")
     driver.find_element(by=By.ID, value="alert").click()
index 65ed120..478b4d4 100644 (file)
@@ -254,8 +254,6 @@ def testIsElementDisplayed(driver, pages):
     assert not not_visible
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/466')
 def testMoveWindowPosition(driver, pages):
     pages.load("blank.html")
     loc = driver.get_window_position()
index ff4185c..946a33b 100644 (file)
@@ -23,7 +23,6 @@ from selenium.webdriver.common.html5.application_cache import ApplicationCache
 
 @pytest.mark.xfail_chrome
 @pytest.mark.xfail_marionette(raises=WebDriverException)
-@pytest.mark.xfail_phantomjs(raises=WebDriverException)
 @pytest.mark.xfail_remote
 def testWeCanGetTheStatusOfTheAppCache(driver, pages):
     pages.load('html5Page')
index b4dc2bd..e4240bf 100644 (file)
@@ -19,10 +19,8 @@ import pytest
 
 from selenium.webdriver.common.by import By
 from selenium.common.exceptions import (
-    InvalidElementStateException,
     InvalidSelectorException,
     NoSuchElementException,
-    NoSuchWindowException,
     WebDriverException)
 
 # By.id positive
@@ -72,14 +70,12 @@ def test_Should_Not_Be_Able_To_Locate_By_Id_Multiple_Elements_That_Do_Not_Exist(
     assert len(elements) == 0
 
 
-@pytest.mark.xfail_phantomjs(raises=NoSuchWindowException)
 def test_Finding_ASingle_Element_By_Empty_Id_Should_Throw(driver, pages):
     pages.load("formPage.html")
     with pytest.raises(NoSuchElementException):
         driver.find_element(By.ID, "")
 
 
-@pytest.mark.xfail_phantomjs(raises=NoSuchElementException)
 def test_Finding_Multiple_Elements_By_Empty_Id_Should_Return_Empty_List(driver, pages):
     pages.load("formPage.html")
     elements = driver.find_elements(By.ID, "")
@@ -132,14 +128,12 @@ def test_Should_Not_Be_Able_To_Locate_By_Name_Multiple_Elements_That_Do_Not_Exis
     assert len(elements) == 0
 
 
-@pytest.mark.xfail_phantomjs(raises=NoSuchWindowException)
 def test_Finding_ASingle_Element_By_Empty_Name_Should_Throw(driver, pages):
     pages.load("formPage.html")
     with pytest.raises(NoSuchElementException):
         driver.find_element(By.NAME, "")
 
 
-@pytest.mark.xfail_phantomjs(raises=NoSuchElementException)
 def test_Finding_Multiple_Elements_By_Empty_Name_Should_Return_Empty_List(driver, pages):
     pages.load("formPage.html")
     elements = driver.find_elements(By.NAME, "")
@@ -188,7 +182,6 @@ def test_Should_Not_Be_Able_To_Locate_By_Tag_Name_Multiple_Elements_That_Do_Not_
 
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1541')
-@pytest.mark.xfail_phantomjs
 def test_Finding_ASingle_Element_By_Empty_Tag_Name_Should_Throw(driver, pages):
     pages.load("formPage.html")
     with pytest.raises(InvalidSelectorException):
@@ -197,7 +190,6 @@ def test_Finding_ASingle_Element_By_Empty_Tag_Name_Should_Throw(driver, pages):
 
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1541')
-@pytest.mark.xfail_phantomjs
 def test_Finding_Multiple_Elements_By_Empty_Tag_Name_Should_Throw(driver, pages):
     pages.load("formPage.html")
     with pytest.raises(InvalidSelectorException):
@@ -269,7 +261,6 @@ def test_Should_Not_Find_Element_By_Class_When_The_Name_Queried_Is_Shorter_Than_
         driver.find_element(By.CLASS_NAME, "name_B")
 
 
-@pytest.mark.xfail_phantomjs(raises=NoSuchWindowException)
 def test_Finding_ASingle_Element_By_Empty_Class_Name_Should_Throw(driver, pages):
     pages.load("xhtmlTest.html")
     with pytest.raises(NoSuchElementException):
@@ -282,21 +273,18 @@ def test_Finding_Multiple_Elements_By_Empty_Class_Name_Should_Throw(driver, page
         driver.find_elements(By.CLASS_NAME, "")
 
 
-@pytest.mark.xfail_phantomjs(raises=WebDriverException)
 def test_Finding_ASingle_Element_By_Compound_Class_Name_Should_Throw(driver, pages):
     pages.load("xhtmlTest.html")
     with pytest.raises(NoSuchElementException):
         driver.find_element(By.CLASS_NAME, "a b")
 
 
-@pytest.mark.xfail_phantomjs(raises=InvalidElementStateException)
 def test_Finding_ASingle_Element_By_Invalid_Class_Name_Should_Throw(driver, pages):
     pages.load("xhtmlTest.html")
     with pytest.raises(NoSuchElementException):
         driver.find_element(By.CLASS_NAME, "!@#$%^&*")
 
 
-@pytest.mark.xfail_phantomjs(raises=InvalidElementStateException)
 def test_Finding_Multiple_Elements_By_Invalid_Class_Name_Should_Throw(driver, pages):
     pages.load("xhtmlTest.html")
     with pytest.raises(NoSuchElementException):
@@ -356,7 +344,6 @@ def test_Finding_ALink_By_Xpath_Using_Contains_Keyword_Should_Work(driver, pages
 @pytest.mark.xfail_firefox(raises=InvalidSelectorException)
 @pytest.mark.xfail_remote(raises=InvalidSelectorException)
 @pytest.mark.xfail_marionette(raises=WebDriverException)
-@pytest.mark.xfail_phantomjs(raises=InvalidSelectorException)
 @pytest.mark.xfail_safari(raises=NoSuchElementException)
 @pytest.mark.xfail_webkitgtk(raises=InvalidSelectorException)
 def test_Should_Be_Able_To_Find_Element_By_XPath_With_Namespace(driver, pages):
@@ -493,7 +480,6 @@ def test_Should_Not_Find_Elements_By_Css_Selector_When_There_Is_No_Such_Element(
     assert len(elements) == 0
 
 
-@pytest.mark.xfail_phantomjs(raises=NoSuchWindowException)
 def test_Finding_ASingle_Element_By_Empty_Css_Selector_Should_Throw(driver, pages):
     pages.load("xhtmlTest.html")
     with pytest.raises(NoSuchElementException):
@@ -506,14 +492,12 @@ def test_Finding_Multiple_Elements_By_Empty_Css_Selector_Should_Throw(driver, pa
         driver.find_elements(By.CSS_SELECTOR, "")
 
 
-@pytest.mark.xfail_phantomjs(raises=InvalidElementStateException)
 def test_Finding_ASingle_Element_By_Invalid_Css_Selector_Should_Throw(driver, pages):
     pages.load("xhtmlTest.html")
     with pytest.raises(NoSuchElementException):
         driver.find_element(By.CSS_SELECTOR, "//a/b/c[@id='1']")
 
 
-@pytest.mark.xfail_phantomjs(raises=InvalidElementStateException)
 def test_Finding_Multiple_Elements_By_Invalid_Css_Selector_Should_Throw(driver, pages):
     pages.load("xhtmlTest.html")
     with pytest.raises(NoSuchElementException):
index 5ce6a66..76fb0a3 100644 (file)
@@ -100,7 +100,6 @@ def testShouldBeAbleToReturnArraysOfWebElementsFromAsyncScripts(driver, pages):
     # assert list_[0] == list_[1]
 
 
-@pytest.mark.xfail_phantomjs(run=False)
 def testShouldTimeoutIfScriptDoesNotInvokeCallback(driver, pages):
     pages.load("ajaxy_page.html")
     with pytest.raises(TimeoutException):
@@ -108,7 +107,6 @@ def testShouldTimeoutIfScriptDoesNotInvokeCallback(driver, pages):
         driver.execute_async_script("return 1 + 2;")
 
 
-@pytest.mark.xfail_phantomjs(run=False)
 def testShouldTimeoutIfScriptDoesNotInvokeCallbackWithAZeroTimeout(driver, pages):
     pages.load("ajaxy_page.html")
     with pytest.raises(TimeoutException):
index bd9cc5d..aab6b09 100644 (file)
 # specific language governing permissions and limitations
 # under the License.
 
-try:
-    from http.client import BadStatusLine
-except ImportError:
-    from httplib import BadStatusLine
-
 import pytest
 
 from selenium.common.exceptions import (
@@ -181,7 +176,6 @@ def testShouldThrowAnExceptionWhenAFrameCannotBeFoundByIndex(driver, pages):
         driver.switch_to.frame(27)
 
 
-@pytest.mark.xfail_phantomjs(raises=WebDriverException)
 def testShouldBeAbleToSwitchToParentFrame(driver, pages):
     pages.load("frameset.html")
     driver.switch_to.frame(driver.find_element_by_name("fourth"))
@@ -190,7 +184,6 @@ def testShouldBeAbleToSwitchToParentFrame(driver, pages):
     assert driver.find_element(By.ID, "pageNumber").text == "1"
 
 
-@pytest.mark.xfail_phantomjs(raises=WebDriverException)
 def testShouldBeAbleToSwitchToParentFrameFromASecondLevelFrame(driver, pages):
     pages.load("frameset.html")
     driver.switch_to.frame(driver.find_element_by_name("fourth"))
@@ -200,14 +193,12 @@ def testShouldBeAbleToSwitchToParentFrameFromASecondLevelFrame(driver, pages):
     assert driver.find_element(By.ID, "pageNumber").text == "11"
 
 
-@pytest.mark.xfail_phantomjs(raises=WebDriverException)
 def testSwitchingToParentFrameFromDefaultContextIsNoOp(driver, pages):
     pages.load("xhtmlTest.html")
     driver.switch_to.parent_frame()
     assert driver.title == "XHTML Test Page"
 
 
-@pytest.mark.xfail_phantomjs(raises=WebDriverException)
 def testShouldBeAbleToSwitchToParentFromAnIframe(driver, pages):
     pages.load("iframes.html")
     driver.switch_to.frame(0)
@@ -310,7 +301,6 @@ def testShouldBeAbleToFindElementsInIframesByXPath(driver, pages):
     assert element is not None
 
 
-@pytest.mark.xfail_phantomjs
 def testGetCurrentUrlReturnsTopLevelBrowsingContextUrl(driver, pages):
     pages.load("frameset.html")
     assert "frameset.html" in driver.current_url
@@ -318,7 +308,6 @@ def testGetCurrentUrlReturnsTopLevelBrowsingContextUrl(driver, pages):
     assert "frameset.html" in driver.current_url
 
 
-@pytest.mark.xfail_phantomjs
 def testGetCurrentUrlReturnsTopLevelBrowsingContextUrlForIframes(driver, pages):
     pages.load("iframes.html")
     assert "iframes.html" in driver.current_url
@@ -326,7 +315,6 @@ def testGetCurrentUrlReturnsTopLevelBrowsingContextUrlForIframes(driver, pages):
     assert "iframes.html" in driver.current_url
 
 
-@pytest.mark.xfail_phantomjs(raises=BadStatusLine)
 def testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs(driver, pages):
     pages.load("frame_switching_tests/deletingFrame.html")
     driver.switch_to.frame(driver.find_element_by_id("iframe1"))
@@ -344,7 +332,6 @@ def testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs(driver, pages
     WebDriverWait(driver, 3).until(EC.presence_of_element_located((By.ID, "success")))
 
 
-@pytest.mark.xfail_phantomjs(raises=BadStatusLine)
 def testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithFrameIndex(driver, pages):
     pages.load("frame_switching_tests/deletingFrame.html")
     iframe = 0
@@ -360,7 +347,6 @@ def testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithFrameIndex
     WebDriverWait(driver, 3).until(EC.presence_of_element_located((By.ID, "success")))
 
 
-@pytest.mark.xfail_phantomjs(raises=BadStatusLine)
 def testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithWebelement(driver, pages):
     pages.load("frame_switching_tests/deletingFrame.html")
     iframe = driver.find_element(By.ID, "iframe1")
@@ -379,7 +365,6 @@ def testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithWebelement
 
 
 @pytest.mark.xfail_chrome(raises=NoSuchElementException)
-@pytest.mark.xfail_phantomjs(raises=BadStatusLine)
 @pytest.mark.xfail_marionette(raises=WebDriverException,
                               reason='https://github.com/mozilla/geckodriver/issues/614')
 @pytest.mark.xfail_webkitgtk(raises=NoSuchElementException)
index d02d316..52152ba 100644 (file)
@@ -110,8 +110,6 @@ def testDoubleClick(driver, pages):
     assert "DoubleClicked" == toDoubleClick.get_attribute('value')
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/ariya/phantomjs/issues/14005')
 def testContextClick(driver, pages):
     """Copied from org.openqa.selenium.interactions.TestBasicMouseInterface."""
     pages.load("javascriptPage.html")
@@ -149,7 +147,6 @@ def testCannotMoveToANullLocator(driver, pages):
 
 @pytest.mark.xfail_marionette(
     reason='https://bugzilla.mozilla.org/show_bug.cgi?id=1292178')
-@pytest.mark.xfail_phantomjs
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
 def testClickingOnFormElements(driver, pages):
index c311911..473a6e6 100644 (file)
@@ -26,16 +26,12 @@ def reset_timeouts(driver):
     driver.set_page_load_timeout(300)
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='PhantomJS does not implement page load timeouts')
 def testShouldTimeoutOnPageLoadTakingTooLong(driver, pages):
     driver.set_page_load_timeout(0.01)
     with pytest.raises(TimeoutException):
         pages.load("simpleTest.html")
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='PhantomJS does not implement page load timeouts')
 def testClickShouldTimeout(driver, pages):
     pages.load("simpleTest.html")
     driver.set_page_load_timeout(0.01)
index ed8ba46..0b242a0 100644 (file)
@@ -57,7 +57,6 @@ def testShouldScrollPageAndGetCoordinatesOfAnElementThatIsOutOfViewPort(driver,
 
 
 @pytest.mark.xfail_marionette
-@pytest.mark.xfail_phantomjs
 def testShouldGetCoordinatesOfAnElementInAFrame(driver, pages):
     pages.load("coordinates_tests/element_in_frame.html")
     driver.switch_to_frame(driver.find_element(By.NAME, "ifr"))
@@ -67,7 +66,6 @@ def testShouldGetCoordinatesOfAnElementInAFrame(driver, pages):
 
 
 @pytest.mark.xfail_marionette
-@pytest.mark.xfail_phantomjs
 def testShouldGetCoordinatesOfAnElementInANestedFrame(driver, pages):
     pages.load("coordinates_tests/element_in_nested_frame.html")
     driver.switch_to_frame(driver.find_element(By.NAME, "ifr"))
index 0ecb5de..75a6255 100644 (file)
@@ -54,9 +54,6 @@ def testShouldCorrectlyIdentifyThatAnElementHasWidth(driver, pages):
 @pytest.mark.xfail_chrome(
     reason='Get Element Rect command not implemented',
     raises=WebDriverException)
-@pytest.mark.xfail_phantomjs(
-    reason='Get Element Rect command not implemented',
-    raises=WebDriverException)
 @pytest.mark.xfail_safari(
     reason='Get Element Rect command not implemented',
     raises=WebDriverException)
index 2a9a1e7..4c287b4 100644 (file)
@@ -46,7 +46,6 @@ def testSelectByIndexSingle(driver, pages):
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
 @pytest.mark.xfail_marionette
-@pytest.mark.xfail_phantomjs
 @pytest.mark.xfail_safari
 def testSelectDisabledByIndexShouldThrowException(driver, pages):
     pages.load("formPage.html")
@@ -69,7 +68,6 @@ def testSelectByValueSingle(driver, pages):
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
 @pytest.mark.xfail_marionette
-@pytest.mark.xfail_phantomjs
 @pytest.mark.xfail_safari
 def testSelectDisabledByValueShouldThrowException(driver, pages):
     pages.load("formPage.html")
@@ -91,7 +89,6 @@ def testSelectByVisibleTextSingle(driver, pages):
 
 @pytest.mark.xfail_chrome(
     reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=822')
-@pytest.mark.xfail_phantomjs
 def testSelectByVisibleTextShouldNormalizeSpaces(driver, pages):
     pages.load("formPage.html")
 
@@ -107,7 +104,6 @@ def testSelectByVisibleTextShouldNormalizeSpaces(driver, pages):
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
 @pytest.mark.xfail_marionette
-@pytest.mark.xfail_phantomjs
 @pytest.mark.xfail_safari
 def testSelectDisabledByVisibleTextShouldThrowException(driver, pages):
     pages.load("formPage.html")
index 98763a7..786ba85 100644 (file)
 # specific language governing permissions and limitations
 # under the License.
 
-import pytest
-
 from selenium.common.exceptions import (
     ElementNotVisibleException,
-    ElementNotInteractableException,
-    InvalidElementStateException)
+    ElementNotInteractableException)
 from selenium.webdriver.common.by import By
 
 
@@ -95,7 +92,6 @@ def testShouldNotBeAbleToSelectAnElementThatIsNotDisplayed(driver, pages):
         pass
 
 
-@pytest.mark.xfail_phantomjs(raises=InvalidElementStateException)
 def testShouldNotBeAbleToTypeAnElementThatIsNotDisplayed(driver, pages):
     pages.load("javascriptPage.html")
     element = driver.find_element(by=By.ID, value="unclickable")
index 94440ad..7a34858 100644 (file)
@@ -34,7 +34,6 @@ def test_should_be_able_to_get_pointer_and_keyboard_inputs(driver, pages):
 @pytest.mark.xfail_chrome
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
-@pytest.mark.xfail_phantomjs
 @pytest.mark.xfail_marionette(
     reason='https://github.com/mozilla/geckodriver/issues/646')
 def testSendingKeysToActiveElementWithModifier(driver, pages):
@@ -56,7 +55,6 @@ def testSendingKeysToActiveElementWithModifier(driver, pages):
 @pytest.mark.xfail_chrome
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
-@pytest.mark.xfail_phantomjs
 def test_can_create_pause_action_on_keyboard(driver, pages):
     # If we don't get an error and takes less than 3 seconds to run, we are good
     import datetime
@@ -78,7 +76,6 @@ def test_can_create_pause_action_on_keyboard(driver, pages):
 @pytest.mark.xfail_chrome
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
-@pytest.mark.xfail_phantomjs
 def test_can_create_pause_action_on_pointer(driver, pages):
     # If we don't get an error and takes less than 3 seconds to run, we are good
     import datetime
@@ -100,7 +97,6 @@ def test_can_create_pause_action_on_pointer(driver, pages):
 @pytest.mark.xfail_chrome
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
-@pytest.mark.xfail_phantomjs
 def test_can_clear_actions(driver, pages):
     actions = ActionBuilder(driver)
     actions.clear_actions()
@@ -109,7 +105,6 @@ def test_can_clear_actions(driver, pages):
 @pytest.mark.xfail_chrome
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
-@pytest.mark.xfail_phantomjs
 def test_move_and_click(driver, pages):
     pages.load("javascriptPage.html")
     toClick = driver.find_element_by_id("clickField")
@@ -127,7 +122,6 @@ def test_move_and_click(driver, pages):
 @pytest.mark.xfail_chrome
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
-@pytest.mark.xfail_phantomjs
 def testDragAndDrop(driver, pages):
     """Copied from org.openqa.selenium.interactions.TestBasicMouseInterface."""
     element_available_timeout = 15
@@ -156,7 +150,6 @@ def testDragAndDrop(driver, pages):
 @pytest.mark.xfail_chrome
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
-@pytest.mark.xfail_phantomjs
 def test_context_click(driver, pages):
 
     pages.load("javascriptPage.html")
@@ -173,7 +166,6 @@ def test_context_click(driver, pages):
 @pytest.mark.xfail_chrome
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
-@pytest.mark.xfail_phantomjs
 @pytest.mark.xfail_marionette(
     reason='https://github.com/mozilla/geckodriver/issues/661')
 def test_double_click(driver, pages):
@@ -193,7 +185,6 @@ def test_double_click(driver, pages):
 @pytest.mark.xfail_chrome
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
-@pytest.mark.xfail_phantomjs
 def test_dragging_element_with_mouse_moves_it_to_another_list(driver, pages):
     _performDragAndDropWithMouse(driver, pages)
     dragInto = driver.find_element_by_id("sortable1")
@@ -203,7 +194,6 @@ def test_dragging_element_with_mouse_moves_it_to_another_list(driver, pages):
 @pytest.mark.xfail_chrome
 @pytest.mark.xfail_firefox
 @pytest.mark.xfail_remote
-@pytest.mark.xfail_phantomjs
 def test_dragging_element_with_mouse_fires_events(driver, pages):
     _performDragAndDropWithMouse(driver, pages)
     dragReporter = driver.find_element_by_id("dragging_reports")
index 4e2622b..6bf8cbf 100644 (file)
@@ -301,9 +301,6 @@ def testExpectedConditionElementLocatedSelectionStateToBe(driver, pages):
     assert element.is_selected() is True
 
 
-@pytest.mark.xfail_phantomjs(
-    reason='https://github.com/detro/ghostdriver/issues/20',
-    raises=WebDriverException)
 def testExpectedConditionAlertIsPresent(driver, pages):
     pages.load('blank.html')
     with pytest.raises(TimeoutException):
index b29a8ee..09636c6 100644 (file)
@@ -84,8 +84,6 @@ def test_should_set_the_position_of_the_current_window(driver):
                           reason='Get Window Rect command not implemented')
 @pytest.mark.xfail_firefox(raises=WebDriverException,
                            reason='Get Window Rect command not implemented')
-@pytest.mark.xfail_phantomjs(raises=WebDriverException,
-                             reason='Get Window Rect command not implemented')
 @pytest.mark.xfail_remote(raises=WebDriverException,
                           reason='Get Window Rect command not implemented')
 @pytest.mark.xfail_safari(raises=WebDriverException,
@@ -102,8 +100,6 @@ def test_should_get_the_rect_of_the_current_window(driver):
                           reason='Get Window Rect command not implemented')
 @pytest.mark.xfail_firefox(raises=WebDriverException,
                            reason='Get Window Rect command not implemented')
-@pytest.mark.xfail_phantomjs(raises=WebDriverException,
-                             reason='Get Window Rect command not implemented')
 @pytest.mark.xfail_remote(raises=WebDriverException,
                           reason='Get Window Rect command not implemented')
 @pytest.mark.xfail_safari(raises=WebDriverException,
@@ -133,8 +129,6 @@ def test_should_set_the_rect_of_the_current_window(driver):
                           reason='Fullscreen command not implemented')
 @pytest.mark.xfail_firefox(raises=WebDriverException,
                            reason='Fullscreen command not implemented')
-@pytest.mark.xfail_phantomjs(raises=WebDriverException,
-                             reason='Fullscreen command not implemented')
 @pytest.mark.xfail_remote(raises=WebDriverException,
                           reason='Fullscreen command not implemented')
 @pytest.mark.xfail_safari(raises=WebDriverException,
@@ -163,8 +157,6 @@ def test_should_fullscreen_the_current_window(driver):
                           reason='Minimize command not implemented')
 @pytest.mark.xfail_firefox(raises=WebDriverException,
                            reason='Minimize command not implemented')
-@pytest.mark.xfail_phantomjs(raises=WebDriverException,
-                             reason='Minimize command not implemented')
 @pytest.mark.xfail_remote(raises=WebDriverException,
                           reason='Minimize command not implemented')
 @pytest.mark.xfail_safari(raises=WebDriverException,