Sha256: 85596ab9b78f3a14811aed2bfa240b1438886d2eb226a49eae50dbd92c6e539c
Contents?: true
Size: 709 Bytes
Versions: 5
Compression:
Stored size: 709 Bytes
Contents
# frozen_string_literal: true module Capybara module Select2 def select2(value, from:) expect(page).to have_xpath("//select[@id='#{from}']/..") select2_container = find(:xpath, "//select[@id='#{from}']/..") expect(select2_container).to have_selector(".select2-selection") select2_container.find(".select2-selection").click expect(page).to have_no_content("Searching...") body = find(:xpath, "//body") expect(body).to have_selector(".select2-dropdown li.select2-results__option", text: value) body.find(".select2-dropdown li.select2-results__option", text: value).click expect(page).to have_select(from, with_options: [value]) end end end
Version data entries
5 entries across 5 versions & 1 rubygems