summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-21 12:40:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-21 15:35:49 +0100
commitb88519519fc59298ba6905453cb34d19b26ab794 (patch)
treec7850bf12b0c5945dc0a140749f25efbb1f957fe /bitbake/lib/toaster
parent5049bc18a8fe96ff388606471fa36761468fdd0e (diff)
downloadpoky-master.tar.gz
bitbake: toaster/tests: Fix automated testing failuresHEADmaster
The display window scrolling mechanism we were using was failing in one case and needed in another. After trying various approaches, this one with window.scrollTo seems to work and fixes the test failures. (Bitbake rev: f1175778108a559e1dd0d55cb68f42816c86f393) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r--bitbake/lib/toaster/tests/browser/test_layerdetails_page.py2
-rw-r--r--bitbake/lib/toaster/tests/functional/test_project_page.py8
2 files changed, 6 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
index 69493833f4..6abfdef699 100644
--- a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
+++ b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
@@ -108,6 +108,8 @@ class TestLayerDetailsPage(SeleniumTestCase):
108 save_btn.click() 108 save_btn.click()
109 109
110 self.wait_until_visible("#save-changes-for-switch") 110 self.wait_until_visible("#save-changes-for-switch")
111 # Ensure scrolled into view
112 self.driver.execute_script('window.scrollTo({behavior: "instant", top: 0, left: 0})')
111 btn_save_chg_for_switch = self.wait_until_clickable( 113 btn_save_chg_for_switch = self.wait_until_clickable(
112 "#save-changes-for-switch") 114 "#save-changes-for-switch")
113 btn_save_chg_for_switch.click() 115 btn_save_chg_for_switch.click()
diff --git a/bitbake/lib/toaster/tests/functional/test_project_page.py b/bitbake/lib/toaster/tests/functional/test_project_page.py
index c6dad0eb5d..429d86feba 100644
--- a/bitbake/lib/toaster/tests/functional/test_project_page.py
+++ b/bitbake/lib/toaster/tests/functional/test_project_page.py
@@ -685,17 +685,17 @@ class TestProjectPage(TestProjectPageBase):
685 'active', str(self.find('#information').get_attribute('class')) 685 'active', str(self.find('#information').get_attribute('class'))
686 ) 686 )
687 # Check second tab (recipes) 687 # Check second tab (recipes)
688 # Ensure page is scrolled to the top
689 self.driver.find_element(By.XPATH, '//body').send_keys(Keys.CONTROL + Keys.HOME)
690 self.wait_until_visible('.nav-tabs') 688 self.wait_until_visible('.nav-tabs')
689 # Ensure page is scrolled to the top
690 self.driver.execute_script('window.scrollTo({behavior: "instant", top: 0, left: 0})')
691 tabs[1].click() 691 tabs[1].click()
692 self.assertIn( 692 self.assertIn(
693 'active', str(self.find('#recipes').get_attribute('class')) 693 'active', str(self.find('#recipes').get_attribute('class'))
694 ) 694 )
695 # Check third tab (machines) 695 # Check third tab (machines)
696 # Ensure page is scrolled to the top
697 self.driver.find_element(By.XPATH, '//body').send_keys(Keys.CONTROL + Keys.HOME)
698 self.wait_until_visible('.nav-tabs') 696 self.wait_until_visible('.nav-tabs')
697 # Ensure page is scrolled to the top
698 self.driver.execute_script('window.scrollTo({behavior: "instant", top: 0, left: 0})')
699 tabs[2].click() 699 tabs[2].click()
700 self.assertIn( 700 self.assertIn(
701 'active', str(self.find('#machines').get_attribute('class')) 701 'active', str(self.find('#machines').get_attribute('class'))