Sha256: 87809a0086e194c22accc54c0559566c59cbe8256e1bdff68f1138199b76d00a

Contents?: true

Size: 468 Bytes

Versions: 16

Compression:

Stored size: 468 Bytes

Contents

module Select2SpecHelper
  def select2(value, opts)
    scope = opts[:from]
    select2_container = first("#{scope} + .select2-container")
    select2_container.first(".select2-selection").click

    first("input.select2-search__field").set(value)
    page.execute_script(%|$("#{scope} ~ input.select2-search__field:visible").keyup();|)
    body = find(:xpath, "//body")
    matches = body.find_all(".select2-results li", text: value)
    matches.last.click
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc11 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.rc10 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.rc9 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.rc8 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.rc7 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.rc6 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.rc5 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.rc4 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.rc3 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.rc1 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.beta12 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.beta11 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.beta10 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.beta9 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.beta8 spec/support/select2_spec_helper.rb
renalware-core-2.0.0.pre.beta7 spec/support/select2_spec_helper.rb