Sha256: 235e30ac55606d6c91483f88f6e405bfcf7a9972ef7c3a28ac566110d7a73610

Contents?: true

Size: 529 Bytes

Versions: 27

Compression:

Stored size: 529 Bytes

Contents

module AutocompleteHelpers
  def fill_autocomplete(form, field, options = {})
    fill_in field, with: options[:with]

    page.execute_script " $('#{form}').find('[name=#{field}]').trigger('focus') "
    page.execute_script " $('#{form}').find('[name=#{field}]').trigger('keydown') "
    selector = %Q{ul.ui-autocomplete li.ui-menu-item:contains("#{options[:select]}")}

    expect(page).to have_selector("ul.ui-autocomplete li.ui-menu-item")
    page.execute_script " $('#{selector}').trigger('mouseenter').click() "
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc7 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.rc6 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.rc5 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.rc4 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.rc3 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.rc1 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.beta12 lib/test_support/autocomplete_helpers.rb