toaster.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
To: toaster@lists.yoctoproject.org
Cc: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Subject: [PATCH v3 3/3] Toaster: Write UI TestCase import new project using
Date: Thu,  9 Nov 2023 23:14:57 +0100	[thread overview]
Message-ID: <20231109221457.108782-3-alassane.yattara@savoirfairelinux.com> (raw)
In-Reply-To: <20231109221457.108782-1-alassane.yattara@savoirfairelinux.com>

* 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 <alassane.yattara@savoirfairelinux.com>
---
 .../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")
-- 
2.34.1



  parent reply	other threads:[~2023-11-09 22:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 22:14 [PATCH v3 1/3] Toaster: Write UI TestCase create new project Alassane Yattara
2023-11-09 22:14 ` [PATCH v3 2/3] Toaster: Test create new project without project name Alassane Yattara
2023-11-09 22:14 ` Alassane Yattara [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-11-09 22:14 [PATCH v3 1/3] Toaster: Write UI TestCase create new project Alassane Yattara
2023-11-09 22:14 ` [PATCH v3 3/3] Toaster: Write UI TestCase import new project using Alassane Yattara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231109221457.108782-3-alassane.yattara@savoirfairelinux.com \
    --to=alassane.yattara@savoirfairelinux.com \
    --cc=toaster@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).