]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster-tests: make helper click on input before entering text
authorElliot Smith <elliot.smith@intel.com>
Tue, 19 Apr 2016 16:28:44 +0000 (17:28 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 Apr 2016 20:10:58 +0000 (21:10 +0100)
The Selenium helper's enter_text() method doesn't cause
keyup events to trigger unless the element where text is
being entered has been clicked.

Prefix all text entry with a click() on the element to ensure
that keyup events fire.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/tests/browser/selenium_helpers.py

index d3ab3ca72e1d445b5cefa8b8c06aa198cb58588e..56dbe2b3445952ebb16409dce5fa21a149aea0f5 100644 (file)
@@ -185,7 +185,11 @@ class SeleniumTestCase(StaticLiveServerTestCase):
 
     def enter_text(self, selector, value):
         """ Insert text into element matching selector """
-        field = self.wait_until_present(selector)
+        # note that keyup events don't occur until the element is clicked
+        # (in the case of <input type="text"...>, for example), so simulate
+        # user clicking the element before inserting text into it
+        field = self.click(selector)
+
         field.send_keys(value)
         return field