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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6eb43822ce3b518d701a86c67a72908953c0c49e699b3b29ba263e3b8b4f17f7
4
- data.tar.gz: e35c51b8daa7efc62aa182d2f3280227d59413d674921f9ce9fe0209b7a326a7
3
+ metadata.gz: fe208d8f8fb951f498d76fe53640da096df8c4d4e32c44e065b3e6eb240d1265
4
+ data.tar.gz: 99fcc0e8620c7d44f11783a36509781bd4ebb08da0565948dcd3972fab0af89b
5
5
  SHA512:
6
- metadata.gz: d2992956c71d654754f4c1098fe474cc8df6dcac9516926782f9c8a3876bdccabea3d860d59362451ffe17f08c09f8e40495137d6668c405002455cdf81e6e56
7
- data.tar.gz: c15d8442bce49d012f6e7f92094619c5afb3d59ae039745a991aeab7b18544778a3715dd5466c90de080fdf1d2f1196d8ab8e5bc1630f814c6b995da7269bc52
6
+ metadata.gz: 05dc1e17050c6d4790914138d39cf0199824ca854ab8efbebf7f48a34206dd7c61894d2a5a94989605fe8e8172ac9f61519ce050b3791e34eb5cc8fb4ed6cadb
7
+ data.tar.gz: 82ee9c9d6a1a7cef8d80c9a3711c187d09365bf3c20e2039660c31fc79411c8070e933a984942932471cf8834fac816fee6e11b0608f755c93983a601ece4f33
data/CHANGELOG.md CHANGED
@@ -1,60 +1,80 @@
1
- ## v1.1.2
1
+ # v1.2.0
2
2
 
3
- - Fixes
4
- - Avoid apply blank bin path;
5
- - Avoid apply blank version;
3
+ ## Updates
6
4
 
7
- ## v1.1.1
5
+ - Avoids deprecated Selenium `:options`;
8
6
 
9
- - Fixes
10
- - Removes default args that was avoiding screen render.
7
+ # v1.1.2
11
8
 
12
- ## v1.1.0
9
+ ## Fixes
13
10
 
14
- - Fixes
15
- - S3 config activation;
11
+ - Avoid apply blank bin path;
12
+ - Avoid apply blank version;
16
13
 
17
- - Update
18
- - Adds more default arguments;
14
+ # v1.1.1
19
15
 
20
- ## v1.0.1
16
+ ## Fixes
21
17
 
22
- - Fixes
23
- - Registers driver name as symbol;
18
+ - Removes default args that was avoiding screen render.
24
19
 
25
- ## v1.0.0
20
+ # v1.1.0
26
21
 
27
- - Updates
28
- - Updated default arguments;
29
- - Spec files now is excluded from gem pack;
22
+ ## Fixes
30
23
 
31
- - Features
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
- - Fixes
37
- - Fix screenshot upload;
26
+ ## Updates
38
27
 
39
- ## v0.4.0
28
+ - Adds more default arguments;
40
29
 
41
- - Updates Selenium WebDriver deprecated message;
30
+ # v1.0.1
42
31
 
43
- ## v0.3.0
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
- ## v0.2.1
66
+ # v0.2.1
67
+
68
+ ## Fixes
69
+
70
+ - `chrome_headless` was being registered with wrong name.
49
71
 
50
- - Fixes
51
- - `chrome_headless` was being registered with wrong name.
72
+ # v0.2.0
52
73
 
53
- ## v0.2.0
74
+ ## Features
54
75
 
55
- - Features
56
- - Add log feature for Chrome and Chrome Headless.
76
+ - Add log feature for Chrome and Chrome Headless.
57
77
 
58
- ## v0.1.0
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
- [![Build Status](https://travis-ci.org/wbotelhos/capybara-box.svg?branch=master)](https://travis-ci.org/wbotelhos/capybara-box)
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
- [![Patreon](https://img.shields.io/badge/donate-%3C3-brightgreen.svg)](https://www.patreon.com/wbotelhos)
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:
@@ -9,11 +9,11 @@ module CapybaraBox
9
9
  end
10
10
 
11
11
  def add_argument(value)
12
- options&.add_argument(value)
12
+ capabilities&.add_argument(value)
13
13
  end
14
14
 
15
15
  def add_preference(key, value)
16
- options&.add_preference(key, value)
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 apply_bin_path(path)
90
- if firefox?
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[:options] = options if chrome_family?
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CapybaraBox
4
- VERSION = '1.1.2'
4
+ VERSION = '1.2.0'
5
5
  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: 1.1.2
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: 2020-05-28 00:00:00.000000000 Z
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.1.2
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: []