Skip to content

Commit

Permalink
Merge branch 'master' into faceted_tracksel
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed May 18, 2012
2 parents 8b2aa8b + 72f8182 commit 2f6d352
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/selenium_tests/jbrowse_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ def setUp( self ):

## convenience methods for us

def maybe_find_element_by_xpath( self, xpathExpression ):
try:
el = self.browser.find_element_by_xpath( xpathExpression )
except NoSuchElementException:
return None
return el

def assert_element( self, xpathExpression ):
try:
el = self.browser.find_element_by_xpath( xpathExpression )
Expand Down Expand Up @@ -100,17 +107,19 @@ def trackpane_rubberband( self, start_pct, end_pct ):
"""Executes a rubberband gesture from start_pct to end_pct in the main track pane"""
self._rubberband( "//div[contains(@class,'dragWindow')]", start_pct, end_pct, Keys.SHIFT )

def is_track_on( self, tracktext ):
# find the track label
return not self.maybe_find_element_by_xpath( "//div[@class='tracklist-label'][contains(.,'%s')]" % tracktext )

def turn_on_track( self, tracktext ):

# find the track label
tracklabel = self.assert_element( "//div[@class='tracklist-label'][contains(.,'%s')]" % tracktext )
dragpane = self.assert_element( "//div[contains(@class, 'trackContainer')]" )

# drag the track label over
self.actionchains() \
.move_to_element( tracklabel ) \
.click_and_hold( None ) \
.move_by_offset( 300, 50 ) \
.release( None ) \
.drag_and_drop( tracklabel, dragpane ) \
.perform()

self.assert_no_js_errors()
Expand Down
2 changes: 2 additions & 0 deletions tests/selenium_tests/yeast_biodb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def test_yeast( self ):

def sequence( self ):
self.do_typed_query( 'chrII:296318..296400' );
if not self.is_track_on('DNA'):
self.turn_on_track( 'DNA' );
sequence_div_xpath_templ = "/html//div[contains(@class,'sequence')][contains(.,'%s')]"
sequence_div_xpath_1 = sequence_div_xpath_templ % 'TATATGGTCTT';
self.assert_element( sequence_div_xpath_1)
Expand Down

0 comments on commit 2f6d352

Please sign in to comment.