summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_widgets/tests.py
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-02-20 03:08:55 +0200
committerAnssi Kääriäinen <akaariai@gmail.com>2013-02-20 23:56:57 +0200
commit50677b29af39ca670274fb45087415c883c78b04 (patch)
tree5fa989c89d8586637f2d1f9a7e7517800cf2e7b9 /tests/regressiontests/admin_widgets/tests.py
parent4e36e0a8b34e5ac58a6b3c1444a999d9b257203b (diff)
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
Diffstat (limited to 'tests/regressiontests/admin_widgets/tests.py')
-rw-r--r--tests/regressiontests/admin_widgets/tests.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/regressiontests/admin_widgets/tests.py b/tests/regressiontests/admin_widgets/tests.py
index 452387078d..d559b53531 100644
--- a/tests/regressiontests/admin_widgets/tests.py
+++ b/tests/regressiontests/admin_widgets/tests.py
@@ -644,12 +644,14 @@ class HorizontalVerticalFilterSeleniumFirefoxTests(AdminSeleniumWebDriverTestCas
self.selenium.get(
'%s%s' % (self.live_server_url, '/admin_widgets/school/%s/' % self.school.id))
+ self.wait_page_loaded()
self.execute_basic_operations('vertical', 'students')
self.execute_basic_operations('horizontal', 'alumni')
# Save and check that everything is properly stored in the database ---
self.selenium.find_element_by_xpath('//input[@value="Save"]').click()
- self.school = models.School.objects.get(id=self.school.id) # Reload from database
+ self.wait_page_loaded()
+ self.school = models.School.objects.get(id=self.school.id) # Reload from database
self.assertEqual(list(self.school.students.all()),
[self.arthur, self.cliff, self.jason, self.john])
self.assertEqual(list(self.school.alumni.all()),
@@ -728,6 +730,7 @@ class HorizontalVerticalFilterSeleniumFirefoxTests(AdminSeleniumWebDriverTestCas
# Save and check that everything is properly stored in the database ---
self.selenium.find_element_by_xpath('//input[@value="Save"]').click()
+ self.wait_page_loaded()
self.school = models.School.objects.get(id=self.school.id) # Reload from database
self.assertEqual(list(self.school.students.all()),
[self.jason, self.peter])