I got this cucumber sceanario:
When I fill in "End User" with "john"
Then wait
Then wait
When I click "John Doe"
Then show me the page
Step definitions:
Then /^wait$/ do
sleep 2
end
When /^(?:|I )click "([^"]*)"$/ do |selector|
find(":contains('#{selector}')").click
end
It passes but it doesn't select a user."End User" equals "john" in 'show me the page'.
I even can't get it to work in a javascript console. The following code does not select anything.
$(":contains('John Doe')").last().trigger('click')
# => [<a class="ui-corner-all" tabindex="-1"...
How can I script a autocomplete select? Be it in pure javascript or in cucumber.