diff options
| author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-11-09 23:14:57 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-09 22:52:42 +0000 |
| commit | a9befd527e173a0b8d7e684691e287e5c1587baa (patch) | |
| tree | 0822509f6c50840cf31b8e3b568ef0a5d5b71686 /bitbake | |
| parent | 36871610c310f85240d02fd156cd8d981352f55a (diff) | |
| download | poky-a9befd527e173a0b8d7e684691e287e5c1587baa.tar.gz | |
bitbake: Toaster: Write UI TestCase import new project using
* Test import new project using:
- Project Name: Any string
- Project type: select (Import command line project)
- Import existing project directory: Wrong Path
(Bitbake rev: d9239f2d2235f2adb0322ecb2cedd507a00e1e90)
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
| -rw-r--r-- | bitbake/lib/toaster/tests/functional/test_create_new_project.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/tests/functional/test_create_new_project.py b/bitbake/lib/toaster/tests/functional/test_create_new_project.py index f33eb16dd0..a211d8b759 100644 --- a/bitbake/lib/toaster/tests/functional/test_create_new_project.py +++ b/bitbake/lib/toaster/tests/functional/test_create_new_project.py | |||
| @@ -149,3 +149,28 @@ class TestCreateNewProject(SeleniumFunctionalTestCase): | |||
| 149 | create_btn = self.driver.find_element(By.ID, "create-project-button") | 149 | create_btn = self.driver.find_element(By.ID, "create-project-button") |
| 150 | self.assertIsNotNone(create_btn.get_attribute('disabled'), | 150 | self.assertIsNotNone(create_btn.get_attribute('disabled'), |
| 151 | 'Create button is not disabled') | 151 | 'Create button is not disabled') |
| 152 | |||
| 153 | def test_import_new_project(self): | ||
| 154 | """ Test import new project using: | ||
| 155 | - Project Name: Any string | ||
| 156 | - Project type: select (Import command line project) | ||
| 157 | - Import existing project directory: Wrong Path | ||
| 158 | """ | ||
| 159 | project_name = 'projectimport' | ||
| 160 | self.get(reverse('newproject')) | ||
| 161 | self.driver.find_element(By.ID, | ||
| 162 | "new-project-name").send_keys(project_name) | ||
| 163 | # select import project | ||
| 164 | self.find('#type-import').click() | ||
| 165 | |||
| 166 | # set wrong path | ||
| 167 | wrong_path = '/wrongpath' | ||
| 168 | self.driver.find_element(By.ID, | ||
| 169 | "import-project-dir").send_keys(wrong_path) | ||
| 170 | self.driver.find_element(By.ID, "create-project-button").click() | ||
| 171 | |||
| 172 | # check error message | ||
| 173 | self.assertTrue(self.element_exists('.alert-danger'), | ||
| 174 | 'Allert message not shown') | ||
| 175 | self.assertTrue(wrong_path in self.find('.alert-danger').text, | ||
| 176 | "Wrong path not in alert message") | ||
