capybara-box 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6afd97a950443869bfe4ab875fccd59c05a3fc0a
4
- data.tar.gz: 137d4cf67eb4dd6c1a04c043ebbc07e13706a8f4
2
+ SHA256:
3
+ metadata.gz: d9dabbefac30f4ca3b29674e4a65c7ef8640255503eb2c605ae01176c997cde8
4
+ data.tar.gz: 49dc38128e4d9734a9ed71d2d43995074be3cf184567552fab4653b1e0e0faad
5
5
  SHA512:
6
- metadata.gz: 07bd47774b53cc943f1b319caba4e4114458fe618b1318465b8002710ce4b65ac9d68bfc023f052887aac2c3f192e8e9add6e050b59bca6d404772f1a141cdea
7
- data.tar.gz: b7e8561e2fd0fbea24983141057428ca532bb281e1e6a162db43cddb800885b79b56aa8a0fe8c3f679d3242ef2da6c63b56ffb40f32a4aff676326daec850289
6
+ metadata.gz: bdbc7fc8b201352ad723022df831a48b9bcd38224ad6aa962ff1db924a91f6b2c6b64c82dee40082373ade204683069527d7afab7368d9f04b55c5637e404f88
7
+ data.tar.gz: 97370aa0c58ecf42ef35f8c9c7a55995d99420f2fbb4681925bb669124bede7ce5f4402bace00a7d3d164f282dde2d1f6ad7581a6c74716f45eb3e25158cc157
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## v0.3.0
2
+
3
+ - Drops Rack Session Access internal require;
4
+ - Makes `chromedriver-helper` optional.
5
+
1
6
  ## v0.2.1
2
7
 
