| | 31 | * Autocomplete is fiddly to test as need to trigger specific events: |
| | 32 | {{{ |
| | 33 | # Enter the search String |
| | 34 | sel.type("gis_location_autocomplete", "SearchString") |
| | 35 | # Trigger the event to get the AJAX to send |
| | 36 | sel.fire_event("gis_location_autocomplete", "keydown") |
| | 37 | # Wait for the popup menu |
| | 38 | for i in range(60): |
| | 39 | try: |
| | 40 | if "SearchString" == sel.get_text("css=ul.ui-autocomplete li:first-child a"): |
| | 41 | break |
| | 42 | except: |
| | 43 | pass |
| | 44 | time.sleep(1) |
| | 45 | else: |
| | 46 | self.fail("time out") |
| | 47 | # Select the Result |
| | 48 | sel.fire_event("css=ul.ui-autocomplete li:first-child a", "mouseover") |
| | 49 | sel.click("css=ul.ui-autocomplete li:first-child a") |
| | 50 | time.sleep(4) |
| | 51 | }}} |