1
0
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:
Anssi Kääriäinen
2013-02-20 03:08:55 +02:00
parent 4e36e0a8b3
commit 50677b29af
4 changed files with 21 additions and 22 deletions

View File

@@ -3262,16 +3262,7 @@ class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase):
# Save and check that everything is properly stored in the database
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()
self.assertEqual(MainPrepopulated.objects.all().count(), 1)
MainPrepopulated.objects.get(
name=' this is the mAin nÀMë and it\'s awεšome',