diff options
author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2024-01-09 14:54:06 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-10 13:55:33 +0000 |
commit | 49ccf2f5e01cc98c25424b8d9326b4eaf6c8bdd7 (patch) | |
tree | 81f08cb1e1d439375f04457f712cbc15a313d13b /bitbake | |
parent | 0d93308425fd1e668dc43bcfe4b282289a30506a (diff) | |
download | poky-49ccf2f5e01cc98c25424b8d9326b4eaf6c8bdd7.tar.gz |
bitbake: toaster/tests: Setup delay after driver action self.get(url)
Recurring test failures result from insufficient delays in driver actions.
(Bitbake rev: b0de2a61d14fbf30e338751b285b3bab80192275)
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
4 files changed, 12 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py index 562fedec8c..393be75496 100644 --- a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py +++ b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | |||
@@ -182,6 +182,13 @@ class SeleniumTestCaseBase(unittest.TestCase): | |||
182 | abs_url = '%s%s' % (self.live_server_url, url) | 182 | abs_url = '%s%s' % (self.live_server_url, url) |
183 | self.driver.get(abs_url) | 183 | self.driver.get(abs_url) |
184 | 184 | ||
185 | try: # Ensure page is loaded before proceeding | ||
186 | self.wait_until_visible("#global-nav", poll=3) | ||
187 | except NoSuchElementException: | ||
188 | self.driver.implicitly_wait(3) | ||
189 | except TimeoutException: | ||
190 | self.driver.implicitly_wait(3) | ||
191 | |||
185 | def find(self, selector): | 192 | def find(self, selector): |
186 | """ Find single element by CSS selector """ | 193 | """ Find single element by CSS selector """ |
187 | return self.driver.find_element(By.CSS_SELECTOR, selector) | 194 | return self.driver.find_element(By.CSS_SELECTOR, selector) |
diff --git a/bitbake/lib/toaster/tests/browser/test_all_builds_page.py b/bitbake/lib/toaster/tests/browser/test_all_builds_page.py index 7019b3dbec..ab6da821ba 100644 --- a/bitbake/lib/toaster/tests/browser/test_all_builds_page.py +++ b/bitbake/lib/toaster/tests/browser/test_all_builds_page.py | |||
@@ -224,6 +224,7 @@ class TestAllBuildsPage(SeleniumTestCase): | |||
224 | 224 | ||
225 | url = reverse('all-builds') | 225 | url = reverse('all-builds') |
226 | self.get(url) | 226 | self.get(url) |
227 | self.wait_until_visible('#allbuildstable', poll=3) | ||
227 | 228 | ||
228 | # get the project name cells from the table | 229 | # get the project name cells from the table |
229 | cells = self.find_all('#allbuildstable td[class="project"]') | 230 | cells = self.find_all('#allbuildstable td[class="project"]') |
@@ -232,7 +233,7 @@ class TestAllBuildsPage(SeleniumTestCase): | |||
232 | 233 | ||
233 | for cell in cells: | 234 | for cell in cells: |
234 | content = cell.get_attribute('innerHTML') | 235 | content = cell.get_attribute('innerHTML') |
235 | help_icons = cell.find_elements_by_css_selector(selector) | 236 | help_icons = cell.find_elements(By.CSS_SELECTOR, selector) |
236 | 237 | ||
237 | if re.search(self.PROJECT_NAME, content): | 238 | if re.search(self.PROJECT_NAME, content): |
238 | # no help icon next to non-cli project name | 239 | # no help icon next to non-cli project name |
@@ -256,6 +257,7 @@ class TestAllBuildsPage(SeleniumTestCase): | |||
256 | 257 | ||
257 | url = reverse('all-builds') | 258 | url = reverse('all-builds') |
258 | self.get(url) | 259 | self.get(url) |
260 | self.wait_until_visible('#allbuildstable', poll=3) | ||
259 | 261 | ||
260 | # test recent builds area for successful build | 262 | # test recent builds area for successful build |
261 | element = self._get_build_time_element(build1) | 263 | element = self._get_build_time_element(build1) |
diff --git a/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py b/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py index b713f30039..d838ce363a 100644 --- a/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py +++ b/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py | |||
@@ -162,6 +162,7 @@ class TestBuildDashboardPage(SeleniumTestCase): | |||
162 | """ | 162 | """ |
163 | url = reverse('builddashboard', args=(build.id,)) | 163 | url = reverse('builddashboard', args=(build.id,)) |
164 | self.get(url) | 164 | self.get(url) |
165 | self.wait_until_visible('#global-nav', poll=3) | ||
165 | 166 | ||
166 | def _get_build_dashboard_errors(self, build): | 167 | def _get_build_dashboard_errors(self, build): |
167 | """ | 168 | """ |
diff --git a/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py b/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py index 4ad22c7aa7..9f0b6397fe 100644 --- a/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py +++ b/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py | |||
@@ -90,6 +90,7 @@ class TestNewCustomImagePage(SeleniumTestCase): | |||
90 | """ | 90 | """ |
91 | url = reverse('newcustomimage', args=(self.project.id,)) | 91 | url = reverse('newcustomimage', args=(self.project.id,)) |
92 | self.get(url) | 92 | self.get(url) |
93 | self.wait_until_visible('#global-nav', poll=3) | ||
93 | 94 | ||
94 | self.click('button[data-recipe="%s"]' % self.recipe.id) | 95 | self.click('button[data-recipe="%s"]' % self.recipe.id) |
95 | 96 | ||