Last active
July 21, 2016 12:39
-
-
Save yannis/4665021 to your computer and use it in GitHub Desktop.
Chose an option from a select2.js dropdown menu in cucumber
This file contains hidden or 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
When /^I chose "(.*?)" in the "(.*?)" select2 menu$/ do |value, placeholder| | |
container = page.find('.select2-container', text: placeholder) | |
container.find('a.select2-choice').click | |
input = container.find("input[type='text']") | |
input.set(value) | |
sleep 1 | |
li = container.find('li', text: value) | |
li.click | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment