diff options
| author | Carlton Gibson <carlton@noumenal.es> | 2020-03-25 09:58:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-25 09:58:57 +0100 |
| commit | 39e1c88de67ea2035d5ad89cfe00bcd892c0d163 (patch) | |
| tree | 8dfe52511737e239138971339dc5ffeecb003b25 | |
| parent | 10866a10fe9f0ad3ffdf6f93823aaf4716e6f27c (diff) | |
Fixed intermittent SeleniumTests.test_prepopulated_fields failure.
Element would occasionally be outside of frame.
| -rw-r--r-- | tests/admin_views/tests.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index d903261052..c2b3ff0ff1 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -4499,7 +4499,10 @@ class SeleniumTests(AdminSeleniumTestCase): self.assertEqual(slug2, 'option-two-and-now-tabular-inline') # Add an inline - self.selenium.find_elements_by_link_text('Add another Related prepopulated')[1].click() + # Button may be outside the browser frame. + element = self.selenium.find_elements_by_link_text('Add another Related prepopulated')[1] + self.selenium.execute_script('window.scrollTo(0, %s);' % element.location['y']) + element.click() self.assertEqual( len(self.selenium.find_elements_by_class_name('select2-selection')), num_initial_select2_inputs + 4 |
