From 3d2d2901574b38b0e8d2efc95facdd1b78692a76 Mon Sep 17 00:00:00 2001 From: Alassane Yattara Date: Tue, 21 Nov 2023 14:51:29 +0100 Subject: bitbake: toaster/tests: Add UI TestCase - Test project page section images BUILD IMAGE RECIPES: toastergui/project/{id}/images/ Test project page section images - Check image recipes are displayed - Check search input - Check image recipe build button works - Check image recipe table features(show/hide column, pagination) (Bitbake rev: 9aa0aad6812730d4ffaa9b3adfae041176274475) Signed-off-by: Alassane Yattara Signed-off-by: Richard Purdie --- .../functional/test_project_page_tab_config.py | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py b/bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py index c6d952fde0..598a805540 100644 --- a/bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py +++ b/bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py @@ -380,3 +380,44 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): link_create_custom_image.text ) ) + + def test_project_page_image_recipe(self): + """ Test project page section images + - Check image recipes are displayed + - Check search input + - Check image recipe build button works + - Check image recipe table features(show/hide column, pagination) + """ + # navigate to the project page + url = reverse("project", args=(1,)) + self.get(url) + self.wait_until_visible('#config-nav') + + # navigate to "Images section" + images_section = self._get_config_nav_item(3) + images_section.click() + self.wait_until_visible('#imagerecipestable') + rows = self.find_all('#imagerecipestable tbody tr') + self.assertTrue(len(rows) > 0) + + # Test search input + self.wait_until_visible('#search-input-imagerecipestable') + recipe_input = self.find('#search-input-imagerecipestable') + recipe_input.send_keys('core-image-minimal') + self.find('#search-submit-imagerecipestable').click() + rows = self.find_all('#imagerecipestable tbody tr') + self.assertTrue(len(rows) > 0) + + # Test build button + image_to_build = rows[0] + build_btn = image_to_build.find_element( + By.XPATH, + '//td[@class="add-del-layers"]' + ) + build_btn.click() + self._wait_until_build('parsing starting cloning') + lastest_builds = self.driver.find_elements( + By.XPATH, + '//div[@id="latest-builds"]/div' + ) + self.assertTrue(len(lastest_builds) > 0) -- cgit v1.2.3-54-g00ecf