Module: Steak::Autocomplete

Defined in:
lib/steak/autocomplete.rb

Instance Method Summary collapse

Instance Method Details

#choose_autocomplete_result(text, input_id = "input[data-autocomplete]") ⇒ Object



3
4
5
6
7
8
# File 'lib/steak/autocomplete.rb', line 3

def choose_autocomplete_result(text, input_id="input[data-autocomplete]")
  page.execute_script %Q{ $('#{input_id}').trigger("focus") }
  page.execute_script %Q{ $('#{input_id}').trigger("keydown") }
  sleep 1
  page.execute_script %Q{ $('.ui-menu-item a:contains("#{text}")').trigger("mouseenter").trigger("click"); }
end