diff options
| author | Florian Apolloner <florian@apolloner.eu> | 2014-01-03 11:25:24 +0100 |
|---|---|---|
| committer | Florian Apolloner <florian@apolloner.eu> | 2014-01-03 11:29:37 +0100 |
| commit | 3bc6b18cb92462ff5ae54efd0fce5340e9149b0f (patch) | |
| tree | 86fc02c185b388d288c044c36339fdcee3feb1e8 /django | |
| parent | 4e6142ee84e966418799fed1fc5d8594a9e08c02 (diff) | |
Fixed selenium failure.
This fixes (at least according to tests on the ci itself)
admin_widgets.tests.RelatedFieldWidgetSeleniumFirefoxTests.test_foreign_key_using_to_field
(http://ci.djangoproject.com/job/Django/database=mysql_gis,python=python2.7/3792/testReport/junit/admin_widgets.tests/RelatedFieldWidgetSeleniumFirefoxTests/test_foreign_key_using_to_field/)
The cause for this issue seems to be that wait_page_loaded was executed before click fired
and as such no profile got saved (again just an educated guess, but with this fix I can no
longer reproduce it -- fingers crossed).
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/django/contrib/admin/tests.py b/django/contrib/admin/tests.py index 72cb0606f3..40fd10089b 100644 --- a/django/contrib/admin/tests.py +++ b/django/contrib/admin/tests.py @@ -70,6 +70,18 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerCase): from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as ec self.wait_until( + ec.text_to_be_present_in_element( + (By.CSS_SELECTOR, css_selector), text), + timeout + ) + + def wait_for_value(self, css_selector, text, timeout=10): + """ + Helper function that blocks until the value is found in the css selector. + """ + from selenium.webdriver.common.by import By + from selenium.webdriver.support import expected_conditions as ec + self.wait_until( ec.text_to_be_present_in_element_value( (By.CSS_SELECTOR, css_selector), text), timeout |
