diff options
author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-11-20 19:22:19 +0100 |
---|---|---|
committer | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-11-21 14:32:48 +0100 |
commit | 5eab804c29fd285374869f422c3731ef725b1483 (patch) | |
tree | f5bdc624b603474b3f9346da6c91f794e15ed289 | |
parent | 7c1b6b5aaf5dc0564e581c3435cdf6cdb3cf7fe0 (diff) | |
download | bitbake-contrib-yattdev/Feature-10259-Write-UI-and-UnitTests-TabConfig-CREATE-ACCESS-CUSTOM-IMAGE-RecipeImage.tar.gz |
Toaster: Write UI TestCase -> Test the show rows feature in image recipeyattdev/Feature-10259-Write-UI-and-UnitTests-TabConfig-CREATE-ACCESS-CUSTOM-IMAGE-RecipeImage
Test the show rows feature in image recipe table on project page
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
-rw-r--r-- | lib/toaster/tests/functional/test_project_page_tab_config.py | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/lib/toaster/tests/functional/test_project_page_tab_config.py b/lib/toaster/tests/functional/test_project_page_tab_config.py index 2dfc120d8..23012d786 100644 --- a/lib/toaster/tests/functional/test_project_page_tab_config.py +++ b/lib/toaster/tests/functional/test_project_page_tab_config.py @@ -347,7 +347,10 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): By.XPATH, '//*[@id="project-page"]/div[1]/div[3]') recipe_list = most_built_recipes.find_element(By.ID, 'freq-build-list') recipe_list_items = recipe_list.find_elements(By.TAG_NAME, 'li') - self.assertTrue(len(recipe_list_items) > 0) + self.assertTrue( + len(recipe_list_items) > 0, + msg="No recipes found in the most built recipes list", + ) checkbox = recipe_list_items[0].find_element(By.TAG_NAME, 'input') checkbox.click() build_btn = self.find('#freq-build-btn') @@ -465,6 +468,7 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): recipe_input = self.find('#search-input-imagerecipestable') recipe_input.send_keys('core-image-minimal') self.find('#search-submit-imagerecipestable').click() + self.wait_until_visible('#imagerecipestable tbody tr') rows = self.find_all('#imagerecipestable tbody tr') self.assertTrue(len(rows) > 0) @@ -542,3 +546,33 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): test_edit_column('checkbox-recipe-file') test_edit_column('checkbox-section') test_edit_column('checkbox-version') + + def test_image_recipe_show_rows(self): + """ Test the show rows feature in image recipe table on project page """ + self._get_create_builds(success=100, failure=100) + + 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('#imagerecipestable tbody tr') + sleep(1) + self.assertTrue( + len(self.find_all('#imagerecipestable tbody tr')) == row_to_show + ) + + url = reverse('projectimagerecipes', args=(2,)) + self.get(url) + self.wait_until_present('#imagerecipestable tbody tr') + + show_rows = self.driver.find_elements( + By.XPATH, + '//select[@class="form-control pagesize-imagerecipestable"]' + ) + # 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) |