diff options
| author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-11-29 23:54:12 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-02 18:04:23 +0000 |
| commit | 00fb8ffca382cab9f6f093a26c836564757dbe91 (patch) | |
| tree | 094f8a09324ec4e95dd5fde9acb392e0fd6ed2f3 /bitbake/lib/toaster | |
| parent | 9de0b70cc3072bb8e64e5bdf013166c8b163e6db (diff) | |
| download | poky-00fb8ffca382cab9f6f093a26c836564757dbe91.tar.gz | |
bitbake: toaster/tests: Added Layers page TestCase
Test layers page
- Check if title "Compatible layerss" is displayed
- Check search input
- Check "Add layer" button works
- Check "Remove layer" button works
- Check layers table feature(show/hide column, pagination)
(Bitbake rev: a7bdda5b31f95e39c70eefb8ddf0ec690b3786ef)
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.py | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/tests/functional/test_project_page.py b/bitbake/lib/toaster/tests/functional/test_project_page.py index 46a60c010c..47dec1d9e5 100644 --- a/bitbake/lib/toaster/tests/functional/test_project_page.py +++ b/bitbake/lib/toaster/tests/functional/test_project_page.py | |||
| @@ -572,3 +572,75 @@ class TestProjectPage(SeleniumFunctionalTestCase): | |||
| 572 | self._navigate_to_config_nav('machinestable', 5) | 572 | self._navigate_to_config_nav('machinestable', 5) |
| 573 | # check show rows(pagination) | 573 | # check show rows(pagination) |
| 574 | self._mixin_test_table_show_rows(table_selector='machinestable') | 574 | self._mixin_test_table_show_rows(table_selector='machinestable') |
| 575 | |||
| 576 | def test_layers_page(self): | ||
| 577 | """ Test layers page | ||
| 578 | - Check if title "Compatible layerss" is displayed | ||
| 579 | - Check search input | ||
| 580 | - Check "Add layer" button works | ||
| 581 | - Check "Remove layer" button works | ||
| 582 | - Check layers table feature(show/hide column, pagination) | ||
| 583 | """ | ||
| 584 | self._navigate_to_config_nav('layerstable', 6) | ||
| 585 | # check title "Compatible layers" is displayed | ||
| 586 | self.assertTrue("Compatible layers" in self.get_page_source()) | ||
| 587 | # Test search input | ||
| 588 | input_text='meta-tanowrt' | ||
| 589 | self._mixin_test_table_search_input( | ||
| 590 | input_selector='search-input-layerstable', | ||
| 591 | input_text=input_text, | ||
| 592 | searchBtn_selector='search-submit-layerstable', | ||
| 593 | table_selector='layerstable' | ||
| 594 | ) | ||
| 595 | # check "Add layer" button works | ||
| 596 | rows = self.find_all('#layerstable tbody tr') | ||
| 597 | layer_to_add = rows[0] | ||
| 598 | add_btn = layer_to_add.find_element( | ||
| 599 | By.XPATH, | ||
| 600 | '//td[@class="add-del-layers"]' | ||
| 601 | ) | ||
| 602 | add_btn.click() | ||
| 603 | # check modal is displayed | ||
| 604 | self.wait_until_visible('#dependencies-modal') | ||
| 605 | list_dependencies = self.find_all('#dependencies-list li') | ||
| 606 | # click on add-layers button | ||
| 607 | add_layers_btn = self.driver.find_element( | ||
| 608 | By.XPATH, | ||
| 609 | '//form[@id="dependencies-modal-form"]//button[@class="btn btn-primary"]' | ||
| 610 | ) | ||
| 611 | add_layers_btn.click() | ||
| 612 | self.wait_until_visible('#change-notification') | ||
| 613 | change_notification = self.find('#change-notification') | ||
| 614 | self.assertTrue( | ||
| 615 | f'You have added {len(list_dependencies)+1} layers to your project: {input_text} and its dependencies' in change_notification.text | ||
| 616 | ) | ||
| 617 | # check "Remove layer" button works | ||
| 618 | rows = self.find_all('#layerstable tbody tr') | ||
| 619 | layer_to_remove = rows[0] | ||
| 620 | remove_btn = layer_to_remove.find_element( | ||
| 621 | By.XPATH, | ||
| 622 | '//td[@class="add-del-layers"]' | ||
| 623 | ) | ||
| 624 | remove_btn.click() | ||
| 625 | self.wait_until_visible('#change-notification', poll=2) | ||
| 626 | change_notification = self.find('#change-notification') | ||
| 627 | self.assertTrue( | ||
| 628 | f'You have removed 1 layer from your project: {input_text}' in change_notification.text | ||
| 629 | ) | ||
| 630 | # check layers table feature(show/hide column, pagination) | ||
| 631 | self._navigate_to_config_nav('layerstable', 6) | ||
| 632 | column_list = [ | ||
| 633 | 'dependencies', | ||
| 634 | 'revision', | ||
| 635 | 'layer__vcs_url', | ||
| 636 | 'git_subdir', | ||
| 637 | 'layer__summary', | ||
| 638 | ] | ||
| 639 | self._mixin_test_table_edit_column( | ||
| 640 | 'layerstable', | ||
| 641 | 'edit-columns-button', | ||
| 642 | [f'checkbox-{column}' for column in column_list] | ||
| 643 | ) | ||
| 644 | self._navigate_to_config_nav('layerstable', 6) | ||
| 645 | # check show rows(pagination) | ||
| 646 | self._mixin_test_table_show_rows(table_selector='layerstable') | ||
