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 +5 -5
- data/CHANGELOG.md +5 -0
- data/README.md +9 -21
- data/lib/capybara-box/base.rb +0 -6
- data/lib/capybara-box/version.rb +1 -1
- data/spec/lib/capybara_box/base/add_argument_spec.rb +2 -2
- data/spec/lib/capybara_box/base/apply_arguments_spec.rb +5 -5
- data/spec/lib/capybara_box/base/apply_version_spec.rb +2 -0
- metadata +30 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d9dabbefac30f4ca3b29674e4a65c7ef8640255503eb2c605ae01176c997cde8
|
4
|
+
data.tar.gz: 49dc38128e4d9734a9ed71d2d43995074be3cf184567552fab4653b1e0e0faad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdbc7fc8b201352ad723022df831a48b9bcd38224ad6aa962ff1db924a91f6b2c6b64c82dee40082373ade204683069527d7afab7368d9f04b55c5637e404f88
|
7
|
+
data.tar.gz: 97370aa0c58ecf42ef35f8c9c7a55995d99420f2fbb4681925bb669124bede7ce5f4402bace00a7d3d164f282dde2d1f6ad7581a6c74716f45eb3e25158cc157
|
data/CHANGELOG.md
CHANGED
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
|
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
|
-
|
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:
|
data/lib/capybara-box/base.rb
CHANGED
@@ -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: {
|
data/lib/capybara-box/version.rb
CHANGED
@@ -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
|
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.
|
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:
|
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:
|
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:
|
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: :
|
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:
|
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: :
|
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:
|
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:
|
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:
|
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.
|
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/
|
203
|
-
- spec/lib/capybara_box/base/
|
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/
|
207
|
-
- spec/lib/capybara_box/base/
|
208
|
-
- spec/lib/capybara_box/base/
|
209
|
-
- spec/lib/capybara_box/base/
|
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/
|
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/
|
220
|
-
- spec/lib/capybara_box/base/
|
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/
|
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
|