Sha256: e96240b9dbcbd2aa11b4d4a7eb3f352642622f1e0e6dfdcbd0bb8a026de616ce

Contents?: true

Size: 667 Bytes

Versions: 48

Compression:

Stored size: 667 Bytes

Contents

module CapybaraSelect2
  def select2_search(id, query)
    find("##{id} + .select2-container").click
    find(".select2-search__field").set(query.to_s)
  end

  def select2(id, query, label = query)
    select2_search(id, query)
    find(".select2-results li", text: label.to_s).click
  end

  def select2_expect_have_result(id, query, label = query)
    select2_search(id, query)
    expect(page).to have_selector(".select2-results li", text: label.to_s)
  end

  def select2_expect_have_no_result(id, query, label = query)
    select2_search(id, query)
    expect(page).to have_no_selector(".select2-results li", text: label.to_s)
  end
end

World(CapybaraSelect2)

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
agilibox-2.0.0 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.11.0 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.10.5 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.10.2 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.10.1 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.10.0 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.20 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.19 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.18 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.17 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.16 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.15 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.14 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.13 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.12 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.11 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.10 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.9 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.8 lib/agilibox/cucumber_helpers/select2.rb
agilibox-1.9.7 lib/agilibox/cucumber_helpers/select2.rb