diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-04 15:42:15 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-09 18:25:34 +0100 |
| commit | d5c507688927c7f38cc634e25caa33dbc769828c (patch) | |
| tree | 26bac7f19c8c6f5fceb26740041ad2f380b09c1a /bitbake/lib/toaster/tests | |
| parent | b425ab56d3ce3f83d46c7c9bca66c2999895537c (diff) | |
| download | poky-d5c507688927c7f38cc634e25caa33dbc769828c.tar.gz | |
bitbake: toaster/tests/functional: Fix later details page test issues
Consistently use meta-poky as the test target, instead of a magic number
ID which can vary.
Fix incorrect comments.
Also ensure the viewport is scrolled to the top when changing tabs.
This breaks if other layers are selected like openembedded-core due
to the number of recipes.
(Bitbake rev: 0bcb7b4a8d8e89647aa6179cc61e5eb55d433585)
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 | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/bitbake/lib/toaster/tests/functional/test_project_page.py b/bitbake/lib/toaster/tests/functional/test_project_page.py index deb26812ea..6b6d45eaba 100644 --- a/bitbake/lib/toaster/tests/functional/test_project_page.py +++ b/bitbake/lib/toaster/tests/functional/test_project_page.py | |||
| @@ -699,7 +699,7 @@ class TestProjectPage(SeleniumFunctionalTestCase): | |||
| 699 | ) | 699 | ) |
| 700 | 700 | ||
| 701 | def test_single_layer_page(self): | 701 | def test_single_layer_page(self): |
| 702 | """ Test layer page | 702 | """ Test layer details page using meta-poky as an example (assumes is added to start with) |
| 703 | - Check if title is displayed | 703 | - Check if title is displayed |
| 704 | - Check add/remove layer button works | 704 | - Check add/remove layer button works |
| 705 | - Check tabs(layers, recipes, machines) are displayed | 705 | - Check tabs(layers, recipes, machines) are displayed |
| @@ -708,13 +708,14 @@ class TestProjectPage(SeleniumFunctionalTestCase): | |||
| 708 | - Check layer summary | 708 | - Check layer summary |
| 709 | - Check layer description | 709 | - Check layer description |
| 710 | """ | 710 | """ |
| 711 | url = reverse("layerdetails", args=(TestProjectPage.project_id, 7)) | 711 | self._navigate_to_config_nav('layerstable', 6) |
| 712 | self.get(url) | 712 | layer_link = self.driver.find_element(By.XPATH, '//tr/td[@class="layer__name"]/a[contains(text(),"meta-poky")]') |
| 713 | layer_link.click() | ||
| 713 | self.wait_until_visible('.page-header') | 714 | self.wait_until_visible('.page-header') |
| 714 | # check title is displayed | 715 | # check title is displayed |
| 715 | self.assertTrue(self.find('.page-header h1').is_displayed()) | 716 | self.assertTrue(self.find('.page-header h1').is_displayed()) |
| 716 | 717 | ||
| 717 | # check add layer button works | 718 | # check remove layer button works |
| 718 | remove_layer_btn = self.find('#add-remove-layer-btn') | 719 | remove_layer_btn = self.find('#add-remove-layer-btn') |
| 719 | remove_layer_btn.click() | 720 | remove_layer_btn.click() |
| 720 | self.wait_until_visible('#change-notification', poll=2) | 721 | self.wait_until_visible('#change-notification', poll=2) |
| @@ -722,7 +723,7 @@ class TestProjectPage(SeleniumFunctionalTestCase): | |||
| 722 | self.assertIn( | 723 | self.assertIn( |
| 723 | f'You have removed 1 layer from your project', str(change_notification.text) | 724 | f'You have removed 1 layer from your project', str(change_notification.text) |
| 724 | ) | 725 | ) |
| 725 | # check add layer button works, 18 is the random layer id | 726 | # check add layer button works |
| 726 | add_layer_btn = self.find('#add-remove-layer-btn') | 727 | add_layer_btn = self.find('#add-remove-layer-btn') |
| 727 | add_layer_btn.click() | 728 | add_layer_btn.click() |
| 728 | self.wait_until_visible('#change-notification') | 729 | self.wait_until_visible('#change-notification') |
| @@ -738,12 +739,18 @@ class TestProjectPage(SeleniumFunctionalTestCase): | |||
| 738 | self.assertTrue( | 739 | self.assertTrue( |
| 739 | 'active' in str(self.find('#information').get_attribute('class')) | 740 | 'active' in str(self.find('#information').get_attribute('class')) |
| 740 | ) | 741 | ) |
| 741 | # Check second tab | 742 | # Check second tab (recipes) |
| 743 | # Ensure page is scrolled to the top | ||
| 744 | self.driver.find_element(By.XPATH, '//body').send_keys(Keys.CONTROL + Keys.HOME) | ||
| 745 | self.wait_until_visible('.nav-tabs') | ||
| 742 | tabs[1].click() | 746 | tabs[1].click() |
| 743 | self.assertTrue( | 747 | self.assertTrue( |
| 744 | 'active' in str(self.find('#recipes').get_attribute('class')) | 748 | 'active' in str(self.find('#recipes').get_attribute('class')) |
| 745 | ) | 749 | ) |
| 746 | # Check third tab | 750 | # Check third tab (machines) |
| 751 | # Ensure page is scrolled to the top | ||
| 752 | self.driver.find_element(By.XPATH, '//body').send_keys(Keys.CONTROL + Keys.HOME) | ||
| 753 | self.wait_until_visible('.nav-tabs') | ||
| 747 | tabs[2].click() | 754 | tabs[2].click() |
| 748 | self.assertTrue( | 755 | self.assertTrue( |
| 749 | 'active' in str(self.find('#machines').get_attribute('class')) | 756 | 'active' in str(self.find('#machines').get_attribute('class')) |
