-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make a driver system for integration testing track selection
- Loading branch information
Showing
2 changed files
with
48 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class SimpleTrackSelector (object): | ||
|
||
def __init__(self, browser): | ||
self.browser = browser | ||
|
||
def turn_on_track( self, tracktext ): | ||
|
||
# find the track label | ||
tracklabel = self.browser.assert_element( "//div[@class='tracklist-label'][contains(.,'%s')]" % tracktext ) | ||
dragpane = self.browser.assert_element( "//div[contains(@class, 'trackContainer')]" ) | ||
|
||
# drag the track label over | ||
self.browser.actionchains() \ | ||
.drag_and_drop( tracklabel, dragpane ) \ | ||
.perform() | ||
|
||
self.browser.assert_no_js_errors() | ||
|
||
def turn_off_track( self, tracktext ): | ||
|
||
# drag the track back into the track list | ||
track_handle = self.browser.assert_element( "/html//div[contains(@class,'track')]//div[contains(@class,'track-label')][contains(.,'%s')]" % tracktext ) | ||
track_list = self.browser.assert_element( "/html//div[@id='tracksAvail']" ) | ||
|
||
self.browser.actionchains() \ | ||
.drag_and_drop( track_handle, track_list ) \ | ||
.perform() | ||
|
||
self.browser.assert_no_js_errors() | ||
|
||
|