Sha256: ce6753af28d953d612c75c3044b3a945a37ed5ef1f30a18fcd7f8c13756e7cea

Contents?: true

Size: 499 Bytes

Versions: 38

Compression:

Stored size: 499 Bytes

Contents

# frozen_string_literal: true

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

38 entries across 38 versions & 1 rubygems

Version Path
renalware-core-2.0.40 spec/support/select2_spec_helper.rb
renalware-core-2.0.39 spec/support/select2_spec_helper.rb
renalware-core-2.0.38 spec/support/select2_spec_helper.rb
renalware-core-2.0.37 spec/support/select2_spec_helper.rb
renalware-core-2.0.36 spec/support/select2_spec_helper.rb
renalware-core-2.0.35 spec/support/select2_spec_helper.rb
renalware-core-2.0.34 spec/support/select2_spec_helper.rb
renalware-core-2.0.33 spec/support/select2_spec_helper.rb
renalware-core-2.0.32 spec/support/select2_spec_helper.rb
renalware-core-2.0.31 spec/support/select2_spec_helper.rb
renalware-core-2.0.30 spec/support/select2_spec_helper.rb
renalware-core-2.0.28 spec/support/select2_spec_helper.rb
renalware-core-2.0.27 spec/support/select2_spec_helper.rb
renalware-core-2.0.26 spec/support/select2_spec_helper.rb
renalware-core-2.0.25 spec/support/select2_spec_helper.rb
renalware-core-2.0.24 spec/support/select2_spec_helper.rb
renalware-core-2.0.23 spec/support/select2_spec_helper.rb
renalware-core-2.0.22 spec/support/select2_spec_helper.rb
renalware-core-2.0.21 spec/support/select2_spec_helper.rb
renalware-core-2.0.20 spec/support/select2_spec_helper.rb