@@ -45,13 +45,17 @@ def testSelectByIndexSingle(driver, pages):
45
45
@pytest .mark .xfail_chrome
46
46
@pytest .mark .xfail_firefox
47
47
@pytest .mark .xfail_remote
48
- @pytest .mark .xfail_marionette
49
- @pytest .mark .xfail_safari
50
- def testSelectDisabledByIndexShouldThrowException (driver , pages ):
48
+ @pytest .mark .xfail_marionette (reason = 'https://bugzilla.mozilla.org/show_bug.cgi?id=1429403' )
49
+ def testSelectDisabledByIndex (driver , pages ):
51
50
pages .load ("formPage.html" )
52
51
sel = Select (driver .find_element (By .NAME , disabledSelect ['name' ]))
53
- with pytest .raises (ElementNotSelectableException ):
52
+ if driver .w3c :
53
+ selected = sel .first_selected_option
54
54
sel .select_by_index (1 )
55
+ assert selected == sel .first_selected_option
56
+ else :
57
+ with pytest .raises (ElementNotSelectableException ):
58
+ sel .select_by_index (1 )
55
59
56
60
57
61
def testSelectByValueSingle (driver , pages ):
@@ -67,13 +71,17 @@ def testSelectByValueSingle(driver, pages):
67
71
@pytest .mark .xfail_chrome
68
72
@pytest .mark .xfail_firefox
69
73
@pytest .mark .xfail_remote
70
- @pytest .mark .xfail_marionette
71
- @pytest .mark .xfail_safari
72
- def testSelectDisabledByValueShouldThrowException (driver , pages ):
74
+ @pytest .mark .xfail_marionette (reason = 'https://bugzilla.mozilla.org/show_bug.cgi?id=1429403' )
75
+ def testSelectDisabledByValue (driver , pages ):
73
76
pages .load ("formPage.html" )
74
77
sel = Select (driver .find_element (By .NAME , disabledSelect ['name' ]))
75
- with pytest .raises (ElementNotSelectableException ):
78
+ if driver .w3c :
79
+ selected = sel .first_selected_option
76
80
sel .select_by_value ('bar' )
81
+ assert selected == sel .first_selected_option
82
+ else :
83
+ with pytest .raises (ElementNotSelectableException ):
84
+ sel .select_by_value ('bar' )
77
85
78
86
79
87
def testSelectByVisibleTextSingle (driver , pages ):
@@ -103,13 +111,17 @@ def testSelectByVisibleTextShouldNormalizeSpaces(driver, pages):
103
111
@pytest .mark .xfail_chrome
104
112
@pytest .mark .xfail_firefox
105
113
@pytest .mark .xfail_remote
106
- @pytest .mark .xfail_marionette
107
- @pytest .mark .xfail_safari
108
- def testSelectDisabledByVisibleTextShouldThrowException (driver , pages ):
114
+ @pytest .mark .xfail_marionette (reason = 'https://bugzilla.mozilla.org/show_bug.cgi?id=1429403' )
115
+ def testSelectDisabledByVisibleText (driver , pages ):
109
116
pages .load ("formPage.html" )
110
117
sel = Select (driver .find_element (By .NAME , disabledSelect ['name' ]))
111
- with pytest .raises (ElementNotSelectableException ):
118
+ if driver .w3c :
119
+ selected = sel .first_selected_option
112
120
sel .select_by_visible_text ('Bar' )
121
+ assert selected == sel .first_selected_option
122
+ else :
123
+ with pytest .raises (ElementNotSelectableException ):
124
+ sel .select_by_visible_text ('Bar' )
113
125
114
126
115
127
def testSelectByIndexMultiple (driver , pages ):
0 commit comments