From adb7efe522074f8deb8d422fdfb288b34bf831f6 Mon Sep 17 00:00:00 2001 From: Alassane Yattara Date: Fri, 15 Dec 2023 12:56:52 +0100 Subject: bitbake: toaster/tests: bug-fix element click intercepted in browser/test_layerdetails_page.py selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted (Bitbake rev: d1936616cafc1aced69c7b5758e44638eb62b5ac) Signed-off-by: Alassane Yattara Signed-off-by: Richard Purdie --- bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bitbake/lib/toaster/tests/browser/selenium_helpers_base.py') diff --git a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py index 5d0489bb4e..13806624f3 100644 --- a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py +++ b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py @@ -21,6 +21,7 @@ import unittest import pytest from selenium import webdriver +from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.common.desired_capabilities import DesiredCapabilities @@ -215,6 +216,19 @@ class SeleniumTestCaseBase(unittest.TestCase): time.sleep(poll) # wait for visibility to settle return self.find(selector) + def wait_until_clickable(self, selector, poll=1): + """ Wait until element matching CSS selector is visible on the page """ + WebDriverWait( + self.driver, + Wait._TIMEOUT, + poll_frequency=poll + ).until( + EC.element_to_be_clickable((By.ID, selector.removeprefix('#') + ) + ) + ) + return self.find(selector) + def wait_until_focused(self, selector): """ Wait until element matching CSS selector has focus """ is_focused = \ -- cgit v1.2.3-54-g00ecf