From ff3a48920ab0312cdd12ee6986853927d9f75910 Mon Sep 17 00:00:00 2001 From: Alassane Yattara Date: Tue, 21 Nov 2023 14:48:01 +0100 Subject: 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 Signed-off-by: Richard Purdie --- .../tests/browser/test_all_projects_page.py | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) 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): test_edit_column('checkbox-last_build_outcome') test_edit_column('checkbox-recipe_name') test_edit_column('checkbox-warnings') + + def test_allProject_table_show_rows(self): + """ Test the show rows feature in the projects table on the all projects page """ + self._create_projects(nb_project=200) + + def test_show_rows(row_to_show, show_row_link): + # Check that we can show rows == row_to_show + show_row_link.select_by_value(str(row_to_show)) + self.wait_until_present('#projectstable tbody tr') + sleep_time = 1 + if row_to_show == 150: + # wait more time for 150 rows + sleep_time = 2 + time.sleep(sleep_time) + self.assertTrue( + len(self.find_all('#projectstable tbody tr')) == row_to_show + ) + + url = reverse('all-projects') + self.get(url) + self.wait_until_present('#projectstable tbody tr') + + show_rows = self.driver.find_elements( + By.XPATH, + '//select[@class="form-control pagesize-projectstable"]' + ) + # Check show rows + for show_row_link in show_rows: + show_row_link = Select(show_row_link) + test_show_rows(10, show_row_link) + test_show_rows(25, show_row_link) + test_show_rows(50, show_row_link) + test_show_rows(100, show_row_link) + test_show_rows(150, show_row_link) -- cgit v1.2.3-54-g00ecf