From d0c0c00f6cc693a70ba4cb1e0834a1f75a7fef75 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 18 Oct 2024 22:33:47 +0100 Subject: bitbake: toaster/tests/browser/helpers: Add not visible wait function In some cases we want to wait until some element is not visible. Add such a function helper. (Bitbake rev: cede6519d25112037264550126b109903220b58c) Signed-off-by: Richard Purdie --- bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | 7 +++++++ 1 file changed, 7 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 5a4a4ef8b4..b664166055 100644 --- a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py +++ b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py @@ -227,6 +227,13 @@ class SeleniumTestCaseBase(unittest.TestCase): Wait(self.driver, poll=poll).until(is_visible, msg) return self.find(selector) + def wait_until_not_visible(self, selector, timeout=Wait._TIMEOUT): + """ Wait until element matching CSS selector is not visible on the page """ + is_visible = lambda driver: self.find(selector).is_displayed() + msg = 'An element matching "%s" should be visible' % selector + Wait(self.driver, timeout=timeout).until_not(is_visible, msg) + return self.find(selector) + def wait_until_clickable(self, selector, poll=1): """ Wait until element matching CSS selector is visible on the page """ sel = selector -- cgit v1.2.3-54-g00ecf