Then(/^the swagger autocomplete should work for "(.*?)" with "(.*?)"$/) do |input_name, autocomplete|
  click_on 'get'
  assert_equal 1, evaluate_script("$('input[name=#{input_name}]').focus().length")
  assert_equal 1, evaluate_script("$('.apidocs-param-tips.#{autocomplete}:visible').length")
end


Then 'I fill in the API JSON Spec with:' do |spec|
  page.evaluate_script <<-JS
    document.querySelector('textarea#api_docs_service_body ~ .CodeMirror').CodeMirror.setValue(#{spec.inspect})
  JS
end
