@@ -58,7 +58,7 @@ def testShouldExplicitlyWaituntilAtLeastOneElementIsFoundWhenSearchingForMany(dr
5858 add .click ()
5959 add .click ()
6060
61- elements = WebDriverWait (driver , 2 ).until (EC .presence_of_all_elements_located ((By .CLASS_NAME , "redbox" )))
61+ elements = WebDriverWait (driver , 3 ).until (EC .presence_of_all_elements_located ((By .CLASS_NAME , "redbox" )))
6262 assert len (elements ) >= 1
6363
6464
@@ -86,7 +86,7 @@ def __call__(self, driver):
8686 elements = [element for element in driver .find_elements (* self .locator ) if EC ._element_if_visible (element )]
8787 return elements if len (elements ) == 2 else False
8888
89- elements = WebDriverWait (driver , 2 ).until (wait_for_two_elements ((By .CLASS_NAME , "redbox" )))
89+ elements = WebDriverWait (driver , 3 ).until (wait_for_two_elements ((By .CLASS_NAME , "redbox" )))
9090 assert len (elements ) == 2
9191
9292
@@ -103,7 +103,7 @@ def testShouldWaitUntilAllVisibleElementsAreFoundWhenSearchingForMany(driver, pa
103103 add_visible .click ()
104104 add_visible .click ()
105105
106- elements = WebDriverWait (driver , 2 ).until (EC .visibility_of_all_elements_located ((By .CLASS_NAME , "redbox" )))
106+ elements = WebDriverWait (driver , 3 ).until (EC .visibility_of_all_elements_located ((By .CLASS_NAME , "redbox" )))
107107 assert len (elements ) == 2
108108
109109
@@ -167,7 +167,7 @@ def testExpectedConditionTitleIs(driver, pages):
167167def testExpectedConditionTitleContains (driver , pages ):
168168 pages .load ("blank.html" )
169169 driver .execute_script ("setTimeout(function(){document.title='not blank'}, 200)" )
170- WebDriverWait (driver , 1 ).until (EC .title_contains ("not" ))
170+ WebDriverWait (driver , 2 ).until (EC .title_contains ("not" ))
171171 assert driver .title == 'not blank'
172172 with pytest .raises (TimeoutException ):
173173 WebDriverWait (driver , 0.7 ).until (EC .title_contains ("blanket" ))
@@ -199,7 +199,7 @@ def testExpectedConditionTextToBePresentInElement(driver, pages):
199199 with pytest .raises (TimeoutException ):
200200 WebDriverWait (driver , 0.7 ).until (EC .text_to_be_present_in_element ((By .ID , 'unwrappable' ), 'Expected' ))
201201 driver .execute_script ("setTimeout(function(){var el = document.getElementById('unwrappable'); el.textContent = el.innerText = 'Unwrappable Expected text'}, 200)" )
202- WebDriverWait (driver , 1 ).until (EC .text_to_be_present_in_element ((By .ID , 'unwrappable' ), 'Expected' ))
202+ WebDriverWait (driver , 2 ).until (EC .text_to_be_present_in_element ((By .ID , 'unwrappable' ), 'Expected' ))
203203 assert 'Unwrappable Expected text' == driver .find_element (By .ID , 'unwrappable' ).text
204204
205205
@@ -208,7 +208,7 @@ def testExpectedConditionTextToBePresentInElementValue(driver, pages):
208208 with pytest .raises (TimeoutException ):
209209 WebDriverWait (driver , 1 ).until (EC .text_to_be_present_in_element_value ((By .ID , 'inputRequired' ), 'Expected' ))
210210 driver .execute_script ("setTimeout(function(){document.getElementById('inputRequired').value = 'Example Expected text'}, 200)" )
211- WebDriverWait (driver , 1 ).until (EC .text_to_be_present_in_element_value ((By .ID , 'inputRequired' ), 'Expected' ))
211+ WebDriverWait (driver , 2 ).until (EC .text_to_be_present_in_element_value ((By .ID , 'inputRequired' ), 'Expected' ))
212212 assert 'Example Expected text' == driver .find_element (By .ID , 'inputRequired' ).get_attribute ('value' )
213213
214214
@@ -217,18 +217,16 @@ def testExpectedConditionTextToBePresentInElementAttribute(driver, pages):
217217 with pytest .raises (TimeoutException ):
218218 WebDriverWait (driver , 1 ).until (EC .text_to_be_present_in_element_attribute ((By .ID , 'inputRequired' ), 'value' , 'Expected' ))
219219 driver .execute_script ("setTimeout(function(){document.getElementById('inputRequired').value = 'Example Expected text'}, 200)" )
220- WebDriverWait (driver , 1 ).until (EC .text_to_be_present_in_element_attribute ((By .ID , 'inputRequired' ), 'value' , 'Expected' ))
220+ WebDriverWait (driver , 2 ).until (EC .text_to_be_present_in_element_attribute ((By .ID , 'inputRequired' ), 'value' , 'Expected' ))
221221 assert 'Example Expected text' == driver .find_element (By .ID , 'inputRequired' ).get_attribute ('value' )
222222
223223
224- # xfail can be removed after 23 March 2021
225- @pytest .mark .xfail_firefox (reason = "https://bugzilla.mozilla.org/show_bug.cgi?id=1691348" )
226224def testExpectedConditionFrameToBeAvailableAndSwitchToItByLocator (driver , pages ):
227225 pages .load ("blank.html" )
228226 with pytest .raises (TimeoutException ):
229227 WebDriverWait (driver , 1 ).until (EC .frame_to_be_available_and_switch_to_it ((By .ID , 'myFrame' )))
230228 driver .execute_script ("setTimeout(function(){var f = document.createElement('iframe'); f.id='myFrame'; f.src = '" + pages .url ('iframeWithAlert.html' ) + "'; document.body.appendChild(f)}, 200)" )
231- WebDriverWait (driver , 1 ).until (EC .frame_to_be_available_and_switch_to_it ((By .ID , 'myFrame' )))
229+ WebDriverWait (driver , 2 ).until (EC .frame_to_be_available_and_switch_to_it ((By .ID , 'myFrame' )))
232230 assert 'click me' == driver .find_element (By .ID , 'alertInFrame' ).text
233231
234232
@@ -239,7 +237,7 @@ def testExpectedConditionInvisiblityOfElement(driver, pages):
239237 with pytest .raises (TimeoutException ):
240238 WebDriverWait (driver , 0.7 ).until (EC .invisibility_of_element (target ))
241239 driver .execute_script ("delayedShowHide(200, false)" )
242- element = WebDriverWait (driver , 0.7 ).until (EC .invisibility_of_element (target ))
240+ element = WebDriverWait (driver , 2 ).until (EC .invisibility_of_element (target ))
243241 assert element .is_displayed () is False
244242 assert target == element
245243
@@ -250,7 +248,7 @@ def testExpectedConditionInvisiblityOfElementLocated(driver, pages):
250248 with pytest .raises (TimeoutException ):
251249 WebDriverWait (driver , 0.7 ).until (EC .invisibility_of_element_located ((By .ID , 'clickToHide' )))
252250 driver .execute_script ("delayedShowHide(200, false)" )
253- element = WebDriverWait (driver , 0.7 ).until (EC .invisibility_of_element_located ((By .ID , 'clickToHide' )))
251+ element = WebDriverWait (driver , 2 ).until (EC .invisibility_of_element_located ((By .ID , 'clickToHide' )))
254252 assert element .is_displayed () is False
255253
256254
@@ -263,18 +261,18 @@ def testExpectedConditionElementToBeClickable(driver, pages):
263261 WebDriverWait (driver , 0.7 ).until (EC .element_to_be_clickable ((By .ID , 'clickToHide' )))
264262 element = driver .find_element (By .ID , 'clickToHide' )
265263 element .click ()
266- WebDriverWait (driver , 3 .5 ).until (EC .invisibility_of_element_located ((By .ID , 'clickToHide' )))
264+ WebDriverWait (driver , 4 .5 ).until (EC .invisibility_of_element_located ((By .ID , 'clickToHide' )))
267265 assert element .is_displayed () is False
268266
269267
270268def testExpectedConditionStalenessOf (driver , pages ):
271269 pages .load ('dynamicallyModifiedPage.html' )
272270 element = driver .find_element (By .ID , 'element-to-remove' )
273271 with pytest .raises (TimeoutException ):
274- WebDriverWait (driver , 0 .7 ).until (EC .staleness_of (element ))
272+ WebDriverWait (driver , .7 ).until (EC .staleness_of (element ))
275273 driver .find_element (By .ID , 'buttonDelete' ).click ()
276274 assert 'element' == element .text
277- WebDriverWait (driver , 0.7 ).until (EC .staleness_of (element ))
275+ WebDriverWait (driver , 2 ).until (EC .staleness_of (element ))
278276 with pytest .raises (StaleElementReferenceException ):
279277 element .text
280278
@@ -285,7 +283,7 @@ def testExpectedConditionElementToBeSelected(driver, pages):
285283 with pytest .raises (TimeoutException ):
286284 WebDriverWait (driver , 0.7 ).until (EC .element_to_be_selected (element ))
287285 driver .execute_script ("setTimeout(function(){document.getElementById('checky').checked = true}, 200)" )
288- WebDriverWait (driver , 0.7 ).until (EC .element_to_be_selected (element ))
286+ WebDriverWait (driver , 2 ).until (EC .element_to_be_selected (element ))
289287 assert element .is_selected () is True
290288
291289
@@ -295,7 +293,7 @@ def testExpectedConditionElementLocatedToBeSelected(driver, pages):
295293 with pytest .raises (TimeoutException ):
296294 WebDriverWait (driver , 0.7 ).until (EC .element_located_to_be_selected ((By .ID , 'checky' )))
297295 driver .execute_script ("setTimeout(function(){document.getElementById('checky').checked = true}, 200)" )
298- WebDriverWait (driver , 0.7 ).until (EC .element_located_to_be_selected ((By .ID , 'checky' )))
296+ WebDriverWait (driver , 2 ).until (EC .element_located_to_be_selected ((By .ID , 'checky' )))
299297 assert element .is_selected () is True
300298
301299
@@ -307,7 +305,7 @@ def testExpectedConditionElementSelectionStateToBe(driver, pages):
307305 with pytest .raises (TimeoutException ):
308306 WebDriverWait (driver , 0.7 ).until (EC .element_selection_state_to_be (element , True ))
309307 driver .execute_script ("setTimeout(function(){document.getElementById('checky').checked = true}, 200)" )
310- WebDriverWait (driver , 0.7 ).until (EC .element_selection_state_to_be (element , True ))
308+ WebDriverWait (driver , 2 ).until (EC .element_selection_state_to_be (element , True ))
311309 assert element .is_selected () is True
312310
313311
@@ -319,7 +317,7 @@ def testExpectedConditionElementLocatedSelectionStateToBe(driver, pages):
319317 with pytest .raises (TimeoutException ):
320318 WebDriverWait (driver , 0.7 ).until (EC .element_located_selection_state_to_be ((By .ID , 'checky' ), True ))
321319 driver .execute_script ("setTimeout(function(){document.getElementById('checky').checked = true}, 200)" )
322- WebDriverWait (driver , 0.7 ).until (EC .element_located_selection_state_to_be ((By .ID , 'checky' ), True ))
320+ WebDriverWait (driver , 2 ).until (EC .element_located_selection_state_to_be ((By .ID , 'checky' ), True ))
323321 assert element .is_selected () is True
324322
325323
@@ -328,7 +326,7 @@ def testExpectedConditionAlertIsPresent(driver, pages):
328326 with pytest .raises (TimeoutException ):
329327 WebDriverWait (driver , 0.7 ).until (EC .alert_is_present ())
330328 driver .execute_script ("setTimeout(function(){alert('alerty')}, 200)" )
331- WebDriverWait (driver , 0.7 ).until (EC .alert_is_present ())
329+ WebDriverWait (driver , 2 ).until (EC .alert_is_present ())
332330 alert = driver .switch_to .alert
333331 assert 'alerty' == alert .text
334332 alert .dismiss ()
@@ -338,5 +336,5 @@ def testExpectedConditionAttributeToBeIncludeInElement(driver, pages):
338336 pages .load ('booleanAttributes.html' )
339337 with pytest .raises (TimeoutException ):
340338 WebDriverWait (driver , 1 ).until (EC .element_attribute_to_include ((By .ID , 'inputRequired' ), 'test' ))
341- value = WebDriverWait (driver , 1 ).until (EC .element_attribute_to_include ((By .ID , 'inputRequired' ), 'value' ))
339+ value = WebDriverWait (driver , 2 ).until (EC .element_attribute_to_include ((By .ID , 'inputRequired' ), 'value' ))
342340 assert value is not None
0 commit comments