Sha256: a93b01de19707b51167f140b68c1dcb1405566968d42d6f6a724438bec618663

Contents?: true

Size: 535 Bytes

Versions: 8

Compression:

Stored size: 535 Bytes

Contents

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

    page.execute_script %Q{ $('#{form}').find('[name=#{field}]').trigger('focus') }
    page.execute_script %Q{ $('#{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 %Q{ $('#{selector}').trigger('mouseenter').click() }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta11 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.beta10 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.beta9 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.beta8 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.beta7 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.beta6 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.beta5 lib/test_support/autocomplete_helpers.rb
renalware-core-2.0.0.pre.beta4 lib/test_support/autocomplete_helpers.rb