Test the show rows feature in the projects table on the all projects page
Signed-off-by: Alassane Yattara <[email protected]>
---
.../tests/browser/test_all_projects_page.py | 34 +++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/lib/toaster/tests/browser/test_all_projects_page.py
b/lib/toaster/tests/browser/test_all_projects_page.py
index 2b1d8cc1..a880dbcc 100644
--- a/lib/toaster/tests/browser/test_all_projects_page.py
+++ b/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)
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6006): https://lists.yoctoproject.org/g/toaster/message/6006
Mute This Topic: https://lists.yoctoproject.org/mt/102728333/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/toaster/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-