Skip to content

Commit

Permalink
make selenium tests send keys to the location box one at a time, appa…
Browse files Browse the repository at this point in the history
…rently the dojo combobox does not like it when selenium blats multiple letters at a time into the input field.
  • Loading branch information
rbuels committed Jun 1, 2012
1 parent fa9b059 commit 0e85787
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/selenium_tests/jbrowse_selenium/JBrowseTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ def assert_no_js_errors( self ):
def do_typed_query( self, text ):
# Find the query box and put f15 into it and hit enter
qbox = self.browser.find_element_by_id("location")
qbox.clear()
qbox.send_keys( text + Keys.RETURN )
time.sleep( 0.2 )
qbox.send_keys( Keys.BACK_SPACE * 40 )
time.sleep( 0.05 )
for i in range( len(text) ):
qbox.send_keys( text[i] )
qbox.send_keys( Keys.RETURN );
time.sleep( 0.1 )

def _rubberband( self, el_xpath, start_pct, end_pct, modkey = None ):
el = self.assert_element( el_xpath )
Expand Down Expand Up @@ -141,8 +144,7 @@ def get_track_labels_containing( self, string ):
return self.assert_elements( "//div[contains(@class,'track-label')][contains(.,'%s')]" % string )

def select_refseq( self, name ):
refseq_selector = Select( self.browser.find_element_by_id('chrom') )
refseq_selector.select_by_value( name )
self.do_typed_query( name );

def scroll( self ):
move_right_button = self.browser.find_element_by_id('moveRight')
Expand Down

0 comments on commit 0e85787

Please sign in to comment.