[py] make tests to check clicking on disabled element work for w3c compliant drivers
They are currently mrked as expected failure, but we can actually test
both behaviors. Check that selection doesn't change for w3c drivers.
@@ -45,11 +45,15 @@ def testSelectByIndexSingle(driver, pages):
@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']))
+ 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)
@@ -67,11 +71,15 @@ def testSelectByValueSingle(driver, pages):
@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']))
+ 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')
@@ -103,11 +111,15 @@ def testSelectByVisibleTextShouldNormalizeSpaces(driver, pages):
@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']))
+ 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')