3
8
  - fixes
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Build Status](https://travis-ci.org/wbotelhos/capybara-box.svg)](https://travis-ci.org/wbotelhos/capybara-box)
4
4
  [![Gem Version](https://badge.fury.io/rb/capybara-box.svg)](https://badge.fury.io/rb/capybara-box)
5
5
 
6
- Configure Capybara with **Chrome**, **Chrome Headless** or **Firefox** with *Screenshot* feature and *Session* without lost your mind with just one line.
6
+ Configure Capybara with **Chrome**, **Chrome Headless** or **Firefox** with *Screenshot* feature and *Session* without losing your mind with just one line.
7
7
 
8
8
  ## install
9
9
 
@@ -30,7 +30,14 @@ By default, `chrome` is the driver, but you can use `chrome_headless` and `firef
30
30
 
31
31
  ## Version
32
32
 
33
- If you do not want install the Chrome Driver on your CI, you can specify the version here and it will be installed automatically for you.
33
+ You can use a embbeded driver via `chromedriver-helper` if you do not want to install the `chromedriver` by yourself.
34
+ First require `chromedriver-helper` on your `spec_helper.rb` file:
35
+
36
+ ```ruby
37
+ require 'chromedriver-helper'
38
+ ```
39
+
40
+ And than specify the version of the driver you want:
34
41
 
35
42
  ```ruby
36
43
  CapybaraBox::Base.configure version: '2.32'
@@ -64,25 +71,6 @@ CapybaraBox.configure(
64
71
  )
65
72
  ```
66
73
 
67
- ## Session
68
-
69
- By default, Rack Session manipulation comes as battery, just use it.
70
-
71
- ```ruby
72
- page.set_rack_session key: 'value'
73
- ```
74
-
75
- ```ruby
76
- page.get_rack_session :key
77
- # 'value'
78
- ```
79
-
80
- You can disable this feature using the `session` option:
81
-
82
- ```ruby
83
- CapybaraBox.configure session: false
84
- ```
85
-
86
74
  ## Add Argument
87
75
 
88
76
  By default some Switches are enabled for a better performance, you can add yours too:
@@ -8,8 +8,6 @@ module CapybaraBox
8
8
  @browser = parameters[:browser] || :chrome
9
9
  @max_wait_time = parameters[:max_wait_time]
10
10
  @parameters = parameters
11
-
12
- requires
13
11
  end
14
12
 
15
13
  def add_argument(value)
@@ -212,10 +210,6 @@ module CapybaraBox
212
210
  ['true', true].include? value
213
211
  end
214
212
 
215
- def requires
216
- require 'rack_session_access/capybara' unless @parameters[:session] == false
217
- end
218
-
219
213
  def screenshot_s3_config
220
214
  {
221
215
  s3_client_credentials: {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CapybaraBox
4
- VERSION = '0.2.1'.freeze
4
+ VERSION = '0.3.0'.freeze
5
5
  end
@@ -9,7 +9,7 @@ RSpec.describe CapybaraBox::Base, '.add_argument' do
9
9
  it 'adds the argument' do
10
10
  subject.add_argument '--argument'
11
11
 
12
- expect(subject.options.args).to eq ['--argument']
12
+ expect(subject.options.args).to eq Set['--argument']
13
13
  end
14
14
  end
15
15
 
@@ -19,7 +19,7 @@ RSpec.describe CapybaraBox::Base, '.add_argument' do
19
19
  it 'adds the argument' do
20
20
  subject.add_argument '--argument'
21
21
 
22
- expect(subject.options.args).to eq ['--argument']
22
+ expect(subject.options.args).to eq Set['--argument']
23
23
  end
24
24
  end
25
25
 
@@ -4,18 +4,18 @@ RSpec.describe CapybaraBox::Base, '.apply_arguments' do
4
4
  subject { described_class.new parameters }
5
5
 
6
6
  before do
7
- allow(subject).to receive(:arguments) { ['--argument'] }
7
+ allow(subject).to receive(:arguments) { Set['--argument'] }
8
8
  end
9
9
 
10
10
  context 'when is not chrome' do
11
11
  let!(:parameters) { { browser: :chrome } }
12
12
 
13
13
  it 'applies' do
14
- expect(subject.options.args).to eq []
14
+ expect(subject.options.args).to eq Set.new
15
15
 
16
16
  subject.apply_arguments
17
17
 
18
- expect(subject.options.args).to eq ['--argument']
18
+ expect(subject.options.args).to eq Set['--argument']
19
19
  end
20
20
  end
21
21
 
@@ -23,11 +23,11 @@ RSpec.describe CapybaraBox::Base, '.apply_arguments' do
23
23
  let!(:parameters) { { browser: :chrome_headless } }
24
24
 
25
25
  it 'applies' do
26
- expect(subject.options.args).to eq []
26
+ expect(subject.options.args).to eq Set.new
27
27
 
28
28
  subject.apply_arguments
29
29
 
30
- expect(subject.options.args).to eq ['--argument', '--headless']
30
+ expect(subject.options.args).to eq Set['--argument', '--headless']
31
31
  end
32
32
  end
33
33
  end
@@ -1,5 +1,7 @@
1
1
  require 'rails_helper'
2
2
 
3
+ require 'chromedriver/helper'
4
+
3
5
  RSpec.describe CapybaraBox::Base, '.apply_version' do
4
6
  subject { described_class.new parameters }
5
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-box
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Washington Botelho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-01 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara-screenshot
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: chromedriver-helper
42
+ name: selenium-webdriver
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,13 +53,13 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rack_session_access
56
+ name: chromedriver-helper
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- type: :runtime
62
+ type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
@@ -67,13 +67,13 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: selenium-webdriver
70
+ name: pry-byebug
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
- type: :runtime
76
+ type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rspec
84
+ name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rubocop
98
+ name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: pry-byebug
126
+ name: rubocop
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -194,34 +194,34 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  version: '0'
195
195
  requirements: []
196
196
  rubyforge_project:
197
- rubygems_version: 2.6.12
197
+ rubygems_version: 2.7.3
198
198
  signing_key:
199
199
  specification_version: 4
200
200
  summary: A Tool Box for Capybara.
201
201
  test_files:
202
- - spec/lib/capybara_box/base/add_argument_spec.rb
203
- - spec/lib/capybara_box/base/add_preference_spec.rb
202
+ - spec/support/common.rb
203
+ - spec/lib/capybara_box/base/http_client_spec.rb
204
+ - spec/lib/capybara_box/base/apply_preferences_spec.rb
205
+ - spec/lib/capybara_box/base/firefox_spec.rb
204
206
  - spec/lib/capybara_box/base/apply_arguments_spec.rb
207
+ - spec/lib/capybara_box/base/driver_spec.rb
208
+ - spec/lib/capybara_box/base/self_configure_spec.rb
209
+ - spec/lib/capybara_box/base/add_argument_spec.rb
205
210
  - spec/lib/capybara_box/base/apply_bin_path_spec.rb
206
- - spec/lib/capybara_box/base/apply_preferences_spec.rb
207
- - spec/lib/capybara_box/base/apply_version_spec.rb
208
- - spec/lib/capybara_box/base/arguments_spec.rb
209
- - spec/lib/capybara_box/base/chrome_family_spec.rb
211
+ - spec/lib/capybara_box/base/version_spec.rb
212
+ - spec/lib/capybara_box/base/options_spec.rb
213
+ - spec/lib/capybara_box/base/register_spec.rb
214
+ - spec/lib/capybara_box/base/log_spec.rb
215
+ - spec/lib/capybara_box/base/add_preference_spec.rb
216
+ - spec/lib/capybara_box/base/create_spec.rb
210
217
  - spec/lib/capybara_box/base/chrome_headless_spec.rb
218
+ - spec/lib/capybara_box/base/chrome_family_spec.rb
219
+ - spec/lib/capybara_box/base/apply_version_spec.rb
211
220
  - spec/lib/capybara_box/base/chrome_spec.rb
212
- - spec/lib/capybara_box/base/configure_screenshot_spec.rb
213
- - spec/lib/capybara_box/base/configure_spec.rb
214
- - spec/lib/capybara_box/base/create_spec.rb
215
- - spec/lib/capybara_box/base/driver_options_spec.rb
216
- - spec/lib/capybara_box/base/driver_spec.rb
217
- - spec/lib/capybara_box/base/firefox_spec.rb
221
+ - spec/lib/capybara_box/base/arguments_spec.rb
218
222
  - spec/lib/capybara_box/base/http_client_options_spec.rb
219
- - spec/lib/capybara_box/base/http_client_spec.rb
220
- - spec/lib/capybara_box/base/log_spec.rb
221
- - spec/lib/capybara_box/base/options_spec.rb
223
+ - spec/lib/capybara_box/base/driver_options_spec.rb
224
+ - spec/lib/capybara_box/base/configure_screenshot_spec.rb
222
225
  - spec/lib/capybara_box/base/preferences_spec.rb
223
- - spec/lib/capybara_box/base/register_spec.rb
224
- - spec/lib/capybara_box/base/self_configure_spec.rb
225
- - spec/lib/capybara_box/base/version_spec.rb
226
+ - spec/lib/capybara_box/base/configure_spec.rb
226
227
  - spec/rails_helper.rb
227
- - spec/support/common.rb