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.16 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.15 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.14 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.13 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.12 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.11 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.9 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.8 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.7 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.5 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.4 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.3 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.2 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.1 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.rc13 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.rc11 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.rc10 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.rc9 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.rc8 lib/test_support/autocomplete_helpers.rb