Unreviewed. Update Selenium WebDriver imported tests.
* imported/selenium/importer.json:
* imported/selenium/py/selenium/__init__.py:
* imported/selenium/py/selenium/common/exceptions.py:
* imported/selenium/py/selenium/webdriver/__init__.py:
* imported/selenium/py/selenium/webdriver/remote/webelement.py:
* imported/selenium/py/selenium/webdriver/safari/webdriver.py:
* imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@229213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebDriverTests/ChangeLog b/WebDriverTests/ChangeLog
index 5dd8593..ca8ec9c 100644
--- a/WebDriverTests/ChangeLog
+++ b/WebDriverTests/ChangeLog
@@ -1,3 +1,15 @@
+2018-03-05 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Unreviewed. Update Selenium WebDriver imported tests.
+
+ * imported/selenium/importer.json:
+ * imported/selenium/py/selenium/__init__.py:
+ * imported/selenium/py/selenium/common/exceptions.py:
+ * imported/selenium/py/selenium/webdriver/__init__.py:
+ * imported/selenium/py/selenium/webdriver/remote/webelement.py:
+ * imported/selenium/py/selenium/webdriver/safari/webdriver.py:
+ * imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py:
+
2018-03-01 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed gardening. Skip new action tests added in r229166.
diff --git a/WebDriverTests/imported/selenium/importer.json b/WebDriverTests/imported/selenium/importer.json
index f6177c4..192b313 100644
--- a/WebDriverTests/imported/selenium/importer.json
+++ b/WebDriverTests/imported/selenium/importer.json
@@ -1,6 +1,6 @@
{
"repository": "https://github.com/SeleniumHQ/selenium.git",
- "revision": "63d571a2d64a8930c171fe94fc7b2e7e4eefde87",
+ "revision": "300cd3fa0288d3a88eb4b4c459c54bd02a015118",
"paths_to_import": [
"common",
"py/conftest.py",
diff --git a/WebDriverTests/imported/selenium/py/selenium/__init__.py b/WebDriverTests/imported/selenium/py/selenium/__init__.py
index 3f61de6..e085c15 100644
--- a/WebDriverTests/imported/selenium/py/selenium/__init__.py
+++ b/WebDriverTests/imported/selenium/py/selenium/__init__.py
@@ -16,4 +16,4 @@
# under the License.
-__version__ = "3.9.0"
+__version__ = "3.10.0"
diff --git a/WebDriverTests/imported/selenium/py/selenium/common/exceptions.py b/WebDriverTests/imported/selenium/py/selenium/common/exceptions.py
index 1a06d71..df61eca 100644
--- a/WebDriverTests/imported/selenium/py/selenium/common/exceptions.py
+++ b/WebDriverTests/imported/selenium/py/selenium/common/exceptions.py
@@ -124,6 +124,9 @@
class InvalidElementStateException(WebDriverException):
"""
+ Thrown when a command could not be completed because the element is in an invalid state.
+
+ This can be caused by attempting to clear an element that isn't both editable and resettable.
"""
pass
diff --git a/WebDriverTests/imported/selenium/py/selenium/webdriver/__init__.py b/WebDriverTests/imported/selenium/py/selenium/webdriver/__init__.py
index 6146680..06fde31 100644
--- a/WebDriverTests/imported/selenium/py/selenium/webdriver/__init__.py
+++ b/WebDriverTests/imported/selenium/py/selenium/webdriver/__init__.py
@@ -24,4 +24,4 @@
from .common.touch_actions import TouchActions # noqa
from .common.proxy import Proxy # noqa
-__version__ = '3.8.1'
+__version__ = '3.9.0'
diff --git a/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py b/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py
index 03dacfb..730dcf4 100644
--- a/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py
+++ b/WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py
@@ -628,6 +628,14 @@
return self._parent.execute(command, params)
def find_element(self, by=By.ID, value=None):
+ """
+ 'Private' method used by the find_element_by_* methods.
+
+ :Usage:
+ Use the corresponding find_element_by_* instead of this.
+
+ :rtype: WebElement
+ """
if self._w3c:
if by == By.ID:
by = By.CSS_SELECTOR
@@ -645,6 +653,14 @@
{"using": by, "value": value})['value']
def find_elements(self, by=By.ID, value=None):
+ """
+ 'Private' method used by the find_elements_by_* methods.
+
+ :Usage:
+ Use the corresponding find_elements_by_* instead of this.
+
+ :rtype: list of WebElement
+ """
if self._w3c:
if by == By.ID:
by = By.CSS_SELECTOR
diff --git a/WebDriverTests/imported/selenium/py/selenium/webdriver/safari/webdriver.py b/WebDriverTests/imported/selenium/py/selenium/webdriver/safari/webdriver.py
index 6c559e6..0a8bfa6 100644
--- a/WebDriverTests/imported/selenium/py/selenium/webdriver/safari/webdriver.py
+++ b/WebDriverTests/imported/selenium/py/selenium/webdriver/safari/webdriver.py
@@ -22,7 +22,6 @@
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
-from .service import Service
class WebDriver(RemoteWebDriver):
@@ -31,20 +30,23 @@
"""
- def __init__(self, port=0, executable_path="/usr/bin/safaridriver",
+ def __init__(self, port=0, executable_path="/usr/bin/safaridriver", reuse_service=False,
desired_capabilities=DesiredCapabilities.SAFARI, quiet=False):
"""
- Creates a new instance of the Safari driver.
- Starts the service and then creates new instance of Safari Driver.
+ Creates a new Safari driver instance and launches or finds a running safaridriver service.
:Args:
- - port - port you would like the service to run, if left as 0, a free port will be found.
+ - port - The port on which the safaridriver service should listen for new connections. If zero, a free port will be found.
+ - quiet - If True, the driver's stdout and stderr is suppressed.
+ - executable_path - Path to a custom safaridriver executable to be used. If absent, /usr/bin/safaridriver is used.
- desired_capabilities: Dictionary object with desired capabilities (Can be used to provide various Safari switches).
- - quiet - set to True to suppress stdout and stderr of the driver
+ - reuse_service - If True, do not spawn a safaridriver instance; instead, connect to an already-running service that was launched externally.
"""
- self.service = Service(executable_path, port=port, quiet=quiet)
- self.service.start()
+
+ self._reuse_service = reuse_service
+ if not reuse_service:
+ self.service.start()
RemoteWebDriver.__init__(
self,
@@ -62,4 +64,5 @@
except http_client.BadStatusLine:
pass
finally:
- self.service.stop()
+ if not self._reuse_service:
+ self.service.stop()
diff --git a/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py b/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py
index 4c287b4..99fbca3 100644
--- a/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py
+++ b/WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py
@@ -45,13 +45,17 @@
@pytest.mark.xfail_chrome
@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
-@pytest.mark.xfail_marionette
-@pytest.mark.xfail_safari
-def testSelectDisabledByIndexShouldThrowException(driver, pages):
+@pytest.mark.xfail_marionette(reason='https://bugzilla.mozilla.org/show_bug.cgi?id=1429403')
+def testSelectDisabledByIndex(driver, pages):
pages.load("formPage.html")
sel = Select(driver.find_element(By.NAME, disabledSelect['name']))
- with pytest.raises(ElementNotSelectableException):
+ if driver.w3c:
+ selected = sel.first_selected_option
sel.select_by_index(1)
+ assert selected == sel.first_selected_option
+ else:
+ with pytest.raises(ElementNotSelectableException):
+ sel.select_by_index(1)
def testSelectByValueSingle(driver, pages):
@@ -67,13 +71,17 @@
@pytest.mark.xfail_chrome
@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
-@pytest.mark.xfail_marionette
-@pytest.mark.xfail_safari
-def testSelectDisabledByValueShouldThrowException(driver, pages):
+@pytest.mark.xfail_marionette(reason='https://bugzilla.mozilla.org/show_bug.cgi?id=1429403')
+def testSelectDisabledByValue(driver, pages):
pages.load("formPage.html")
sel = Select(driver.find_element(By.NAME, disabledSelect['name']))
- with pytest.raises(ElementNotSelectableException):
+ if driver.w3c:
+ selected = sel.first_selected_option
sel.select_by_value('bar')
+ assert selected == sel.first_selected_option
+ else:
+ with pytest.raises(ElementNotSelectableException):
+ sel.select_by_value('bar')
def testSelectByVisibleTextSingle(driver, pages):
@@ -103,13 +111,17 @@
@pytest.mark.xfail_chrome
@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
-@pytest.mark.xfail_marionette
-@pytest.mark.xfail_safari
-def testSelectDisabledByVisibleTextShouldThrowException(driver, pages):
+@pytest.mark.xfail_marionette(reason='https://bugzilla.mozilla.org/show_bug.cgi?id=1429403')
+def testSelectDisabledByVisibleText(driver, pages):
pages.load("formPage.html")
sel = Select(driver.find_element(By.NAME, disabledSelect['name']))
- with pytest.raises(ElementNotSelectableException):
+ if driver.w3c:
+ selected = sel.first_selected_option
sel.select_by_visible_text('Bar')
+ assert selected == sel.first_selected_option
+ else:
+ with pytest.raises(ElementNotSelectableException):
+ sel.select_by_visible_text('Bar')
def testSelectByIndexMultiple(driver, pages):