From patchwork Wed Nov 1 22:13:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33416 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 A2D66C4332F for ; Wed, 1 Nov 2023 22:13:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.1273.1698876813439948840 for ; Wed, 01 Nov 2023 15:13:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=eL5vBeDY; 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 7FB9F9C33C5 for ; Wed, 1 Nov 2023 18:13: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 YIHXkRGpL2D1; Wed, 1 Nov 2023 18:13:24 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 626F49C3369; Wed, 1 Nov 2023 18:13:24 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 626F49C3369 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876804; bh=NoK4hE1FLfEI7njH+YDpHmOAuL+kStL1Imfptcwm9m4=; h=From:To:Date:Message-Id:MIME-Version; b=eL5vBeDYeVMVZ90fLCNiyQhpfUuvF5ziJXiLDKyBaqroTulMGURqjOQ9hAyugV+bl ZSAYXJRcz8jP/ZZogE9K6G5pa3GAWgTgC03McpZ8ndrsvL7tmaVfRDFL85ajHrIoN/ 1X2QvAe/Zf7e3t78wwsloKOh/XRdEOHPpl5EaJXWmlrDBo/2X0GZQQYwYHWlOzUDaE gyh9YwX22bwhABGVPjSfGBWe8l+XULRp9LMDQeUczoq8PbRkOxeDTa6QfY2c4rZpha jED2V2RAypqzH4gV3APvEbUsDDviiHT8ptgPQ0IrOW+aIV/J6+EZp+l+gm3kK5Iusf An56Q6w5YozxA== 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 gWAGSc5K0yTL; Wed, 1 Nov 2023 18:13:24 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id C3A9B9C314F; Wed, 1 Nov 2023 18:13:22 -0400 (EDT) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 1/8] Toaster: Write UI TestCase create new Master project Date: Wed, 1 Nov 2023 23:13:07 +0100 Message-Id: <20231101221314.236173-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:13:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15405 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:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33421 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 E28C0C001DB for ; Wed, 1 Nov 2023 22:13:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.1274.1698876813511961230 for ; Wed, 01 Nov 2023 15:13:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=aCyv8oI9; 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 0159F9C33C6 for ; Wed, 1 Nov 2023 18:13: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 c33lHfV-vNyL; Wed, 1 Nov 2023 18:13:26 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 4E4119C33B7; Wed, 1 Nov 2023 18:13:26 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 4E4119C33B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876806; bh=NAiXiXudW5HAzWGSTgdi8vjw3qlRBRFU2L/jrIL19RI=; h=From:To:Date:Message-Id:MIME-Version; b=aCyv8oI9H1k0poV8JJ+UPAlpM4nOVXlFuShLRKuhJGOm/hy+LUmgjdAcuCC0W++fS VJoFvvzC1qiGIoyjF3/noyFdhSXonHoGojrixG2kHZIysvskwaS0tfwogcUJwzeuxq vrc4VVY1XJ6njjsOsUKjGBYj60qcQJvYMP9GcG9aGhEprDyAhwCxjaXd8fxEOBBF9B GFu5pfQkPStU4CEY4MsVUQRgylD9GqhTWGo+NB6mSugzyuBXEmFbLeqWbWj5CV8bma DLZF/2bPKJvIFZkSxSXwMmr1x5dKuExRyKXsRsTNMPZrRRQk9zvUJyYXeLEoeKyX17 qjimeFAsOB3ow== 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 C-idA4XSQmbS; Wed, 1 Nov 2023 18:13:26 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id BB47F9C314F; Wed, 1 Nov 2023 18:13:24 -0400 (EDT) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 2/8] Toaster: Bug-fix webdriver No parameter named options Date: Wed, 1 Nov 2023 23:13:08 +0100 Message-Id: <20231101221314.236173-2-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231101221314.236173-1-alassane.yattara@savoirfairelinux.com> References: <20231101221314.236173-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:13:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15407 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:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33422 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 F00F2C4708E for ; Wed, 1 Nov 2023 22:13:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.1291.1698876814163174734 for ; Wed, 01 Nov 2023 15:13:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=M9dx439g; 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 D1EDD9C314F for ; Wed, 1 Nov 2023 18:13: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 AqIIB8PDkV09; Wed, 1 Nov 2023 18:13:27 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 28EC59C33BA; Wed, 1 Nov 2023 18:13:27 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 28EC59C33BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876807; bh=vxB9oLD5A8xHGBMUg7J2yIrhOux9Grm13PosrGcRPbE=; h=From:To:Date:Message-Id:MIME-Version; b=M9dx439gVBPr3hTQiIQXSOfIsKAylO2kwvMzZrR5wt7VTl4qSWwNjleKYj60NCbcL byOI2fNwAmXwKzs4rNlva5lQ8Tj4J/Rh3jbJw3QHhCy2/hWlElzu9Q6/zjoLnwdtZl jG7CmtYa/sMe07b9bHcmd5udqoAf+e9M9MEVZJedY/eoyAd/zNUM1UJKXfJs7u2Rq/ J6+KhWKsBCaefahSDz/C6RRNmkO61q1QJhVIEyReXX+1DiRd9PiqPpdq0zA2ovAniv 9dhbO4fHqSQ9wS6vYH/SoUY+G25gactcwxe9qxCwey6vOnmkZPG2DZ81/x3tBxVArH O/fLLi/Z6iOiQ== 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 QTUFa8_I4Wio; Wed, 1 Nov 2023 18:13:27 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 9026A9C314F; Wed, 1 Nov 2023 18:13:26 -0400 (EDT) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 3/8] Toaster: Write UI TestCase create new Mickledore project Date: Wed, 1 Nov 2023 23:13:09 +0100 Message-Id: <20231101221314.236173-3-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231101221314.236173-1-alassane.yattara@savoirfairelinux.com> References: <20231101221314.236173-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:13:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15408 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:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33419 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 CE6E2C001B5 for ; Wed, 1 Nov 2023 22:13:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.1275.1698876813802639349 for ; Wed, 01 Nov 2023 15:13:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=QSskaK7A; 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 B57099C33C2 for ; Wed, 1 Nov 2023 18:13:32 -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 XBUaulJSGH2Y; Wed, 1 Nov 2023 18:13:28 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 13CF79C33C3; Wed, 1 Nov 2023 18:13:28 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 13CF79C33C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876808; bh=3hh0RG7v4lHUwo8O+xRyvs+aVFQkFVJgsvnNgnjOZAE=; h=From:To:Date:Message-Id:MIME-Version; b=QSskaK7A2EZqdlMFDLLmfCVzRkMAEQWOYktltsCfyjh0bsZJ7hn7T3BHY2pCbyF0T nySqEpOWLv0XkkRUNxhbR5Glg0FYqNtWn3tBsXLzId3N4vUHhlZd3ugYcuCtdOS/L+ /S+eUofsYtdO39SZiH76QaSD+VeL34lUW2SqgMkUZXjAvioRICGw+lIqgFFF7i2eNX FUQnKyS4ZYFvOErYBloIfVbe5UfkrjAzHSUkxAsB7lni3AyrXM5itvogGz915nK4Vy prE2UXMBFw/FC0DFvl0HAB5GaoPAx4/jWSKwyId0IXeXQFcw3lHaXls4r8PX0no1T5 +FbrwaU5+oZdw== 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 GRzx1FZAweZN; Wed, 1 Nov 2023 18:13:28 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 701CD9C314F; Wed, 1 Nov 2023 18:13:27 -0400 (EDT) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 4/8] Toaster: Write UI TestCase create new Kirkstone project Date: Wed, 1 Nov 2023 23:13:10 +0100 Message-Id: <20231101221314.236173-4-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231101221314.236173-1-alassane.yattara@savoirfairelinux.com> References: <20231101221314.236173-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:13:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15406 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:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33418 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 BEEE4C4167D for ; Wed, 1 Nov 2023 22:13:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.1293.1698876816615951476 for ; Wed, 01 Nov 2023 15:13:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=Yobs/PZc; 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 3D4279C33C8 for ; Wed, 1 Nov 2023 18:13:34 -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 xwxiPyvBAOkj; Wed, 1 Nov 2023 18:13:29 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 8C4BD9C3369; Wed, 1 Nov 2023 18:13:29 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 8C4BD9C3369 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876809; bh=QfAutchq3OXSpFpcnwEuqM/AVOsnC0WyTeiyzaGwJjs=; h=From:To:Date:Message-Id:MIME-Version; b=Yobs/PZc4d6WqqpW5xbziVYkKEWggE+bmt2RW2p4uwS8bVRG+6fmyAkmpOmaRfwly qE3/FSW1i+8wQ8KsMdoVu8AoYg/YzGSMaw0TDMYZKj3jL5sJPQDdAZFI9kYQZxBrkQ KWlFbjOgdixRDyL194xtkQPlmeISm3tWtH7sWxQ6w75MDfSfGU3lisiFI4Pd31okYA xqel7WwnStYKojcynLkHrq0qTOfeJnPHP3gxnmrkzEYIRtW9A9lE7dGnR7BAWRkZgH KrXZx8k2CnEf5zLmPbhEhcFdczaGe3hQWm3DcnvjVOytb5P7FxxDG8JnZyUdyolAbp eeINVapnAfbxg== 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 e0Rced-aqntS; Wed, 1 Nov 2023 18:13:29 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 82A709C314F; Wed, 1 Nov 2023 18:13:28 -0400 (EDT) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 5/8] Toaster: Write UI TestCase create new Dunfell project Date: Wed, 1 Nov 2023 23:13:11 +0100 Message-Id: <20231101221314.236173-5-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231101221314.236173-1-alassane.yattara@savoirfairelinux.com> References: <20231101221314.236173-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:13:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15409 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:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33420 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 CE884C41535 for ; Wed, 1 Nov 2023 22:13:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.1277.1698876817028313624 for ; Wed, 01 Nov 2023 15:13:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=oH3A+yLk; 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 2E0D09C314F for ; Wed, 1 Nov 2023 18:13:36 -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 asq0b_3Oyjxs; Wed, 1 Nov 2023 18:13:31 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 80CDE9C33B7; Wed, 1 Nov 2023 18:13:31 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 80CDE9C33B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876811; bh=94+amjyIgvInxUZ8H9cnNiXLx0xQVg4itWH/vUulgWw=; h=From:To:Date:Message-Id:MIME-Version; b=oH3A+yLkmRONyK8FbYTKKWg3WJ2hj9GmxoAEQTd0REayQRcAGgDfs8iQHKS70CS6I 7WQjpR2ANxLzSwgpsZmyxrZ3BK2xmFMnrIztGDc92iOdhDZ+91s/YUGbMlTD9uWBZI rUe1ncyOWGNirotYE7vnQoRE2/+1yfBu8eJFl3wJSGkLEYMxYySY5NJFDQpIke5b82 bXUiYUNrjq8wZwZsgcJT5zdk9zQwuIJXYTUWW6vqD55VJUUhh4/ndmcsNwDmkYhgg9 5hgYsrfzbt2OI+nLnPzSS2fCi5nxB+aT1RWFKCyC4cKCUK8FsfYAXzHYe/IaD1QSpz Yvm7903NxU3ow== 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 4bYgBWMCy1Fi; Wed, 1 Nov 2023 18:13:31 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 0D8719C314F; Wed, 1 Nov 2023 18:13:29 -0400 (EDT) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 6/8] Toaster: Write UI TestCase create new Local project Date: Wed, 1 Nov 2023 23:13:12 +0100 Message-Id: <20231101221314.236173-6-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231101221314.236173-1-alassane.yattara@savoirfairelinux.com> References: <20231101221314.236173-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:13:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15410 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:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33417 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 E2FCDC001DD for ; Wed, 1 Nov 2023 22:13:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.1279.1698876819852399146 for ; Wed, 01 Nov 2023 15:13:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=b3arW6z2; 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 34D569C33B7 for ; Wed, 1 Nov 2023 18:13:38 -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 GbRTyXzWW6Oi; Wed, 1 Nov 2023 18:13:33 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 9094B9C33C3; Wed, 1 Nov 2023 18:13:33 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 9094B9C33C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876813; bh=Rh/H/sqqHP3Eyr13bP2o8vSgpdS62ySBYxkSeJohA28=; h=From:To:Date:Message-Id:MIME-Version; b=b3arW6z2gGjb9rHLfEE8HNgHQYlnob9xcGeUETuNZocX2J/xWW5tKAEtc/xTdVaNW CaSPcml7mQcNwhLJCwlrFhthsg8HPqdr2JQ9uo80S32oyBLIqxxOSvY0yluVWXM8km B7NLSokbeM+/BqmU5PfW2PGBQWm0yhxRNlFer+vUWq3/3QzIsn6raHK6NJ26KW1Mrq rl07ccNIEoz1zCznyaOx66siJRm/aWZf9/XaPQPEAW+c4zfyUtCc3u0fa06nX3HfFA 4T/DzBxQjZbyWZ5LvI3ZV97SDxtndMQyEYJ0n2HyAGPtm+R+aiF0PczVZDhjPGghpc ik1STN+INeKxw== 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 3rq0YZWsSmXr; Wed, 1 Nov 2023 18:13:33 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 650429C33BA; Wed, 1 Nov 2023 18:13:31 -0400 (EDT) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 7/8] Toaster: Test create new project without project name Date: Wed, 1 Nov 2023 23:13:13 +0100 Message-Id: <20231101221314.236173-7-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231101221314.236173-1-alassane.yattara@savoirfairelinux.com> References: <20231101221314.236173-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:13:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15411 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:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 33415 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 A4F93C4167B for ; Wed, 1 Nov 2023 22:13:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.1282.1698876821224103986 for ; Wed, 01 Nov 2023 15:13:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=yFps+pjx; 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 9003D9C33C5 for ; Wed, 1 Nov 2023 18:13:39 -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 0an72s6fwaWG; Wed, 1 Nov 2023 18:13:34 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id E26699C3369; Wed, 1 Nov 2023 18:13:34 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com E26699C3369 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698876814; bh=uKLtkl+Mmj5NAwt4qqoROnPsRex/rl94y2+6yGNaius=; h=From:To:Date:Message-Id:MIME-Version; b=yFps+pjxikQCFLFemen2J7zdyejcRz2lvLwvc9xpSUSf/LmkX1F66BmZPU3eBBPM1 YqtWVGiDyojxdDzID8rMEzQ/gBvih7mrvfpcfvVjR/RBcwWQO9hfmx6A2AFcqVJ+Zr 6OpHatUpSbTZPCqaPpD+CjUndCyoHzLW2HvZECmzX5oXGB1QBEmUIeVhRrW8DLYGMr vWgwKB/ZTHtk/aXt2sB0vF7VsM7G5HowhQvvsrPncXso1jzS9M8WUGCMAuikOcHYUM JNE1EZ2lbDVjZUitGNgsiOR/dwJqYWoyPZ7KTdW9r43ql/m/8cfO+oCVNjXg1fjJ4M QCT+unk+r4OjQ== 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 P09JJLPxRCgq; Wed, 1 Nov 2023 18:13:34 -0400 (EDT) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id C7A819C33BA; Wed, 1 Nov 2023 18:13:33 -0400 (EDT) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 8/8] Toaster: Write UI TestCase import new project using Date: Wed, 1 Nov 2023 23:13:14 +0100 Message-Id: <20231101221314.236173-8-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231101221314.236173-1-alassane.yattara@savoirfairelinux.com> References: <20231101221314.236173-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:13:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15412 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")