capybara-screenshot 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.travis.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/lib/capybara-screenshot.rb +3 -4
- data/lib/capybara-screenshot/version.rb +1 -1
- data/spec/unit/capybara-screenshot_rspec_spec.rb +1 -1
- data/spec/unit/rspec_reporters/text_reporter_spec.rb +1 -1
- data/spec/unit/saver_spec.rb +33 -4
- metadata +30 -30
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NjY4YzA4OGRhNTlmNWM0YWNhZTAxYjhiMzMyZTU2NTcyNjU1NGJiYg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ODcyODFkMDAxNzI3MzVhY2RhODE3YmYwNzAwYzQyNDc3MmFlNzJmOA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NzI0NTY2ZTMyNDk4OWI1Njk2YmNhOTYzMzNhYzg2MDdhOTY0YmQ5MWIwYmQ1
|
10
|
+
MDcwZGVjODU4M2JkMjZmNTU3MDlkYTkzZjYxM2IyMmJhYTA0MzUxYTA3NzQw
|
11
|
+
ZGM0ZDQ1MWY2MmY2YjUzZDQ0NzZkMWNmNjg4NmM3YWRlNzhjNjc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MTBlZDdkNzBmODEyNGZiOTFjZTdiN2U2YzUyODM0NDgzMWU3N2JhNzY0MWNh
|
14
|
+
OGFkNzZkMjEwMTA1MGY3NzFmYjkyNzViOGFmMGRmOTI0YjczYTE5YjZkNTBh
|
15
|
+
YjUyNTZhYTVhN2U5ZTY5YWVkMTNmMDU4OWE5ZmU3OWVjNTU4YmI=
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/lib/capybara-screenshot.rb
CHANGED
@@ -121,7 +121,7 @@ Capybara::Screenshot.class_eval do
|
|
121
121
|
driver.render(path, :full => true)
|
122
122
|
end
|
123
123
|
|
124
|
-
|
124
|
+
webkit_block = proc do |driver, path|
|
125
125
|
if driver.respond_to?(:save_screenshot)
|
126
126
|
driver.save_screenshot(path, webkit_options)
|
127
127
|
else
|
@@ -129,9 +129,8 @@ Capybara::Screenshot.class_eval do
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
-
register_driver
|
133
|
-
|
134
|
-
end
|
132
|
+
register_driver :webkit, &webkit_block
|
133
|
+
register_driver :webkit_debug, &webkit_block
|
135
134
|
|
136
135
|
register_driver(:terminus) do |driver, path|
|
137
136
|
if driver.respond_to?(:save_screenshot)
|
@@ -7,7 +7,7 @@ describe Capybara::Screenshot::RSpec do
|
|
7
7
|
allow(Capybara.page).to receive(:current_url).and_return("http://test.local")
|
8
8
|
allow(Capybara::Screenshot::Saver).to receive(:new).and_return(mock_saver)
|
9
9
|
end
|
10
|
-
let(:example_group) { Module.new.include
|
10
|
+
let(:example_group) { Module.new.send(:include, Capybara::DSL) }
|
11
11
|
let(:example) { double("example", exception: Exception.new, example_group: example_group, metadata: {}) }
|
12
12
|
let(:mock_saver) do
|
13
13
|
Capybara::Screenshot::Saver.new(Capybara, Capybara.page).tap do |saver|
|
@@ -43,7 +43,7 @@ describe Capybara::Screenshot::RSpec::TextReporter do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def example_failed_method_argument_double(metadata = {})
|
46
|
-
example_group = Module.new.include
|
46
|
+
example_group = Module.new.send(:include, Capybara::DSL)
|
47
47
|
example = double("example", metadata: metadata, example_group: example_group)
|
48
48
|
if ::RSpec::Core::Version::STRING.to_i <= 2
|
49
49
|
example
|
data/spec/unit/saver_spec.rb
CHANGED
@@ -228,11 +228,40 @@ describe Capybara::Screenshot::Saver do
|
|
228
228
|
allow(capybara_mock).to receive(:current_driver).and_return(:webkit_debug)
|
229
229
|
end
|
230
230
|
|
231
|
-
|
232
|
-
|
231
|
+
context 'has render method' do
|
232
|
+
before do
|
233
|
+
allow(driver_mock).to receive(:respond_to?).with(:'save_screenshot').and_return(false)
|
234
|
+
end
|
233
235
|
|
234
|
-
|
235
|
-
|
236
|
+
it 'saves driver render' do
|
237
|
+
expect(driver_mock).to receive(:render).with(screenshot_path)
|
238
|
+
|
239
|
+
saver.save
|
240
|
+
expect(saver).to be_screenshot_saved
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
context 'has save_screenshot method' do
|
245
|
+
let(:webkit_options){ {width: 800, height: 600} }
|
246
|
+
|
247
|
+
before do
|
248
|
+
allow(driver_mock).to receive(:respond_to?).with(:'save_screenshot').and_return(true)
|
249
|
+
end
|
250
|
+
|
251
|
+
it 'saves driver render' do
|
252
|
+
expect(driver_mock).to receive(:save_screenshot).with(screenshot_path, {})
|
253
|
+
|
254
|
+
saver.save
|
255
|
+
expect(saver).to be_screenshot_saved
|
256
|
+
end
|
257
|
+
|
258
|
+
it 'passes webkit_options to driver' do
|
259
|
+
allow(Capybara::Screenshot).to receive(:webkit_options).and_return( webkit_options )
|
260
|
+
expect(driver_mock).to receive(:save_screenshot).with(screenshot_path, webkit_options)
|
261
|
+
|
262
|
+
saver.save
|
263
|
+
expect(saver).to be_screenshot_saved
|
264
|
+
end
|
236
265
|
end
|
237
266
|
end
|
238
267
|
|
metadata
CHANGED
@@ -1,159 +1,159 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-screenshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew O'Riordan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
|
-
- -
|
20
|
+
- - <
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '3'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '1.0'
|
30
|
-
- -
|
30
|
+
- - <
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '3'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: launchy
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- -
|
37
|
+
- - ! '>='
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- -
|
44
|
+
- - ! '>='
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - ! '>='
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: timecop
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- -
|
65
|
+
- - ! '>='
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - ! '>='
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: cucumber
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - ! '>='
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - ! '>='
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: aruba
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- -
|
93
|
+
- - ! '>='
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - ! '>='
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: sinatra
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - ! '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- -
|
114
|
+
- - ! '>='
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: test-unit
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- -
|
121
|
+
- - ! '>='
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
type: :development
|
125
125
|
prerelease: false
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- -
|
128
|
+
- - ! '>='
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
- !ruby/object:Gem::Dependency
|
132
132
|
name: spinach
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
|
-
- -
|
135
|
+
- - ! '>='
|
136
136
|
- !ruby/object:Gem::Version
|
137
137
|
version: '0'
|
138
138
|
type: :development
|
139
139
|
prerelease: false
|
140
140
|
version_requirements: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
|
-
- -
|
142
|
+
- - ! '>='
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
146
|
name: minitest
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
|
-
- -
|
149
|
+
- - ! '>='
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
type: :development
|
153
153
|
prerelease: false
|
154
154
|
version_requirements: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
|
-
- -
|
156
|
+
- - ! '>='
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
159
|
description: When a Cucumber step fails, it is useful to create a screenshot image
|
@@ -164,9 +164,9 @@ executables: []
|
|
164
164
|
extensions: []
|
165
165
|
extra_rdoc_files: []
|
166
166
|
files:
|
167
|
-
-
|
168
|
-
-
|
169
|
-
-
|
167
|
+
- .gitignore
|
168
|
+
- .rspec
|
169
|
+
- .travis.yml
|
170
170
|
- Appraisals
|
171
171
|
- CHANGELOG.md
|
172
172
|
- Gemfile
|
@@ -230,17 +230,17 @@ require_paths:
|
|
230
230
|
- lib
|
231
231
|
required_ruby_version: !ruby/object:Gem::Requirement
|
232
232
|
requirements:
|
233
|
-
- -
|
233
|
+
- - ! '>='
|
234
234
|
- !ruby/object:Gem::Version
|
235
235
|
version: '0'
|
236
236
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
237
237
|
requirements:
|
238
|
-
- -
|
238
|
+
- - ! '>='
|
239
239
|
- !ruby/object:Gem::Version
|
240
240
|
version: '0'
|
241
241
|
requirements: []
|
242
242
|
rubyforge_project: capybara-screenshot
|
243
|
-
rubygems_version: 2.
|
243
|
+
rubygems_version: 2.4.5
|
244
244
|
signing_key:
|
245
245
|
specification_version: 4
|
246
246
|
summary: Automatically create snapshots when Cucumber steps fail with Capybara and
|