diff options
Diffstat (limited to 'bitbake/lib/toaster/tests/browser/selenium_helpers.py')
-rw-r--r-- | bitbake/lib/toaster/tests/browser/selenium_helpers.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/tests/browser/selenium_helpers.py b/bitbake/lib/toaster/tests/browser/selenium_helpers.py index 54db2e8cf2..be1f037825 100644 --- a/bitbake/lib/toaster/tests/browser/selenium_helpers.py +++ b/bitbake/lib/toaster/tests/browser/selenium_helpers.py | |||
@@ -158,6 +158,13 @@ class SeleniumTestCase(StaticLiveServerTestCase): | |||
158 | """ Find all elements matching CSS selector """ | 158 | """ Find all elements matching CSS selector """ |
159 | return self.driver.find_elements_by_css_selector(selector) | 159 | return self.driver.find_elements_by_css_selector(selector) |
160 | 160 | ||
161 | def element_exists(self, selector): | ||
162 | """ | ||
163 | Return True if one element matching selector exists, | ||
164 | False otherwise | ||
165 | """ | ||
166 | return len(self.find_all(selector)) == 1 | ||
167 | |||
161 | def focused_element(self): | 168 | def focused_element(self): |
162 | """ Return the element which currently has focus on the page """ | 169 | """ Return the element which currently has focus on the page """ |
163 | return self.driver.switch_to.active_element | 170 | return self.driver.switch_to.active_element |