diff options
author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-12-15 12:56:52 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-15 14:37:28 +0000 |
commit | adb7efe522074f8deb8d422fdfb288b34bf831f6 (patch) | |
tree | 87437f523416359c408342634c70e17fb80a4350 /bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | |
parent | 81a0110ca532fb4f60b3ea4cd6a977e9c967ac62 (diff) | |
download | poky-adb7efe522074f8deb8d422fdfb288b34bf831f6.tar.gz |
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 <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/tests/browser/selenium_helpers_base.py')
-rw-r--r-- | bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | 14 |
1 files changed, 14 insertions, 0 deletions
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 | |||
21 | 21 | ||
22 | import pytest | 22 | import pytest |
23 | from selenium import webdriver | 23 | from selenium import webdriver |
24 | from selenium.webdriver.support import expected_conditions as EC | ||
24 | from selenium.webdriver.support.ui import WebDriverWait | 25 | from selenium.webdriver.support.ui import WebDriverWait |
25 | from selenium.webdriver.common.by import By | 26 | from selenium.webdriver.common.by import By |
26 | from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | 27 | from selenium.webdriver.common.desired_capabilities import DesiredCapabilities |
@@ -215,6 +216,19 @@ class SeleniumTestCaseBase(unittest.TestCase): | |||
215 | time.sleep(poll) # wait for visibility to settle | 216 | time.sleep(poll) # wait for visibility to settle |
216 | return self.find(selector) | 217 | return self.find(selector) |
217 | 218 | ||
219 | def wait_until_clickable(self, selector, poll=1): | ||
220 | """ Wait until element matching CSS selector is visible on the page """ | ||
221 | WebDriverWait( | ||
222 | self.driver, | ||
223 | Wait._TIMEOUT, | ||
224 | poll_frequency=poll | ||
225 | ).until( | ||
226 | EC.element_to_be_clickable((By.ID, selector.removeprefix('#') | ||
227 | ) | ||
228 | ) | ||
229 | ) | ||
230 | return self.find(selector) | ||
231 | |||
218 | def wait_until_focused(self, selector): | 232 | def wait_until_focused(self, selector): |
219 | """ Wait until element matching CSS selector has focus """ | 233 | """ Wait until element matching CSS selector has focus """ |
220 | is_focused = \ | 234 | is_focused = \ |