From patchwork Wed Nov 1 22:13:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33408 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 E3335C4332F for ; Wed, 1 Nov 2023 22:14:32 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.1313.1698876864884858565 for ; Wed, 01 Nov 2023 15:14:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=IHV+QKPn; 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 092739C314F for ; Wed, 1 Nov 2023 18:14:23 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id 70zccxMp8tRw; Wed, 1 Nov 2023 18:14:18 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 59B899C33B7; Wed, 1 Nov 2023 18:14:18 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 59B899C33B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876858; bh=vxB9oLD5A8xHGBMUg7J2yIrhOux9Grm13PosrGcRPbE=; h=From:To:Date:Message-Id:MIME-Version; b=IHV+QKPne+zRRfekNP2AQLZUYnupKyB+tspHfsHR5A4/xBzJVghypRUQneNPV2xAE OKK0vbGor+TGMNoKUSNTrGEK4ZVECd9dqO1TbHQVw70++JuSp2EWh05fn85mlJTRBu vf3HqhMh9CPoDUSOphej5T39AyoJvFSFdwdCD9AGFjtDQl57dYS+57WqHbGu8w6/o6 RcJYkhBxXZmgPmIJlb44P09rQTI16AjWRtgy2q4+p5bPO69gSxrJWshZl2SsXGwkdD dbBYw+7jb+S3wqEW7lJxYZM4PAbrW4jmrbZkMxfeECvf8bNJGHYTX+nJxjOhxSUAES J3SMmltChjSYg== 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 qYm9ziaDkj0m; Wed, 1 Nov 2023 18:14:18 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 720169C314F; Wed, 1 Nov 2023 18:14:17 -0400 (EDT) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 3/8] Toaster: Write UI TestCase create new Mickledore project Date: Wed, 1 Nov 2023 23:13:50 +0100 Message-Id: <20231101221355.239053-3-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231101221355.239053-1-alassane.yattara@savoirfairelinux.com> References: <20231101221355.239053-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 ; Wed, 01 Nov 2023 22:14:32 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5935 Test create new project using: - Project Name: Any string - Release: Yocto Project 4.2 "Mickledore" (option value: 4) - Merge Toaster settings: True Signed-off-by: Alassane Yattara --- .../functional/test_create_new_project.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/lib/toaster/tests/functional/test_create_new_project.py b/lib/toaster/tests/functional/test_create_new_project.py index 2b3c98ac..61a470cf 100644 --- a/lib/toaster/tests/functional/test_create_new_project.py +++ b/lib/toaster/tests/functional/test_create_new_project.py @@ -55,3 +55,41 @@ class TestCreateNewProject(SeleniumFunctionalTestCase): "//span[@id='project-release-title']" ).text), 'The project release is not defined') + + def test_create_new_project_mickledore(self): + """ Test create new project using: + - Project Name: Any string + - Release: Yocto Project 4.2 "Mickledore" (option value: 4) + - Merge Toaster settings: True + """ + release = 'Yocto Project 4.2 "Mickledore"' + project_name = 'projectmickledore' + self.get(reverse('newproject')) + self.driver.find_element(By.ID, + "new-project-name").send_keys(project_name) + + select = Select(self.find('#projectversion')) + select.select_by_value(str(4)) + + # check merge toaster settings + checkbox = self.find('.checkbox-mergeattr') + if not checkbox.is_selected(): + checkbox.click() + + self.driver.find_element(By.ID, "create-project-button").click() + + element = self.wait_until_visible('#project-created-notification') + self.assertTrue(self.element_exists('#project-created-notification'), + 'Project creation notification not shown') + self.assertTrue(project_name in element.text, + "New project name not in new project notification") + self.assertTrue(Project.objects.filter(name=project_name).count(), + "New project not found in database") + + # check release + self.assertTrue(re.search( + release, + self.driver.find_element(By.XPATH, + "//span[@id='project-release-title']" + ).text), + 'The project release is not defined')