[PATCH 8/8] Toaster: Write UI TestCase import new project using
Alassane Yattara <[email protected]> Wed, 1 Nov 2023 23:13:55 +0100
| Newsgroups | org.yoctoproject.lists.toaster |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> --- .../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") -- 2.34.1