capybara-box 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +56 -36
- data/README.md +8 -3
- data/lib/capybara-box/base.rb +15 -15
- data/lib/capybara-box/version.rb +1 -1
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe208d8f8fb951f498d76fe53640da096df8c4d4e32c44e065b3e6eb240d1265
|
4
|
+
data.tar.gz: 99fcc0e8620c7d44f11783a36509781bd4ebb08da0565948dcd3972fab0af89b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05dc1e17050c6d4790914138d39cf0199824ca854ab8efbebf7f48a34206dd7c61894d2a5a94989605fe8e8172ac9f61519ce050b3791e34eb5cc8fb4ed6cadb
|
7
|
+
data.tar.gz: 82ee9c9d6a1a7cef8d80c9a3711c187d09365bf3c20e2039660c31fc79411c8070e933a984942932471cf8834fac816fee6e11b0608f755c93983a601ece4f33
|
data/CHANGELOG.md
CHANGED
@@ -1,60 +1,80 @@
|
|
1
|
-
|
1
|
+
# v1.2.0
|
2
2
|
|
3
|
-
|
4
|
-
- Avoid apply blank bin path;
|
5
|
-
- Avoid apply blank version;
|
3
|
+
## Updates
|
6
4
|
|
7
|
-
|
5
|
+
- Avoids deprecated Selenium `:options`;
|
8
6
|
|
9
|
-
|
10
|
-
- Removes default args that was avoiding screen render.
|
7
|
+
# v1.1.2
|
11
8
|
|
12
|
-
##
|
9
|
+
## Fixes
|
13
10
|
|
14
|
-
-
|
15
|
-
|
11
|
+
- Avoid apply blank bin path;
|
12
|
+
- Avoid apply blank version;
|
16
13
|
|
17
|
-
|
18
|
-
- Adds more default arguments;
|
14
|
+
# v1.1.1
|
19
15
|
|
20
|
-
##
|
16
|
+
## Fixes
|
21
17
|
|
22
|
-
-
|
23
|
-
- Registers driver name as symbol;
|
18
|
+
- Removes default args that was avoiding screen render.
|
24
19
|
|
25
|
-
|
20
|
+
# v1.1.0
|
26
21
|
|
27
|
-
|
28
|
-
- Updated default arguments;
|
29
|
-
- Spec files now is excluded from gem pack;
|
22
|
+
## Fixes
|
30
23
|
|
31
|
-
-
|
32
|
-
- Capybara `load_selenium` is called before startup;
|
33
|
-
- Screenshot S3 feature now is configure only via ENV;
|
34
|
-
- Using new gem `webdrivers`;
|
24
|
+
- S3 config activation;
|
35
25
|
|
36
|
-
|
37
|
-
- Fix screenshot upload;
|
26
|
+
## Updates
|
38
27
|
|
39
|
-
|
28
|
+
- Adds more default arguments;
|
40
29
|
|
41
|
-
|
30
|
+
# v1.0.1
|
42
31
|
|
43
|
-
##
|
32
|
+
## Fixes
|
33
|
+
|
34
|
+
- Registers driver name as symbol;
|
35
|
+
|
36
|
+
# v1.0.0
|
37
|
+
|
38
|
+
## Updates
|
39
|
+
|
40
|
+
- Updated default arguments;
|
41
|
+
- Spec files now is excluded from gem pack;
|
42
|
+
|
43
|
+
## Features
|
44
|
+
|
45
|
+
- Capybara `load_selenium` is called before startup;
|
46
|
+
- Screenshot S3 feature now is configure only via ENV;
|
47
|
+
- Using new gem `webdrivers`;
|
48
|
+
|
49
|
+
## Fixes
|
50
|
+
|
51
|
+
- Fix screenshot upload;
|
52
|
+
|
53
|
+
# v0.4.0
|
54
|
+
|
55
|
+
## Updates
|
56
|
+
|
57
|
+
- Selenium WebDriver deprecated message;
|
58
|
+
|
59
|
+
# v0.3.0
|
60
|
+
|
61
|
+
## Updates
|
44
62
|
|
45
63
|
- Drops Rack Session Access internal require;
|
46
64
|
- Makes `chromedriver-helper` optional.
|
47
65
|
|
48
|
-
|
66
|
+
# v0.2.1
|
67
|
+
|
68
|
+
## Fixes
|
69
|
+
|
70
|
+
- `chrome_headless` was being registered with wrong name.
|
49
71
|
|
50
|
-
|
51
|
-
- `chrome_headless` was being registered with wrong name.
|
72
|
+
# v0.2.0
|
52
73
|
|
53
|
-
##
|
74
|
+
## Features
|
54
75
|
|
55
|
-
-
|
56
|
-
- Add log feature for Chrome and Chrome Headless.
|
76
|
+
- Add log feature for Chrome and Chrome Headless.
|
57
77
|
|
58
|
-
|
78
|
+
# v0.1.0
|
59
79
|
|
60
|
-
First release.
|
80
|
+
- First release.
|
data/README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# Capybara Box
|
2
2
|
|
3
|
-
[![
|
4
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/1b13dc12b03be63baaed/maintainability)](https://codeclimate.com/github/wbotelhos/capybara-box/maintainability)
|
3
|
+
[![CI](https://github.com/wbotelhos/capybara-box/workflows/CI/badge.svg)](https://github.com/wbotelhos/capybara-box/actions)
|
5
4
|
[![Gem Version](https://badge.fury.io/rb/capybara-box.svg)](https://badge.fury.io/rb/capybara-box)
|
6
|
-
[![
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/f312587b4f126bb13e85/maintainability)](https://codeclimate.com/github/wbotelhos/capybara-box/maintainability)
|
6
|
+
[![Coverage](https://codecov.io/gh/wbotelhos/capybara-box/branch/main/graph/badge.svg)](https://codecov.io/gh/wbotelhos/capybara-box)
|
7
|
+
[![Sponsor](https://img.shields.io/badge/sponsor-%3C3-green)](https://www.patreon.com/wbotelhos)
|
7
8
|
|
8
9
|
Configure Capybara with **Chrome**, **Chrome Headless**, **Firefox** and **Firefox Headless** with *Screenshot* feature without losing your mind.
|
9
10
|
|
@@ -30,6 +31,10 @@ CapybaraBox::Base.configure
|
|
30
31
|
|
31
32
|
By default, `selenium_chrome` is the driver, but you can use `selenium_chrome_headless` and `selenium_firefox` or `selenium_firefox_headless` too.
|
32
33
|
|
34
|
+
```ruby
|
35
|
+
CapybaraBox::Base.configure(browser: :selenium_firefox)
|
36
|
+
```
|
37
|
+
|
33
38
|
## Version
|
34
39
|
|
35
40
|
The version is setted via `webdrivers`. You can specify the version:
|
data/lib/capybara-box/base.rb
CHANGED
@@ -9,11 +9,11 @@ module CapybaraBox
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def add_argument(value)
|
12
|
-
|
12
|
+
capabilities&.add_argument(value)
|
13
13
|
end
|
14
14
|
|
15
15
|
def add_preference(key, value)
|
16
|
-
|
16
|
+
capabilities&.add_preference(key, value)
|
17
17
|
end
|
18
18
|
|
19
19
|
def apply_arguments
|
@@ -26,6 +26,14 @@ module CapybaraBox
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
def apply_bin_path(path)
|
30
|
+
if firefox?
|
31
|
+
::Selenium::WebDriver::Firefox.path = path
|
32
|
+
|
33
|
+
::Selenium::WebDriver::Firefox.path
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
29
37
|
def apply_preferences
|
30
38
|
preferences.each { |key, value| add_preference(key, value) }
|
31
39
|
end
|
@@ -86,12 +94,8 @@ module CapybaraBox
|
|
86
94
|
Capybara.default_max_wait_time = @max_wait_time if @max_wait_time
|
87
95
|
end
|
88
96
|
|
89
|
-
def
|
90
|
-
if
|
91
|
-
::Selenium::WebDriver::Firefox::Binary.path = path
|
92
|
-
|
93
|
-
::Selenium::WebDriver::Firefox::Binary.path
|
94
|
-
end
|
97
|
+
def capabilities
|
98
|
+
@capabilities ||= ::Selenium::WebDriver::Chrome::Options.new if chrome_family?
|
95
99
|
end
|
96
100
|
|
97
101
|
def create
|
@@ -109,8 +113,8 @@ module CapybaraBox
|
|
109
113
|
end
|
110
114
|
|
111
115
|
def driver(app)
|
112
|
-
opts
|
113
|
-
opts[:
|
116
|
+
opts = {}
|
117
|
+
opts[:capabilities] = capabilities if chrome_family?
|
114
118
|
|
115
119
|
Capybara::Selenium::Driver.load_selenium
|
116
120
|
|
@@ -154,10 +158,6 @@ module CapybaraBox
|
|
154
158
|
@http_client ||= ::Selenium::WebDriver::Remote::Http::Default.new(**http_client_options)
|
155
159
|
end
|
156
160
|
|
157
|
-
def options
|
158
|
-
@options ||= ::Selenium::WebDriver::Chrome::Options.new if chrome_family?
|
159
|
-
end
|
160
|
-
|
161
161
|
def preferences
|
162
162
|
return @parameters[:preferences] if @parameters[:preferences]
|
163
163
|
return {} unless chrome_family?
|
@@ -175,7 +175,7 @@ module CapybaraBox
|
|
175
175
|
Capybara.register_driver(name.to_sym) { |app| driver(app) }
|
176
176
|
end
|
177
177
|
|
178
|
-
def self.configure(parameters)
|
178
|
+
def self.configure(parameters = {})
|
179
179
|
new(parameters).tap(&:create)
|
180
180
|
end
|
181
181
|
|
data/lib/capybara-box/version.rb
CHANGED
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: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Washington Botelho
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara-screenshot
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: codecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: pry-byebug
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,7 +171,7 @@ homepage: https://github.com/wbotelhos/capybara-box
|
|
157
171
|
licenses:
|
158
172
|
- MIT
|
159
173
|
metadata: {}
|
160
|
-
post_install_message:
|
174
|
+
post_install_message:
|
161
175
|
rdoc_options: []
|
162
176
|
require_paths:
|
163
177
|
- lib
|
@@ -172,8 +186,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
186
|
- !ruby/object:Gem::Version
|
173
187
|
version: '0'
|
174
188
|
requirements: []
|
175
|
-
rubygems_version: 3.
|
176
|
-
signing_key:
|
189
|
+
rubygems_version: 3.2.22
|
190
|
+
signing_key:
|
177
191
|
specification_version: 4
|
178
192
|
summary: A Tool Box for Capybara.
|
179
193
|
test_files: []
|