Diff
Modified: trunk/Tools/ChangeLog (226772 => 226773)
--- trunk/Tools/ChangeLog 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/Tools/ChangeLog 2018-01-11 12:13:40 UTC (rev 226773)
@@ -1,3 +1,16 @@
+2018-01-11 Carlos Garcia Campos <cgar...@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...@apple.com>
Move Commit Queue and EWS Queues to Sierra on Bot Watcher's Dasboard
Modified: trunk/Tools/Scripts/webkitpy/webdriver_tests/pytest_runner.py (226772 => 226773)
--- trunk/Tools/Scripts/webkitpy/webdriver_tests/pytest_runner.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/Tools/Scripts/webkitpy/webdriver_tests/pytest_runner.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -132,10 +132,11 @@
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 @@
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:
Modified: trunk/Tools/Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py (226772 => 226773)
--- trunk/Tools/Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/Tools/Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -41,19 +41,17 @@
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.extend(['--browser-args=%s' % ' '.join(browser_args)])
- self._args = ['--driver=%s' % driver.selenium_name()]
-
if pytest_runner is None:
do_delayed_imports()
Modified: trunk/WebDriverTests/ChangeLog (226772 => 226773)
--- trunk/WebDriverTests/ChangeLog 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/ChangeLog 2018-01-11 12:13:40 UTC (rev 226773)
@@ -1,3 +1,35 @@
+2018-01-11 Carlos Garcia Campos <cgar...@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 <cgar...@igalia.com>
Unreviewed. Update W3C WebDriver imported tests.
Modified: trunk/WebDriverTests/imported/selenium/importer.json (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/importer.json 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/importer.json 2018-01-11 12:13:40 UTC (rev 226773)
@@ -1,6 +1,6 @@
{
"repository": "https://github.com/SeleniumHQ/selenium.git",
- "revision": "57fe00346d1c4d6d3f8e33ae4d7426940e795a30",
+ "revision": "c5e4a585f1e3c4b3468ec93ab50d3668d47aef1b",
"paths_to_import": [
"common",
"py/conftest.py",
Modified: trunk/WebDriverTests/imported/selenium/py/conftest.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/conftest.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/conftest.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -41,7 +41,6 @@
'Firefox',
'Ie',
'Marionette',
- 'PhantomJS',
'Remote',
'Safari',
'WebKitGTK',
@@ -49,13 +48,15 @@
def pytest_addoption(parser):
- parser.addoption(
- '--driver',
- action='',
- choices=drivers,
- dest='drivers',
- metavar='DRIVER',
- help='driver to run tests against ({0})'.format(', '.join(drivers)))
+ parser.addoption('--driver', action='', choices=drivers, dest='drivers',
+ metavar='DRIVER',
+ help='driver to run tests against ({})'.format(', '.join(drivers)))
+ parser.addoption('--browser-binary', action='', dest='binary',
+ help='location of the browser binary')
+ parser.addoption('--driver-binary', action='', dest='executable',
+ help='location of the service executable binary')
+ parser.addoption('--browser-args', action='', dest='args',
+ help='arguments to start the browser with')
def pytest_ignore_collect(path, config):
@@ -94,6 +95,9 @@
yield
return
+ driver_path = request.config.option.executable
+ options = None
+
global driver_instance
if driver_instance is None:
if driver_class == 'BlackBerry':
@@ -100,28 +104,21 @@
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():
@@ -128,6 +125,22 @@
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():
Modified: trunk/WebDriverTests/imported/selenium/py/selenium/__init__.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/selenium/__init__.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/selenium/__init__.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -16,4 +16,4 @@
# under the License.
-__version__ = "3.8.0"
+__version__ = "3.8.1"
Modified: trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/__init__.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/__init__.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/__init__.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -24,4 +24,4 @@
from .common.touch_actions import TouchActions # noqa
from .common.proxy import Proxy # noqa
-__version__ = '3.8.0'
+__version__ = '3.8.1'
Modified: trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/common/action_chains.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/common/action_chains.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/common/action_chains.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -331,12 +331,12 @@
- 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
Modified: trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/common/service.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/common/service.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/common/service.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -71,7 +71,9 @@
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:
Modified: trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/remote_connection.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/remote_connection.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/remote_connection.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -200,6 +200,10 @@
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 @@
"""
command_info = self._commands[command]
assert command_info is not None, 'Unrecognised command %s' % command
+ 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 = ""
- path = string.Template(command_info[1]).substitute(params)
url = '' % (self._url, path)
return self._request(command_info[0], url, body=data)
@@ -558,5 +564,5 @@
data = "" 0, 'value': body.strip()}
return data
finally:
- LOGGER.debug("Finished Request")
+ LOGGER.debug(u"Finished Request {}".format(data))
resp.close()
Modified: trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/switch_to.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/switch_to.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/switch_to.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -51,7 +51,9 @@
:Usage:
alert = driver.switch_to.alert
"""
- return Alert(self._driver)
+ alert = Alert(self._driver)
+ alert.text
+ return alert
def default_content(self):
"""
Modified: trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webdriver.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webdriver.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webdriver.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -198,7 +198,7 @@
"""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 @@
# 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 @@
"""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 @@
: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 @@
: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 @@
: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 @@
: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 @@
: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 @@
: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 @@
: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 @@
: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 @@
: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 @@
: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 @@
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 @@
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 @@
: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 @@
: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 @@
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 @@
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 @@
- \*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 @@
- \*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 @@
@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
Modified: trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -103,7 +103,6 @@
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 @@
"""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 @@
"""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 @@
"""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 @@
"""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 @@
"""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 @@
"""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 @@
"""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 @@
"""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 @@
"""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 @@
"""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 @@
::
- 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 @@
"""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 @@
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 @@
"""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 @@
"""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 @@
"""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 @@
"""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)
Modified: trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/support/expected_conditions.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/support/expected_conditions.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/support/expected_conditions.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -385,7 +385,6 @@
def __call__(self, driver):
try:
alert = driver.switch_to.alert
- alert.text
return alert
except NoAlertPresentException:
return False
Modified: trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/webkitgtk/options.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/webkitgtk/options.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/selenium/webdriver/webkitgtk/options.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -22,19 +22,19 @@
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
@@ -41,16 +41,16 @@
: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 @@
- 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 @@
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
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -25,8 +25,7 @@
from selenium.common.exceptions import (
InvalidElementStateException,
NoAlertPresentException,
- UnexpectedAlertPresentException,
- WebDriverException)
+ UnexpectedAlertPresentException)
@pytest.fixture(autouse=True)
@@ -57,9 +56,6 @@
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 @@
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 @@
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 @@
@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 @@
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 @@
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 @@
@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 @@
@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 @@
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 @@
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 @@
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 @@
# //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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
@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 @@
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 @@
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()
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/api_example_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/api_example_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/api_example_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -254,8 +254,6 @@
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()
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/appcache_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/appcache_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/appcache_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -23,7 +23,6 @@
@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')
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/driver_element_finding_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/driver_element_finding_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/driver_element_finding_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -19,10 +19,8 @@
from selenium.webdriver.common.by import By
from selenium.common.exceptions import (
- InvalidElementStateException,
InvalidSelectorException,
NoSuchElementException,
- NoSuchWindowException,
WebDriverException)
# By.id positive
@@ -72,7 +70,6 @@
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):
@@ -79,7 +76,6 @@
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,7 +128,6 @@
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):
@@ -139,7 +134,6 @@
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 @@
@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 @@
@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 @@
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,7 +273,6 @@
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):
@@ -289,7 +279,6 @@
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):
@@ -296,7 +285,6 @@
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 @@
@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 @@
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,7 +492,6 @@
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):
@@ -513,7 +498,6 @@
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):
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/executing_async_javascript_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/executing_async_javascript_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/executing_async_javascript_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -100,7 +100,6 @@
# 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 @@
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):
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/frame_switching_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/frame_switching_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/frame_switching_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -15,11 +15,6 @@
# 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 @@
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 @@
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,7 +193,6 @@
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()
@@ -207,7 +199,6 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
@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)
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/interactions_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/interactions_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/interactions_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -110,8 +110,6 @@
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("_javascript_Page.html")
@@ -149,7 +147,6 @@
@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):
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/page_load_timeout_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/page_load_timeout_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/page_load_timeout_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -26,8 +26,6 @@
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):
@@ -34,8 +32,6 @@
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)
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/position_and_size_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/position_and_size_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/position_and_size_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -57,7 +57,6 @@
@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 @@
@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"))
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/rendered_webelement_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/rendered_webelement_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/rendered_webelement_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -54,9 +54,6 @@
@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)
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -46,7 +46,6 @@
@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 @@
@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 @@
@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 @@
@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")
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/visibility_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/visibility_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/visibility_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -15,12 +15,9 @@
# 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 @@
pass
-@pytest.mark.xfail_phantomjs(raises=InvalidElementStateException)
def testShouldNotBeAbleToTypeAnElementThatIsNotDisplayed(driver, pages):
pages.load("_javascript_Page.html")
element = driver.find_element(by=By.ID, value="unclickable")
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/w3c_interaction_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/w3c_interaction_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/w3c_interaction_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -34,7 +34,6 @@
@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 @@
@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 @@
@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 @@
@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 @@
@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("_javascript_Page.html")
toClick = driver.find_element_by_id("clickField")
@@ -127,7 +122,6 @@
@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 @@
@pytest.mark.xfail_chrome
@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
-@pytest.mark.xfail_phantomjs
def test_context_click(driver, pages):
pages.load("_javascript_Page.html")
@@ -173,7 +166,6 @@
@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 @@
@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 @@
@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")
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -301,9 +301,6 @@
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):
Modified: trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/window_tests.py (226772 => 226773)
--- trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/window_tests.py 2018-01-11 12:07:00 UTC (rev 226772)
+++ trunk/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/window_tests.py 2018-01-11 12:13:40 UTC (rev 226773)
@@ -84,8 +84,6 @@
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 @@
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 @@
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 @@
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,