diff mbox series

[v2,3/3] Toaster: Write UI TestCase import new project using

Message ID 20231109215514.92165-3-alassane.yattara@savoirfairelinux.com
State New
Headers show
Series [v2,1/3] Toaster: Write UI TestCase create new project | expand

Commit Message

Alassane Yattara Nov. 9, 2023, 9:55 p.m. UTC
* 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 <alassane.yattara@savoirfairelinux.com>
---
 .../functional/test_create_new_project.py     | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)

Comments

Richard Purdie Nov. 9, 2023, 10:06 p.m. UTC | #1
On Thu, 2023-11-09 at 22:55 +0100, Alassane Yattara wrote:
> * 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"

This patch series looks *much* better in general, thanks!

I was a little bit puzzled by this last line item about copyright?

Cheers,

Richard

> 
> 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")
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#5976): https://lists.yoctoproject.org/g/toaster/message/5976
> Mute This Topic: https://lists.yoctoproject.org/mt/102495675/1686473
> Group Owner: toaster+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/toaster/unsub [richard.purdie@linuxfoundation.org]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Alassane Yattara Nov. 9, 2023, 10:18 p.m. UTC | #2
Richard,

Yes you right below line should be remove from commit msg.

> * Update copyright, remove "Inc"

----- Mail original -----
De: "Richard Purdie" <richard.purdie@linuxfoundation.org>
À: "Alassane Yattara" <alassane.yattara@savoirfairelinux.com>, "toaster" <toaster@lists.yoctoproject.org>
Envoyé: Jeudi 9 Novembre 2023 23:06:28
Objet: Re: [Toaster] [PATCH v2 3/3] Toaster: Write UI TestCase import new project using

On Thu, 2023-11-09 at 22:55 +0100, Alassane Yattara wrote:
> * 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"

This patch series looks *much* better in general, thanks!

I was a little bit puzzled by this last line item about copyright?

Cheers,

Richard

> 
> 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")
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#5976): https://lists.yoctoproject.org/g/toaster/message/5976
> Mute This Topic: https://lists.yoctoproject.org/mt/102495675/1686473
> Group Owner: toaster+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/toaster/unsub [richard.purdie@linuxfoundation.org]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

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")