capybara-select-2 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +11 -3
- data/README.md +3 -1
- data/capybara_select2.gemspec +1 -0
- data/lib/capybara_select2/helpers.rb +6 -5
- data/lib/capybara_select2/utils.rb +1 -1
- data/lib/capybara_select2/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 708b9d0d575ee79bdee004f8c2e03206bdf64208
|
4
|
+
data.tar.gz: f6fdc06ba262c22e5b0a158cef9dd32dac54343c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0c3defb50c2ace12d153faf81293e590c55b6d8a8fb8a09d492ba2f0da056e15bcaad9994acc61ec6d360105ed532889d641b5fcce071a18679c1ef2ed4a4b8
|
7
|
+
data.tar.gz: 2e3d53bf184fbfdaa6bcd2afc0179c3ce167d147c4e89da35ae3e376a5d422bc7cdb5679137b2c2a3dafc9b50ae21a41dd53cb70b3125610c6692df156461234
|
data/.travis.yml
CHANGED
@@ -5,7 +5,10 @@ rvm:
|
|
5
5
|
- 2.4.2
|
6
6
|
before_install: gem install bundler -v 1.16.4
|
7
7
|
env:
|
8
|
-
|
8
|
+
global:
|
9
|
+
- MOZ_HEADLESS=1
|
10
|
+
- CC_TEST_REPORTER_ID=e82aca58fe4e7eae020799b830f8df7dd35ec67f7476078d4fe97ae884be8f84
|
11
|
+
- GECKODRIVER_VERSION=0.21.0
|
9
12
|
addons:
|
10
13
|
firefox: latest
|
11
14
|
apt:
|
@@ -15,9 +18,14 @@ addons:
|
|
15
18
|
- libqt5webkit5-dev
|
16
19
|
- qtdeclarative5-dev
|
17
20
|
before_install:
|
18
|
-
- export GECKODRIVER_VERSION=0.21.0
|
19
21
|
- wget https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz
|
20
22
|
- mkdir geckodriver
|
21
23
|
- tar -xzf geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz -C geckodriver
|
22
24
|
- export PATH=$PATH:$PWD/geckodriver
|
23
|
-
|
25
|
+
before_script:
|
26
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
27
|
+
- chmod +x ./cc-test-reporter
|
28
|
+
- ./cc-test-reporter before-build
|
29
|
+
script: COVERAGE=1 xvfb-run bundle exec rspec
|
30
|
+
after_script:
|
31
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# CapybaraSelect2 for select2 version 2/3/4
|
2
|
-
!!! CapybaraSelect2 detects version
|
2
|
+
!!! CapybaraSelect2 detects select2 version automatically
|
3
3
|
|
4
4
|
[![Build Status](https://travis-ci.org/Hirurg103/capybara_select2.svg?branch=master)](https://travis-ci.org/Hirurg103/capybara_select2)
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/28e692c7efa07aadbe98/maintainability)](https://codeclimate.com/github/Hirurg103/capybara_select2/maintainability)
|
6
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/28e692c7efa07aadbe98/test_coverage)](https://codeclimate.com/github/Hirurg103/capybara_select2/test_coverage)
|
5
7
|
|
6
8
|
## Installation
|
7
9
|
|
data/capybara_select2.gemspec
CHANGED
@@ -35,4 +35,5 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_development_dependency "capybara-webkit", "~> 1.15"
|
36
36
|
spec.add_development_dependency "puma", "~> 3.12"
|
37
37
|
spec.add_development_dependency "pry", "~> 0.11.0"
|
38
|
+
spec.add_development_dependency "simplecov", "~> 0.16"
|
38
39
|
end
|
@@ -25,25 +25,26 @@ module CapybaraSelect2
|
|
25
25
|
container.find('.select2-container')
|
26
26
|
end
|
27
27
|
|
28
|
-
|
28
|
+
select2_version = Utils.detect_select2_version(container)
|
29
29
|
|
30
30
|
open_select = {
|
31
31
|
'2' => ".select2-choice, .select2-search-field",
|
32
32
|
'3' => ".select2-choice, .select2-search-field",
|
33
33
|
'4' => ".select2-selection"
|
34
|
-
}.fetch(
|
34
|
+
}.fetch(select2_version)
|
35
35
|
|
36
36
|
search_input = {
|
37
37
|
'2' => ".select2-dropdown-open input.select2-focused",
|
38
|
-
'3' =>
|
38
|
+
'3' => ".select2-drop-active input.select2-input," + # single
|
39
|
+
".select2-dropdown-open input.select2-input", # multi
|
39
40
|
'4' => ".select2-container--open input.select2-search__field"
|
40
|
-
}.fetch(
|
41
|
+
}.fetch(select2_version)
|
41
42
|
|
42
43
|
option = {
|
43
44
|
'2' => ".select2-container-active .select2-result",
|
44
45
|
'3' => ".select2-drop-active .select2-result",
|
45
46
|
'4' => ".select2-results .select2-results__option"
|
46
|
-
}.fetch(
|
47
|
+
}.fetch(select2_version)
|
47
48
|
|
48
49
|
values.each do |value|
|
49
50
|
container.find(open_select).click
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-select-2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dzmitry Kavalionak
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 0.11.0
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.16'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.16'
|
139
153
|
description:
|
140
154
|
email:
|
141
155
|
- dzm.kov@gmail.com
|