mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Made a couple of selenium tests wait for page loaded
The admin_widgets tests were issuing click() to the browser but didn't wait for the effects of those clicks. This caused the resulting request to be processed concurrently with the test case. When using in-memory SQLite this caused weird failures. Also added wait_page_loaded() to admin selenium tests for code reuse. Fixed #19856
This commit is contained in:
@@ -546,15 +546,7 @@ class SeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
|
||||
self.selenium.find_element_by_name('profile_set-2-last_name').send_keys('2 last name 2')
|
||||
|
||||
self.selenium.find_element_by_xpath('//input[@value="Save"]').click()
|
||||
|
||||
try:
|
||||
# Wait for the next page to be loaded.
|
||||
self.wait_loaded_tag('body')
|
||||
except TimeoutException:
|
||||
# IE7 occasionnally returns an error "Internet Explorer cannot
|
||||
# display the webpage" and doesn't load the next page. We just
|
||||
# ignore it.
|
||||
pass
|
||||
self.wait_page_loaded()
|
||||
|
||||
# Check that the objects have been created in the database
|
||||
self.assertEqual(ProfileCollection.objects.all().count(), 1)
|
||||
|
||||
Reference in New Issue
Block a user