diff options
author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-11-21 14:51:27 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-23 12:06:06 +0000 |
commit | a303b37bd6699193d69fd983b768c7fecf8ee782 (patch) | |
tree | 6b498fefe5a672d469a1410fafb70f82e5992da1 /bitbake/lib/toaster | |
parent | bc9da9aa64349e05a95d8c3347926b0269dbdc9a (diff) | |
download | poky-a303b37bd6699193d69fd983b768c7fecf8ee782.tar.gz |
bitbake: toaster/tests: Add UI TestCase - Test project page tab import layer
(Bitbake rev: 857e6fdefa655fa73460c9bb008dc08abb4c3107)
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r-- | bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py b/bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py index ca3b88d2a6..14a859a13a 100644 --- a/bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py +++ b/bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py | |||
@@ -306,3 +306,46 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): | |||
306 | ) | 306 | ) |
307 | cancel_button.click() | 307 | cancel_button.click() |
308 | self.assertTrue(len(lastest_builds) == 2) | 308 | self.assertTrue(len(lastest_builds) == 2) |
309 | |||
310 | def test_project_page_tab_importlayer(self): | ||
311 | """ Test project page tab import layer """ | ||
312 | # navigate to the project page | ||
313 | url = reverse("project", args=(1,)) | ||
314 | self.get(url) | ||
315 | |||
316 | # navigate to "Import layers" tab | ||
317 | import_layers_tab = self._get_tabs()[2] | ||
318 | import_layers_tab.find_element(By.TAG_NAME, 'a').click() | ||
319 | self.wait_until_visible('#layer-git-repo-url') | ||
320 | |||
321 | # Check git repo radio button | ||
322 | git_repo_radio = self.find('#git-repo-radio') | ||
323 | git_repo_radio.click() | ||
324 | |||
325 | # Set git repo url | ||
326 | input_repo_url = self.find('#layer-git-repo-url') | ||
327 | input_repo_url.send_keys('git://git.yoctoproject.org/meta-fake') | ||
328 | # Blur the input to trigger the validation | ||
329 | input_repo_url.send_keys(Keys.TAB) | ||
330 | |||
331 | # Check name is set | ||
332 | input_layer_name = self.find('#import-layer-name') | ||
333 | self.assertTrue(input_layer_name.get_attribute('value') == 'meta-fake') | ||
334 | |||
335 | # Set branch | ||
336 | input_branch = self.find('#layer-git-ref') | ||
337 | input_branch.send_keys('master') | ||
338 | |||
339 | # Import layer | ||
340 | self.find('#import-and-add-btn').click() | ||
341 | |||
342 | # Check layer is added | ||
343 | self.wait_until_visible('#layer-container') | ||
344 | block_l = self.driver.find_element( | ||
345 | By.XPATH, '//*[@id="project-page"]/div[2]') | ||
346 | layers = block_l.find_element(By.ID, 'layer-container') | ||
347 | layers_list = layers.find_element(By.ID, 'layers-in-project-list') | ||
348 | layers_list_items = layers_list.find_elements(By.TAG_NAME, 'li') | ||
349 | self.assertTrue( | ||
350 | 'meta-fake' in str(layers_list_items[-1].text) | ||
351 | ) | ||