From 2eb70a30d94ac82316870d9a0d01a75400c7eb13 Mon Sep 17 00:00:00 2001 From: Alassane Yattara Date: Tue, 21 Nov 2023 14:51:28 +0100 Subject: bitbake: toaster/tests: Add UI TestCase - Test project page tab "New custom image" Test project page tab "New custom image" when no custom image (Bitbake rev: fd8fe1d3b25679032a43c1dd25a945318e573cef) Signed-off-by: Alassane Yattara Signed-off-by: Richard Purdie --- .../functional/test_project_page_tab_config.py | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'bitbake/lib/toaster/tests') 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 14a859a13a..c6d952fde0 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 @@ -349,3 +349,34 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): self.assertTrue( 'meta-fake' in str(layers_list_items[-1].text) ) + + def test_project_page_custom_image_no_image(self): + """ Test project page tab "New custom image" when no custom image """ + # navigate to the project page + url = reverse("project", args=(1,)) + self.get(url) + + # navigate to "Custom image" tab + custom_image_section = self._get_config_nav_item(2) + custom_image_section.click() + self.wait_until_visible('#empty-state-customimagestable') + + # Check message when no custom image + self.assertTrue( + "You have not created any custom images yet." in str( + self.find('#empty-state-customimagestable').text + ) + ) + div_empty_msg = self.find('#empty-state-customimagestable') + link_create_custom_image = div_empty_msg.find_element( + By.TAG_NAME, 'a') + self.assertTrue( + f"/toastergui/project/1/newcustomimage" in str( + link_create_custom_image.get_attribute('href') + ) + ) + self.assertTrue( + "Create your first custom image" in str( + link_create_custom_image.text + ) + ) -- cgit v1.2.3-54-g00ecf