diff options
author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-11-29 23:54:15 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-02 18:04:23 +0000 |
commit | eb2af42e0a82a671700ff087db37ca0ba219efaa (patch) | |
tree | 771862df98d0104bf65f47dd32e28b9989ee33e7 /bitbake/lib/toaster/tests | |
parent | 200541ec562910a583b2788fa27aba1ca7933112 (diff) | |
download | poky-eb2af42e0a82a671700ff087db37ca0ba219efaa.tar.gz |
bitbake: toaster/tests: Test single layer page
Test layer page
- Check if title is displayed
- Check add/remove layer button works
- Check tabs(layers, recipes, machines) are displayed
- Check left section is displayed
- Check layer name
- Check layer summary
- Check layer description
(Bitbake rev: 740b37cc077803f134391c99fc4cae45550020f3)
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/tests')
-rw-r--r-- | bitbake/lib/toaster/tests/functional/test_project_page.py | 61 |
1 files changed, 61 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 7082950986..771a848412 100644 --- a/bitbake/lib/toaster/tests/functional/test_project_page.py +++ b/bitbake/lib/toaster/tests/functional/test_project_page.py | |||
@@ -695,3 +695,64 @@ class TestProjectPage(SeleniumFunctionalTestCase): | |||
695 | table_selector='distrostable', | 695 | table_selector='distrostable', |
696 | to_skip=[150] | 696 | to_skip=[150] |
697 | ) | 697 | ) |
698 | |||
699 | def test_single_layer_page(self): | ||
700 | """ Test layer page | ||
701 | - Check if title is displayed | ||
702 | - Check add/remove layer button works | ||
703 | - Check tabs(layers, recipes, machines) are displayed | ||
704 | - Check left section is displayed | ||
705 | - Check layer name | ||
706 | - Check layer summary | ||
707 | - Check layer description | ||
708 | """ | ||
709 | url = reverse("layerdetails", args=(1, 8)) | ||
710 | self.get(url) | ||
711 | self.wait_until_visible('.page-header') | ||
712 | # check title is displayed | ||
713 | self.assertTrue(self.find('.page-header h1').is_displayed()) | ||
714 | |||
715 | # check add layer button works | ||
716 | remove_layer_btn = self.find('#add-remove-layer-btn') | ||
717 | remove_layer_btn.click() | ||
718 | self.wait_until_visible('#change-notification', poll=2) | ||
719 | change_notification = self.find('#change-notification') | ||
720 | self.assertTrue( | ||
721 | f'You have removed 1 layer from your project' in str(change_notification.text) | ||
722 | ) | ||
723 | # check add layer button works, 18 is the random layer id | ||
724 | add_layer_btn = self.find('#add-remove-layer-btn') | ||
725 | add_layer_btn.click() | ||
726 | self.wait_until_visible('#change-notification') | ||
727 | change_notification = self.find('#change-notification') | ||
728 | self.assertTrue( | ||
729 | f'You have added 1 layer to your project' in str(change_notification.text) | ||
730 | ) | ||
731 | # check tabs(layers, recipes, machines) are displayed | ||
732 | tabs = self.find_all('.nav-tabs li') | ||
733 | self.assertEqual(len(tabs), 3) | ||
734 | # Check first tab | ||
735 | tabs[0].click() | ||
736 | self.assertTrue( | ||
737 | 'active' in str(self.find('#information').get_attribute('class')) | ||
738 | ) | ||
739 | # Check second tab | ||
740 | tabs[1].click() | ||
741 | self.assertTrue( | ||
742 | 'active' in str(self.find('#recipes').get_attribute('class')) | ||
743 | ) | ||
744 | # Check third tab | ||
745 | tabs[2].click() | ||
746 | self.assertTrue( | ||
747 | 'active' in str(self.find('#machines').get_attribute('class')) | ||
748 | ) | ||
749 | # Check left section is displayed | ||
750 | section = self.find('.well') | ||
751 | # Check layer name | ||
752 | self.assertTrue( | ||
753 | section.find_element(By.XPATH, '//h2[1]').is_displayed() | ||
754 | ) | ||
755 | # Check layer summary | ||
756 | self.assertTrue("Summary" in section.text) | ||
757 | # Check layer description | ||
758 | self.assertTrue("Description" in section.text) | ||