Skip to content

Instantly share code, notes, and snippets.

@kumavis
Created February 13, 2013 21:22
Show Gist options
  • Save kumavis/4948438 to your computer and use it in GitHub Desktop.
Save kumavis/4948438 to your computer and use it in GitHub Desktop.
Helpers.Velcro =
getSelection: ($elem) ->
$elem.find('.selectedOption').text().trim()
hasSelection: ($elem) ->
not Helpers.Velcro.getSelection($elem).contains("Select")
selectRandomOption: ($elem, continueTesting) ->
$elem.find('.velcro-dropdown').click()
Helpers.afterDomUpdate ->
options = $elem.find('.results .option')
targetOption = Helpers.randomSelection( options )
targetOption.click()
Helpers.afterDomUpdate ->
# continue testing http://bit.ly/X4kWUv
continueTesting( targetOption )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment