From patchwork Thu Nov 9 22:14:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 34218 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 1B8A3C41535 for ; Thu, 9 Nov 2023 22:14:40 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.14626.1699568077283688171 for ; Thu, 09 Nov 2023 14:14:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=tzkUluwV; 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 314E99C2D22 for ; Thu, 9 Nov 2023 17:14:36 -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 nWMAsuZ-cpEk; Thu, 9 Nov 2023 17:14:35 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id BD52B9C34C8; Thu, 9 Nov 2023 17:14:35 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com BD52B9C34C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1699568075; bh=ezpjEXnjiQKCtwj2CGI7D0OG2QdsCg2pOXMh7/sOttI=; h=From:To:Date:Message-Id:MIME-Version; b=tzkUluwVuJC/+SCf0R6OQWGdbIm5Dw9f9660L/ZvLajEjV1agCWTdLStwdrkE8BOX 7G1k91y4t6RcaBw3AKPGLnofRIwYH/2e//p42CoLGM3eww3Ea0isOM13OCU3FxC7Ls PNT0/885EbE3AxfE4zdigJFAz0lkAv6tdeAqmJA2jLcsN10yOL8fos7ZUWJg7eGWip qfj3PgJtlSED4f0fOs4WxUnkXejAUOLS78EO8LRRfrAb3SFHpGc3/KKlunjatLbDrI 0T+m/SUFYDUV+yLTAkKluIiAZZgXf+ZxLtkuvsrDfZMk0Ih61YErdluxr/jd8j0wY/ fdlNTo/CXP/Dw== 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 MViyW35IKx9n; Thu, 9 Nov 2023 17:14:35 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 184099C2D22; Thu, 9 Nov 2023 17:14:34 -0500 (EST) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH v3 3/3] Toaster: Write UI TestCase import new project using Date: Thu, 9 Nov 2023 23:14:28 +0100 Message-Id: <20231109221428.108173-3-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231109221428.108173-1-alassane.yattara@savoirfairelinux.com> References: <20231109221428.108173-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 ; Thu, 09 Nov 2023 22:14:40 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5980 * Test import new project using: - Project Name: Any string - Project type: select (Import command line project) - Import existing project directory: Wrong Path Signed-off-by: Alassane Yattara --- .../functional/test_create_new_project.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/toaster/tests/functional/test_create_new_project.py b/lib/toaster/tests/functional/test_create_new_project.py index f33eb16d..a211d8b7 100644 --- a/lib/toaster/tests/functional/test_create_new_project.py +++ b/lib/toaster/tests/functional/test_create_new_project.py @@ -149,3 +149,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")