From patchwork Wed Nov 1 22:13:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33409 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 E3367C4167B 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.1311.1698876862446414206 for ; Wed, 01 Nov 2023 15:14:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=J2hrhfUw; 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 37F569C33B8 for ; Wed, 1 Nov 2023 18:14:16 -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 wXQSUFXdkB6H; Wed, 1 Nov 2023 18:14:12 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 1958C9C33C3; Wed, 1 Nov 2023 18:14:12 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 1958C9C33C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876852; bh=NoK4hE1FLfEI7njH+YDpHmOAuL+kStL1Imfptcwm9m4=; h=From:To:Date:Message-Id:MIME-Version; b=J2hrhfUwTlW8F+qROlk39jkvx2m6+m/ZZQoqLyFl2JAyxPzA9Kn4z239IQUXqUA59 63ei19qJ2rMgZzaWURP2BWDjtkx61f+hzQodBqCiu/dFWglddDTRyMrKwTBHvEnfay 9bL3edd/JatieilQsF5p8gJxPA5ebllLdanDLgD4bTCIwjl8VW+Te5R2m1l70jHLDf xc0ca+14qvtw877UvAZFkspgwgawRiBHPLqbdjnvP4llus48KW1DuK6FRmeetk8+7p XVlnkTg1d6Ehu5reAF1cI3YRukOpV9NgSnTp2EgHmk5jxyYSJkINs/9cwZ1u4DdLrd JlDWjUZXOhqvQ== 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 kEwLdzc_po6b; Wed, 1 Nov 2023 18:14:12 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 439709C314F; Wed, 1 Nov 2023 18:14:09 -0400 (EDT) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 1/8] Toaster: Write UI TestCase create new Master project Date: Wed, 1 Nov 2023 23:13:48 +0100 Message-Id: <20231101221355.239053-1-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 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/5934 Test create new project using: - Project Name: Any string - Release: Yocto Project master (option value: 3) - Merge Toaster settings: False Signed-off-by: Alassane Yattara --- .../functional/test_create_new_project.py | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 lib/toaster/tests/functional/test_create_new_project.py diff --git a/lib/toaster/tests/functional/test_create_new_project.py b/lib/toaster/tests/functional/test_create_new_project.py new file mode 100644 index 00000000..2b3c98ac --- /dev/null +++ b/lib/toaster/tests/functional/test_create_new_project.py @@ -0,0 +1,57 @@ +#! /usr/bin/env python3 +# +# BitBake Toaster UI tests implementation +# +# Copyright (C) 2023 Savoir-faire Linux Inc +# +# SPDX-License-Identifier: GPL-2.0-only +# + +import re +import pytest +from django.urls import reverse +from selenium.webdriver.support.ui import Select +from tests.functional.functional_helpers import SeleniumFunctionalTestCase +from orm.models import Project +from selenium.webdriver.common.by import By + +@pytest.mark.django_db +class TestCreateNewProject(SeleniumFunctionalTestCase): + + def test_create_new_project_master(self): + """ Test create new project using: + - Project Name: Any string + - Release: Yocto Project master (option value: 3) + - Merge Toaster settings: False + """ + release = 'Yocto Project master' + project_name = 'projectmaster' + 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(3)) + + # uncheck merge toaster settings + checkbox = self.find('.checkbox-mergeattr') + if 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') From patchwork Wed Nov 1 22:13:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33412 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 07B95C4167B for ; Wed, 1 Nov 2023 22:14:43 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.1318.1698876876634639196 for ; Wed, 01 Nov 2023 15:14:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=KuiTEBWv; 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 9B2229C33BA for ; Wed, 1 Nov 2023 18:14:29 -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 cKjCfCfIEW8Q; Wed, 1 Nov 2023 18:14:15 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id D3E9C9C3369; Wed, 1 Nov 2023 18:14:15 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com D3E9C9C3369 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876855; bh=NAiXiXudW5HAzWGSTgdi8vjw3qlRBRFU2L/jrIL19RI=; h=From:To:Date:Message-Id:MIME-Version; b=KuiTEBWvJHiGURGSjbYI0YuDhgNMnwaDIwytpZAY2B/+vjHdPDigUl3ztddcBE2uW lgnUMBmOeJanui8FDfWWWFlKr29rQDzdTn5429pLG54hIfIuPN+eUVRRvjADPyvL2f nG3mYuIft1Yk14UUQrZjvDx1kCZ5oSpMDTBjjTay2pzxIDT4CzOiAM+U4oUtwi5sHD eCYPJ3ZX/DXb25e89wKtQf26/Zs7gog0ilg7RamTI5T96VBaOJ/IpamRBTkuDv4N7c fMQGlDQ+oOwVJ/tlFF2lLET+FdjdLm9LEBZ0rDn8V71k9ndFJm5iiaDr5kZIeeTLDR kZeIYz++bK+mw== 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 0xj4hBx9M5cw; Wed, 1 Nov 2023 18:14:15 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 8B0C19C33B8; Wed, 1 Nov 2023 18:14:12 -0400 (EDT) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 2/8] Toaster: Bug-fix webdriver No parameter named options Date: Wed, 1 Nov 2023 23:13:49 +0100 Message-Id: <20231101221355.239053-2-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:43 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5940 Change options to chrome_options Signed-off-by: Alassane Yattara --- lib/toaster/tests/browser/selenium_helpers_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/toaster/tests/browser/selenium_helpers_base.py b/lib/toaster/tests/browser/selenium_helpers_base.py index e0ac4376..055dbebc 100644 --- a/lib/toaster/tests/browser/selenium_helpers_base.py +++ b/lib/toaster/tests/browser/selenium_helpers_base.py @@ -39,7 +39,7 @@ def create_selenium_driver(cls,browser='chrome'): options.add_argument('--disable-dev-shm-usage') options.add_argument('--no-sandbox') options.add_argument('--remote-debugging-port=9222') - return webdriver.Chrome(options=options) + return webdriver.Chrome(chrome_options=options) elif browser == 'firefox': return webdriver.Firefox() elif browser == 'marionette': 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') From patchwork Wed Nov 1 22:13:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33407 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 F0249C001B5 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.1314.1698876867006618206 for ; Wed, 01 Nov 2023 15:14:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=dJTK4M5N; 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 5F76F9C33B7 for ; Wed, 1 Nov 2023 18:14:24 -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 43uY63wqbdGa; Wed, 1 Nov 2023 18:14:19 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 82C829C33BA; Wed, 1 Nov 2023 18:14:19 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 82C829C33BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876859; bh=3hh0RG7v4lHUwo8O+xRyvs+aVFQkFVJgsvnNgnjOZAE=; h=From:To:Date:Message-Id:MIME-Version; b=dJTK4M5NI3gsciccudr05l52M5BLgiQv1FvTioZGBus5G3PaNi7BHTYW7fISyTmcc L47Nn4Uh9fi4HLSOcaqDU0bGbJrLUTaUkzFkIbXk97pCb2DqEa9+qG2bmWma3P74IZ +hMm7fmDyPR/JoyeCFKYwMIlxickVbJkRooO8ZCr0OVgdFfPMxnqNfmTISFbEIFFSe MFKBKQtOxlDHyDGKos3McThdFl0deX290aVj8VpwfCDhDu3OVGFlvQocWXyJK9OYSX Cilo6WXeu7rIB+xDWIfAR57qmz6ax53hldxgc67L6UkP5VnSAOWE/TSa1vpBghNVUu lzAJc/BXiShGw== 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 nG1rd34l3hCL; Wed, 1 Nov 2023 18:14:19 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id A87EF9C314F; Wed, 1 Nov 2023 18:14:18 -0400 (EDT) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 4/8] Toaster: Write UI TestCase create new Kirkstone project Date: Wed, 1 Nov 2023 23:13:51 +0100 Message-Id: <20231101221355.239053-4-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/5936 Test create new project using: - Project Name: Any string - Release: Yocto Project 4.0 "Kirkstone" (option value: 1) - Merge Toaster settings: True Signed-off-by: Alassane Yattara --- .../functional/test_create_new_project.py | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/lib/toaster/tests/functional/test_create_new_project.py b/lib/toaster/tests/functional/test_create_new_project.py index 61a470cf..c6345e5b 100644 --- a/lib/toaster/tests/functional/test_create_new_project.py +++ b/lib/toaster/tests/functional/test_create_new_project.py @@ -93,3 +93,42 @@ class TestCreateNewProject(SeleniumFunctionalTestCase): "//span[@id='project-release-title']" ).text), 'The project release is not defined') + + def test_create_new_project_kirkstone(self): + """ Test create new project using: + - Project Name: Any string + - Release: Yocto Project 4.0 "Kirkstone" (option value: 1) + - Merge Toaster settings: True + """ + release = 'Yocto Project 4.0 "Kirkstone"' + project_name = 'projectkirkstone' + 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(1)) + + # 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') From patchwork Wed Nov 1 22:13:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33411 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 E7177C4167D for ; Wed, 1 Nov 2023 22:14:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.1316.1698876873300848208 for ; Wed, 01 Nov 2023 15:14:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=yQpHGVNv; 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 7C2F89C33D1 for ; Wed, 1 Nov 2023 18:14:27 -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 pOkCI62mjJWD; Wed, 1 Nov 2023 18:14:22 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id B33B39C33C2; Wed, 1 Nov 2023 18:14:22 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com B33B39C33C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876862; bh=QfAutchq3OXSpFpcnwEuqM/AVOsnC0WyTeiyzaGwJjs=; h=From:To:Date:Message-Id:MIME-Version; b=yQpHGVNvUu+79ZdJmp1R/eG2Uu7KD4/5L82YZFMyoFO+Qlc8b3zCwiVR/vuoypw98 2t2ZagyfQ8pYz4nS2YRCRu2ijuYEEX1wRFovusC4taGvDwF+BP1dA2nkaAqBcrOsFJ AXHg+E3ECbNCd0OctSfSvWicbCRgS439p43/tyBEQ0XP/YXC53t5JNUoAJ5VDprfSD Zgo2hdZlnY7J4JQK1m6/PI33QCN4G5NIzImMLDphIcVyGfxq2/MtnZ+Q80u5Cz4gsu LFhywYeBBF+7b8E2Fpk5B2Q+Eayl0Ap7skeuU6R0B8E20hPOTHzjJs3E7iMqX6taKB N3WwqlPzpa59A== 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 qKXDt6pUOnrR; Wed, 1 Nov 2023 18:14:22 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 050549C314F; Wed, 1 Nov 2023 18:14:19 -0400 (EDT) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 5/8] Toaster: Write UI TestCase create new Dunfell project Date: Wed, 1 Nov 2023 23:13:52 +0100 Message-Id: <20231101221355.239053-5-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:42 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5938 Test create new project using: - Project Name: Any string - Release: Yocto Project 3.1 "Dunfell" (option value: 5) - Merge Toaster settings: False 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 c6345e5b..cd690e1a 100644 --- a/lib/toaster/tests/functional/test_create_new_project.py +++ b/lib/toaster/tests/functional/test_create_new_project.py @@ -132,3 +132,41 @@ class TestCreateNewProject(SeleniumFunctionalTestCase): "//span[@id='project-release-title']" ).text), 'The project release is not defined') + + def test_create_new_project_dunfull(self): + """ Test create new project using: + - Project Name: Any string + - Release: Yocto Project 3.1 "Dunfell" (option value: 5) + - Merge Toaster settings: False + """ + release = 'Yocto Project 3.1 "Dunfell"' + project_name = 'projectdunfull' + 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(5)) + + # check merge toaster settings + checkbox = self.find('.checkbox-mergeattr') + if 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') From patchwork Wed Nov 1 22:13:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33410 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 EE730C41535 for ; Wed, 1 Nov 2023 22:14:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.1302.1698876873147014823 for ; Wed, 01 Nov 2023 15:14:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=xum1Wa78; 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 6DE3D9C33B7 for ; Wed, 1 Nov 2023 18:14:30 -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 FcgbPfesdL78; Wed, 1 Nov 2023 18:14:25 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id C60839C33C5; Wed, 1 Nov 2023 18:14:25 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com C60839C33C5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876865; bh=94+amjyIgvInxUZ8H9cnNiXLx0xQVg4itWH/vUulgWw=; h=From:To:Date:Message-Id:MIME-Version; b=xum1Wa78uqh06ZIM2POUDhQlB9AQkf9jBSCEX0sk3lKQusYvilsyXtkSKTYPSq3wj Gggoc/8Z9Hd0jxENbKy6JQU+5IgXvfwztAwPYhvazOHVayxt4N3izD8YwwF55V5Udh NTg9O3Bkhs5RZI06qsTiE4TQPvJzFnWC3W2aDoeZUBeGFIV9ONbYzl7E4OHyp/2m7s 8bGClAWb/4XJ4VGvNmarubBXdFBlUx2rPKVgKiBzMAes1RBjgVUy4agka4LBY+LvfT mQIaX5zvJJahG0StwzOMxaTYswm5mzDIQojm4mva7BJEL4xPAD2qdV4YTunwPJtLXr Wptt/ZsWm/0pQ== 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 oxc7OoaGSHd1; Wed, 1 Nov 2023 18:14:25 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 357C19C3367; Wed, 1 Nov 2023 18:14:24 -0400 (EDT) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 6/8] Toaster: Write UI TestCase create new Local project Date: Wed, 1 Nov 2023 23:13:53 +0100 Message-Id: <20231101221355.239053-6-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:42 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5939 Test create new project using: - Project Name: Any string - Release: Local Yocto Project (option value: 2) - Merge Toaster settings: True Signed-off-by: Alassane Yattara --- .../functional/test_create_new_project.py | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/lib/toaster/tests/functional/test_create_new_project.py b/lib/toaster/tests/functional/test_create_new_project.py index cd690e1a..809635bd 100644 --- a/lib/toaster/tests/functional/test_create_new_project.py +++ b/lib/toaster/tests/functional/test_create_new_project.py @@ -170,3 +170,43 @@ class TestCreateNewProject(SeleniumFunctionalTestCase): "//span[@id='project-release-title']" ).text), 'The project release is not defined') + + def test_create_new_project_local(self): + """ Test create new project using: + - Project Name: Any string + - Release: Local Yocto Project (option value: 2) + - Merge Toaster settings: True + """ + release = 'Local Yocto Project' + project_name = 'projectlocal' + 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(2)) + + # 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') + + From patchwork Wed Nov 1 22:13:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33413 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 E0A2AC4332F for ; Wed, 1 Nov 2023 22:14:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.1317.1698876873315467430 for ; Wed, 01 Nov 2023 15:14:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=q1FEhlIR; 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 98C459C3367 for ; Wed, 1 Nov 2023 18:14:31 -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 0BrlGi2aQzY9; Wed, 1 Nov 2023 18:14:27 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id E76C99C33C8; Wed, 1 Nov 2023 18:14:26 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com E76C99C33C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876866; bh=Rh/H/sqqHP3Eyr13bP2o8vSgpdS62ySBYxkSeJohA28=; h=From:To:Date:Message-Id:MIME-Version; b=q1FEhlIROmqIDbjOq1Zyxu2xvvOWOZlWDkpHvFbkAuvv6luK09/aDdCcm/Ygz4Tlq wKgU8AzBPsRakBDwacAEIQFIt/LxOeTMdpMAJ4zZGwenZIns8zU+YAemGIgM3CZKsj vxs6L0LIuFIFqL31VUHr9ZYasrVBonH6IY7YUhvhN088IfWNJDdtZhZFDqgv7mNMVX /UqF4vlxhahZZ4I5UjEmYHI4SQgLXZvdU7TFOSPdteJDKnfZdzvcCZajErHWbLs8wJ z3/OEEvyDZZrtVUf/UibKd/8sfLlyx7k5GSTMT39kzLlwuhMIi5vcKfTZnM/CGSEO/ Wy6rmZ6nJwUbw== 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 4ZzfwZfFr26o; Wed, 1 Nov 2023 18:14:26 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 2BEDA9C3367; Wed, 1 Nov 2023 18:14:25 -0400 (EDT) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 7/8] Toaster: Test create new project without project name Date: Wed, 1 Nov 2023 23:13:54 +0100 Message-Id: <20231101221355.239053-7-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:42 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5937 Signed-off-by: Alassane Yattara --- .../tests/functional/test_create_new_project.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/toaster/tests/functional/test_create_new_project.py b/lib/toaster/tests/functional/test_create_new_project.py index 809635bd..54e6231e 100644 --- a/lib/toaster/tests/functional/test_create_new_project.py +++ b/lib/toaster/tests/functional/test_create_new_project.py @@ -209,4 +209,19 @@ class TestCreateNewProject(SeleniumFunctionalTestCase): ).text), 'The project release is not defined') + def test_create_new_project_without_name(self): + """ Test create new project without project name """ + self.get(reverse('newproject')) + + select = Select(self.find('#projectversion')) + select.select_by_value(str(3)) + + # Check input name has required attribute + input_name = self.driver.find_element(By.ID, "new-project-name") + self.assertIsNotNone(input_name.get_attribute('required'), + 'Input name has not required attribute') + # Check create button is disabled + create_btn = self.driver.find_element(By.ID, "create-project-button") + self.assertIsNotNone(create_btn.get_attribute('disabled'), + 'Create button is not disabled') From patchwork Wed Nov 1 22:13:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33414 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 EE2C6C4167D for ; Wed, 1 Nov 2023 22:15:02 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.1311.1698876901580821721 for ; Wed, 01 Nov 2023 15:15:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=rIpHNz6S; 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 0B8789C3367 for ; Wed, 1 Nov 2023 18:14:35 -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 KJlWbN3dZRsr; Wed, 1 Nov 2023 18:14:30 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 4C1229C3369; Wed, 1 Nov 2023 18:14:30 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 4C1229C3369 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876870; bh=uKLtkl+Mmj5NAwt4qqoROnPsRex/rl94y2+6yGNaius=; h=From:To:Date:Message-Id:MIME-Version; b=rIpHNz6SEmgwrdEqV00oRI5f+Ek7d40eL4kr/ILfw/DXi2T7Fvbh1mj2moBTFFa6t A9Zr7dyFtd8FfyLkt0D2UsWZKUVHGhaDrdKTRhF7dSDcVVT0Kys4x+rSwe1WL1pesN zHsYFhJEz/6HGvClSQmhp20ZCpVIQEfwaCK49AzA3yGF6LCKnWyveaxY7tCBGwXrmz 6WO+yQtfRMeFanrb2qD+RwF15jUuXEEHUW53OfSWYXPlBL8zjcdgh7XuXIJ5zGzlPc V9f1lWjGu40duxuuQYgBPsUnRCy8EgdjkVOR+HB1nLtjMjN/84NM3sFCGQOevvk4XB AoI2krili3ZqQ== 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 AWzduNSIR0If; Wed, 1 Nov 2023 18:14:30 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 920CA9C33C2; Wed, 1 Nov 2023 18:14:27 -0400 (EDT) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 8/8] Toaster: Write UI TestCase import new project using Date: Wed, 1 Nov 2023 23:13:55 +0100 Message-Id: <20231101221355.239053-8-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:15:02 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5941 Test import new project using: - Project Name: Any string - Project type: select (Import command line project) - Import existing project directory: Wrong Path Update copyright, remove "Inc" Signed-off-by: Alassane Yattara --- .../functional/test_create_new_project.py | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/toaster/tests/functional/test_create_new_project.py b/lib/toaster/tests/functional/test_create_new_project.py index 54e6231e..c04440d9 100644 --- a/lib/toaster/tests/functional/test_create_new_project.py +++ b/lib/toaster/tests/functional/test_create_new_project.py @@ -2,7 +2,7 @@ # # BitBake Toaster UI tests implementation # -# Copyright (C) 2023 Savoir-faire Linux Inc +# Copyright (C) 2023 Savoir-faire Linux # # SPDX-License-Identifier: GPL-2.0-only # @@ -225,3 +225,28 @@ class TestCreateNewProject(SeleniumFunctionalTestCase): create_btn = self.driver.find_element(By.ID, "create-project-button") self.assertIsNotNone(create_btn.get_attribute('disabled'), 'Create button is not disabled') + + def test_import_new_project(self): + """ Test import new project using: + - Project Name: Any string + - Project type: select (Import command line project) + - Import existing project directory: Wrong Path + """ + project_name = 'projectimport' + self.get(reverse('newproject')) + self.driver.find_element(By.ID, + "new-project-name").send_keys(project_name) + # select import project + self.find('#type-import').click() + + # set wrong path + wrong_path = '/wrongpath' + self.driver.find_element(By.ID, + "import-project-dir").send_keys(wrong_path) + self.driver.find_element(By.ID, "create-project-button").click() + + # check error message + self.assertTrue(self.element_exists('.alert-danger'), + 'Allert message not shown') + self.assertTrue(wrong_path in self.find('.alert-danger').text, + "Wrong path not in alert message")