diff options
| author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-11-21 14:48:01 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-23 12:06:06 +0000 |
| commit | ff3a48920ab0312cdd12ee6986853927d9f75910 (patch) | |
| tree | e56814ca7f042e69adf6eb6e45a0cdd218432306 /bitbake | |
| parent | f1230edc55257dec03a055876cba775af4ee208f (diff) | |
| download | poky-ff3a48920ab0312cdd12ee6986853927d9f75910.tar.gz | |
bitbake: toaster/tests: Add UI TestCase for visualize all projects show rows
Test the show rows feature in the projects table on the all projects page
(Bitbake rev: d899a3cf9e186f78780415195c734fdef359d08d)
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
| -rw-r--r-- | bitbake/lib/toaster/tests/browser/test_all_projects_page.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_all_projects_page.py b/bitbake/lib/toaster/tests/browser/test_all_projects_page.py index 2b1d8cc1cd..a880dbcc68 100644 --- a/bitbake/lib/toaster/tests/browser/test_all_projects_page.py +++ b/bitbake/lib/toaster/tests/browser/test_all_projects_page.py | |||
| @@ -297,3 +297,37 @@ class TestAllProjectsPage(SeleniumTestCase): | |||
| 297 | test_edit_column('checkbox-last_build_outcome') | 297 | test_edit_column('checkbox-last_build_outcome') |
| 298 | test_edit_column('checkbox-recipe_name') | 298 | test_edit_column('checkbox-recipe_name') |
| 299 | test_edit_column('checkbox-warnings') | 299 | test_edit_column('checkbox-warnings') |
| 300 | |||
| 301 | def test_allProject_table_show_rows(self): | ||
| 302 | """ Test the show rows feature in the projects table on the all projects page """ | ||
| 303 | self._create_projects(nb_project=200) | ||
| 304 | |||
| 305 | def test_show_rows(row_to_show, show_row_link): | ||
| 306 | # Check that we can show rows == row_to_show | ||
| 307 | show_row_link.select_by_value(str(row_to_show)) | ||
| 308 | self.wait_until_present('#projectstable tbody tr') | ||
| 309 | sleep_time = 1 | ||
| 310 | if row_to_show == 150: | ||
| 311 | # wait more time for 150 rows | ||
| 312 | sleep_time = 2 | ||
| 313 | time.sleep(sleep_time) | ||
| 314 | self.assertTrue( | ||
| 315 | len(self.find_all('#projectstable tbody tr')) == row_to_show | ||
| 316 | ) | ||
| 317 | |||
| 318 | url = reverse('all-projects') | ||
| 319 | self.get(url) | ||
| 320 | self.wait_until_present('#projectstable tbody tr') | ||
| 321 | |||
| 322 | show_rows = self.driver.find_elements( | ||
| 323 | By.XPATH, | ||
| 324 | '//select[@class="form-control pagesize-projectstable"]' | ||
| 325 | ) | ||
| 326 | # Check show rows | ||
| 327 | for show_row_link in show_rows: | ||
| 328 | show_row_link = Select(show_row_link) | ||
| 329 | test_show_rows(10, show_row_link) | ||
| 330 | test_show_rows(25, show_row_link) | ||
| 331 | test_show_rows(50, show_row_link) | ||
| 332 | test_show_rows(100, show_row_link) | ||
| 333 | test_show_rows(150, show_row_link) | ||
