capybara_select2 | Capybara helpers for https : //select2.org select box | Functional Testing library
kandi X-RAY | capybara_select2 Summary
kandi X-RAY | capybara_select2 Summary
Capybara helpers for select box (supports Select2 version 2/3/4)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of capybara_select2
capybara_select2 Key Features
capybara_select2 Examples and Code Snippets
select2 'Buy Milk', from: 'Todo'
select2 'Buy Milk', css: '#todo'
select2 'Buy Milk', xpath: '//div[@id="todo"]'
select2 'Buy Milk', 'Go to gym', from: 'Todo'
select2 'Buy Milk', from: 'Todo', search: true
select2 'Buy Milk', from: 'Todo', search:
group :test do
gem 'capybara-select-2'
end
$ bundle
$ gem install capybara-select-2
# application_system_test_case.rb
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
include CapybaraSelect2
include CapybaraSelect2::Helpers # if need specific helpers
end
Community Discussions
Trending Discussions on capybara_select2
QUESTION
I have a select2 v4 that loads options through AJAX. I am running a Cucumber test where I need to select 2 options of the list, but I can't seem to make the list open up and load (which normally gets populated when I type 2 or characters).
I have tried:
As suggested here:
...ANSWER
Answered 2019-Mar-13 at 17:40The poltergeist driver is roughly equivalent to a 7 year old version of Safari which means it doesn't support a lot of current JS/CSS. This means your issue could simply be that select2 is no longer compatible with Poltergeist (without a lot of polyfilling). You're going to be much better off updating to using a real browser (stable - chrome via selenium, etc) or one of the direct to Chrome drivers (highly beta) that have spun off Poltergeist (Apparition is one of them). Those will allow you to run with a visible browser (useful for debugging) or headless.
The following code uses Chrome via selenium and interacts with the select2 demo site to select an entry that is loaded via Ajax.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install capybara_select2
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page