diff options
| author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-11-21 14:51:31 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-23 12:06:06 +0000 |
| commit | 742323caf35765fae3a389fa921f4761a1c4ecff (patch) | |
| tree | 905a5b54e267be180691d8af128aa39b4dee9ad9 /bitbake/lib | |
| parent | 105f5a8d0d97836a699d096df0bc17a21f686e78 (diff) | |
| download | poky-742323caf35765fae3a389fa921f4761a1c4ecff.tar.gz | |
bitbake: toaster/tests: Add UI TestCase - Test the show rows feature in image recipe
Test the show rows feature in image recipe table on project page
(Bitbake rev: 0afbce01f8b037adb9311f63dcb63a2d180a5373)
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py | 36 |
1 files changed, 35 insertions, 1 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 2dfc120d83..23012d7865 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 | |||
| @@ -347,7 +347,10 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): | |||
| 347 | By.XPATH, '//*[@id="project-page"]/div[1]/div[3]') | 347 | By.XPATH, '//*[@id="project-page"]/div[1]/div[3]') |
| 348 | recipe_list = most_built_recipes.find_element(By.ID, 'freq-build-list') | 348 | recipe_list = most_built_recipes.find_element(By.ID, 'freq-build-list') |
| 349 | recipe_list_items = recipe_list.find_elements(By.TAG_NAME, 'li') | 349 | recipe_list_items = recipe_list.find_elements(By.TAG_NAME, 'li') |
| 350 | self.assertTrue(len(recipe_list_items) > 0) | 350 | self.assertTrue( |
| 351 | len(recipe_list_items) > 0, | ||
| 352 | msg="No recipes found in the most built recipes list", | ||
| 353 | ) | ||
| 351 | checkbox = recipe_list_items[0].find_element(By.TAG_NAME, 'input') | 354 | checkbox = recipe_list_items[0].find_element(By.TAG_NAME, 'input') |
| 352 | checkbox.click() | 355 | checkbox.click() |
| 353 | build_btn = self.find('#freq-build-btn') | 356 | build_btn = self.find('#freq-build-btn') |
| @@ -465,6 +468,7 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): | |||
| 465 | recipe_input = self.find('#search-input-imagerecipestable') | 468 | recipe_input = self.find('#search-input-imagerecipestable') |
| 466 | recipe_input.send_keys('core-image-minimal') | 469 | recipe_input.send_keys('core-image-minimal') |
| 467 | self.find('#search-submit-imagerecipestable').click() | 470 | self.find('#search-submit-imagerecipestable').click() |
| 471 | self.wait_until_visible('#imagerecipestable tbody tr') | ||
| 468 | rows = self.find_all('#imagerecipestable tbody tr') | 472 | rows = self.find_all('#imagerecipestable tbody tr') |
| 469 | self.assertTrue(len(rows) > 0) | 473 | self.assertTrue(len(rows) > 0) |
| 470 | 474 | ||
| @@ -542,3 +546,33 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): | |||
| 542 | test_edit_column('checkbox-recipe-file') | 546 | test_edit_column('checkbox-recipe-file') |
| 543 | test_edit_column('checkbox-section') | 547 | test_edit_column('checkbox-section') |
| 544 | test_edit_column('checkbox-version') | 548 | test_edit_column('checkbox-version') |
| 549 | |||
| 550 | def test_image_recipe_show_rows(self): | ||
| 551 | """ Test the show rows feature in image recipe table on project page """ | ||
| 552 | self._get_create_builds(success=100, failure=100) | ||
| 553 | |||
| 554 | def test_show_rows(row_to_show, show_row_link): | ||
| 555 | # Check that we can show rows == row_to_show | ||
| 556 | show_row_link.select_by_value(str(row_to_show)) | ||
| 557 | self.wait_until_present('#imagerecipestable tbody tr') | ||
| 558 | sleep(1) | ||
| 559 | self.assertTrue( | ||
| 560 | len(self.find_all('#imagerecipestable tbody tr')) == row_to_show | ||
| 561 | ) | ||
| 562 | |||
| 563 | url = reverse('projectimagerecipes', args=(2,)) | ||
| 564 | self.get(url) | ||
| 565 | self.wait_until_present('#imagerecipestable tbody tr') | ||
| 566 | |||
| 567 | show_rows = self.driver.find_elements( | ||
| 568 | By.XPATH, | ||
| 569 | '//select[@class="form-control pagesize-imagerecipestable"]' | ||
| 570 | ) | ||
| 571 | # Check show rows | ||
| 572 | for show_row_link in show_rows: | ||
| 573 | show_row_link = Select(show_row_link) | ||
| 574 | test_show_rows(10, show_row_link) | ||
| 575 | test_show_rows(25, show_row_link) | ||
| 576 | test_show_rows(50, show_row_link) | ||
| 577 | test_show_rows(100, show_row_link) | ||
| 578 | test_show_rows(150, show_row_link) | ||
