From patchwork Tue Nov 21 13:50:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 34960 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DD5BC61D9C for ; Tue, 21 Nov 2023 13:51:00 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.40857.1700574653008840568 for ; Tue, 21 Nov 2023 05:50:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=fonpu/gE; spf=pass (domain: savoirfairelinux.com, ip: 208.88.110.44, mailfrom: alassane.yattara@savoirfairelinux.com) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 5A8DA9C36C5 for ; Tue, 21 Nov 2023 08:50:52 -0500 (EST) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id 9N9vBHfBmeYA; Tue, 21 Nov 2023 08:50:52 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id E82339C2B49; Tue, 21 Nov 2023 08:50:51 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com E82339C2B49 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1700574651; bh=Q3OYKsHc/2r4EYcWZ0ZtKDtExz84bdQgHnQwLANsz1I=; h=From:To:Date:Message-Id:MIME-Version; b=fonpu/gEVzA6AiRCe0XvtjhDF+DSF3OYxxNM9E4TfRkW1p/vLVHeNSqGHF0LWgBl9 Zhg9jOkxHNskm8j8vikI2RhYJtLTR2jtuZHyxHHwjyZnEuLjTi7vwmn7gWrcs+apGb GR/p4Yexh0aM3CXOIkl78/BRcdEKJ3KTITclOMIjEMEWUuBw7GZ//JiK9DUbP6nzRj CM0JLFcSUUbZmT4LpVgY5UPhC0DobQ2HMBDrrDVXV2oyLDP2jYjewct89BihSTLK0J tw6Z8Oj38b6TShT5B5QuzmJ/UqSaZyeKaUvKx/oykk9/dnYGnZpYz/q+CqEWQzGqSp uKjaLI/xpaQUw== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id 8_FrXpgVHCxy; Tue, 21 Nov 2023 08:50:51 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 069F79C3754; Tue, 21 Nov 2023 08:50:50 -0500 (EST) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 4/7] Toaster: Write UI TestCase -> Test project page tab "New custom image" Date: Tue, 21 Nov 2023 14:50:40 +0100 Message-Id: <20231121135043.105385-4-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231121135043.105385-1-alassane.yattara@savoirfairelinux.com> References: <20231121135043.105385-1-alassane.yattara@savoirfairelinux.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 21 Nov 2023 13:51:00 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/6015 Test project page tab "New custom image" when no custom image Signed-off-by: Alassane Yattara --- .../test_project_page_tab_config.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) 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 14a859a1..c6d952fd 100644 --- a/lib/toaster/tests/functional/test_project_page_tab_config.py +++ b/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 + ) + )