[oe-commits] [bitbake] 07/10: toaster-tests: make helper click on input before entering text

git at git.openembedded.org git at git.openembedded.org
Tue Apr 19 20:13:42 UTC 2016


rpurdie pushed a commit to branch 1.30
in repository bitbake.

commit cea34880ad3847bd0e24c9b650eb816e1757cf2b
Author: Elliot Smith <elliot.smith at intel.com>
AuthorDate: Tue Apr 19 17:28:44 2016 +0100

    toaster-tests: make helper click on input before entering text
    
    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 at intel.com>
    Signed-off-by: Michael Wood <michael.g.wood at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/toaster/tests/browser/selenium_helpers.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/toaster/tests/browser/selenium_helpers.py b/lib/toaster/tests/browser/selenium_helpers.py
index d3ab3ca..56dbe2b 100644
--- a/lib/toaster/tests/browser/selenium_helpers.py
+++ b/lib/toaster/tests/browser/selenium_helpers.py
@@ -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
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list