capybara-screenshot 0.3.21 → 0.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +9 -1
- data/capybara-screenshot.gemspec +1 -1
- data/lib/capybara-screenshot/rspec/text_reporter.rb +2 -2
- data/lib/capybara-screenshot/saver.rb +9 -2
- data/lib/capybara-screenshot/version.rb +1 -1
- data/spec/rspec/text_reporter_spec.rb +3 -3
- metadata +22 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d78f2dfca0018f8e39e449b899eaeefa2496f6db
|
4
|
+
data.tar.gz: f51a94ca7e364b02e2f45fd79f89ce5c966f6edf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1057d5cabf204d39e4ec7cb66128cf5c996b67c3df0d40efb406fa9c7331cd38ddc44b0d4e1cc5d4b877dfbee228f5bcadcfc1b002cdd58d981e80acc227f90f
|
7
|
+
data.tar.gz: d2573152cfc43757b3987ac2175213648b7cc9bfe85518658eb4f3e4331ef5d8b3bb442db6375720615ec286fd6b7b34b799a248c3148738d6e8ca70d6c20c04
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
22 July 2014 - 0.3.21 -> 0.3.22
|
2
|
+
-----------
|
3
|
+
|
4
|
+
Replaced [colorize](https://rubygems.org/gems/colorize) gem with [colored](https://rubygems.org/gems/colored) due to license issue, see https://github.com/mattheworiordan/capybara-screenshot/issues/93.
|
5
|
+
|
1
6
|
22 July 2014 - 0.3.20 -> 0.3.21
|
2
7
|
-----------
|
3
8
|
|
data/README.md
CHANGED
@@ -2,7 +2,9 @@ capybara-screenshot gem
|
|
2
2
|
=======================
|
3
3
|
|
4
4
|
[](https://travis-ci.org/mattheworiordan/capybara-screenshot)
|
5
|
-
[](https://codeclimate.com/github/mattheworiordan/capybara-
|
5
|
+
[](https://codeclimate.com/github/mattheworiordan/capybara-
|
6
|
+
screenshot)
|
7
|
+
[](http://badge.fury.io/rb/capybara-screenshot)
|
6
8
|
|
7
9
|
Using this gem, whenever a [Capybara](https://github.com/jnicklas/capybara) test in [Cucumber](http://cukes.info/), [Rspec](https://www.relishapp.com/rspec) or Minitest fails, the HTML for the failed page and a screenshot (when using [capybara-webkit](https://github.com/thoughtbot/capybara-webkit), [Selenium](http://seleniumhq.org/) or [poltergeist](https://github.com/jonleighton/poltergeist)) is saved into $APPLICATION_ROOT/tmp/capybara.
|
8
10
|
|
@@ -138,6 +140,12 @@ Common problems
|
|
138
140
|
|
139
141
|
If you have recently upgraded from v0.2, or you find that screen shots are not automatically being generated, then it's most likely you have not included the necessary `require` statement for your testing framework described above. As of version 0.3, without the explicit require, Capybara-Screenshot will not automatically take screen shots. Please re-read the installation instructions above.
|
140
142
|
|
143
|
+
Also make sure that you're not calling `Capybara.reset_sessions!` before the screenshot hook runs. For RSpec you want to make sure that you're using `append_after` instead of `after`, for instance:
|
144
|
+
|
145
|
+
config.append_after(:each) do
|
146
|
+
Capybara.reset_sessions!
|
147
|
+
end
|
148
|
+
|
141
149
|
[Raise an issue on the Capybara-Screenshot issue tracker](https://github.com/mattheworiordan/capybara-screenshot/issues) if you are still having problems.
|
142
150
|
|
143
151
|
Repository
|
data/capybara-screenshot.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_dependency 'capybara', ['>= 1.0', '< 3']
|
22
22
|
end
|
23
23
|
s.add_dependency 'launchy'
|
24
|
-
s.add_dependency '
|
24
|
+
s.add_dependency 'colored'
|
25
25
|
|
26
26
|
s.add_development_dependency 'rspec', '~> 2.9'
|
27
27
|
s.add_development_dependency 'timecop'
|
@@ -11,8 +11,8 @@ module Capybara
|
|
11
11
|
dump_failure_info_without_screenshot(example)
|
12
12
|
return unless (screenshot = example.metadata[:screenshot])
|
13
13
|
|
14
|
-
output.puts(long_padding + "HTML screenshot: #{screenshot[:html]}".
|
15
|
-
output.puts(long_padding + "Image screenshot: #{screenshot[:image]}".
|
14
|
+
output.puts(long_padding + "HTML screenshot: #{screenshot[:html]}".yellow) if screenshot[:html]
|
15
|
+
output.puts(long_padding + "Image screenshot: #{screenshot[:image]}".yellow) if screenshot[:image]
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -1,4 +1,11 @@
|
|
1
|
-
|
1
|
+
if RUBY_PLATFORM =~ /win32/
|
2
|
+
begin
|
3
|
+
require 'Win32/Console/ANSI'
|
4
|
+
rescue LoadError => e
|
5
|
+
fail "win32console gem is required to output colorized messages, please add this to your Gemfile or install"
|
6
|
+
end
|
7
|
+
end
|
8
|
+
require 'colored'
|
2
9
|
|
3
10
|
module Capybara
|
4
11
|
module Screenshot
|
@@ -77,7 +84,7 @@ module Capybara
|
|
77
84
|
|
78
85
|
private
|
79
86
|
def output(message)
|
80
|
-
puts " #{message.
|
87
|
+
puts " #{message.yellow}"
|
81
88
|
end
|
82
89
|
end
|
83
90
|
end
|
@@ -46,7 +46,7 @@ describe Capybara::Screenshot::RSpec::TextReporter do
|
|
46
46
|
|
47
47
|
it 'appends the html file path to the original output' do
|
48
48
|
@reporter.dump_failure_info(example)
|
49
|
-
@reporter.output.string.should == "original failure info\n #{"HTML screenshot: path/to/html".
|
49
|
+
@reporter.output.string.should == "original failure info\n #{"HTML screenshot: path/to/html".yellow}\n"
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -55,7 +55,7 @@ describe Capybara::Screenshot::RSpec::TextReporter do
|
|
55
55
|
|
56
56
|
it 'appends the image path to the original output' do
|
57
57
|
@reporter.dump_failure_info(example)
|
58
|
-
@reporter.output.string.should == "original failure info\n #{"HTML screenshot: path/to/html".
|
58
|
+
@reporter.output.string.should == "original failure info\n #{"HTML screenshot: path/to/html".yellow}\n #{"Image screenshot: path/to/image".yellow}\n"
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -71,6 +71,6 @@ describe Capybara::Screenshot::RSpec::TextReporter do
|
|
71
71
|
old_reporter.singleton_class.send :include, described_class
|
72
72
|
example = double("example", metadata: { screenshot: { html: "path/to/html" } })
|
73
73
|
old_reporter.dump_failure_info(example)
|
74
|
-
old_reporter.output.string.should == "original failure info\n #{"HTML screenshot: path/to/html".
|
74
|
+
old_reporter.output.string.should == "original failure info\n #{"HTML screenshot: path/to/html".yellow}\n"
|
75
75
|
end
|
76
76
|
end
|
metadata
CHANGED
@@ -1,89 +1,89 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-screenshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.22
|
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: 2014-
|
11
|
+
date: 2014-09-08 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
|
-
name:
|
48
|
+
name: colored
|
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: :runtime
|
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: rspec
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - ~>
|
65
|
+
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '2.9'
|
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: '2.9'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: timecop
|
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
|
description: When a Cucumber step fails, it is useful to create a screenshot image
|
@@ -94,9 +94,9 @@ executables: []
|
|
94
94
|
extensions: []
|
95
95
|
extra_rdoc_files: []
|
96
96
|
files:
|
97
|
-
- .gitignore
|
98
|
-
- .rspec
|
99
|
-
- .travis.yml
|
97
|
+
- ".gitignore"
|
98
|
+
- ".rspec"
|
99
|
+
- ".travis.yml"
|
100
100
|
- CHANGELOG.md
|
101
101
|
- Gemfile
|
102
102
|
- LICENSE
|
@@ -138,17 +138,17 @@ require_paths:
|
|
138
138
|
- lib
|
139
139
|
required_ruby_version: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
|
-
- -
|
141
|
+
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
145
|
requirements:
|
146
|
-
- -
|
146
|
+
- - ">="
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
150
|
rubyforge_project: capybara-screenshot
|
151
|
-
rubygems_version: 2.
|
151
|
+
rubygems_version: 2.2.2
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Automatically create snapshots when Cucumber steps fail with Capybara and
|
@@ -165,3 +165,4 @@ test_files:
|
|
165
165
|
- spec/rspec_spec.rb
|
166
166
|
- spec/spec_helper.rb
|
167
167
|
- spec/support/html_reporter_context.rb
|
168
|
+
has_rdoc:
|