capybara-screenshot 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +19 -0
- data/README.md +40 -0
- data/lib/capybara-screenshot.rb +1 -0
- data/lib/capybara-screenshot/version.rb +1 -1
- data/lib/capybara-screenshot/world.rb +0 -2
- metadata +80 -48
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2011 Matthew O'Riordan, inc.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
capybara-screenshot gem
|
2
|
+
=======================
|
3
|
+
|
4
|
+
Using this gem, whenever a [capybara](https://github.com/jnicklas/capybara) [cucumber](http://cukes.info/) scenario fails, the HTML for the failed page and a screenshot (when using [capybara-webkit](https://github.com/thoughtbot/capybara-webkit)) is saved into /tmp/capybara.
|
5
|
+
|
6
|
+
This is a huge help when trying to diagnose a problem in your failing steps as you can view the source code and potentially how the page looked at the time of the failure.
|
7
|
+
|
8
|
+
Usage
|
9
|
+
-----
|
10
|
+
|
11
|
+
gem install capybara-screenshot
|
12
|
+
|
13
|
+
or update your Gemfile to include:
|
14
|
+
|
15
|
+
group :test do
|
16
|
+
gem 'capybara-screenshot'
|
17
|
+
end
|
18
|
+
|
19
|
+
That's it!
|
20
|
+
|
21
|
+
Repository
|
22
|
+
----------
|
23
|
+
|
24
|
+
Please fork, submit patches or feedback at [https://github.com/mattheworiordan/capybara-screenshot](https://github.com/mattheworiordan/capybara-screenshot)
|
25
|
+
|
26
|
+
The gem details on RubyGems.org can be found at [https://rubygems.org/gems/capybara-screenshot](https://rubygems.org/gems/capybara-screenshot)
|
27
|
+
|
28
|
+
About
|
29
|
+
-----
|
30
|
+
|
31
|
+
This gem was written by **Matthew O'Riordan**
|
32
|
+
|
33
|
+
- [http://mattheworiordan.com](http://mattheworiordan.com)
|
34
|
+
- [@mattheworiordan](http://twitter.com/#!/mattheworiordan)
|
35
|
+
- [Linked In](http://www.linkedin.com/in/lemon)
|
36
|
+
|
37
|
+
License
|
38
|
+
-------
|
39
|
+
|
40
|
+
Copyright © 2011 Matthew O'Riordan, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.
|
data/lib/capybara-screenshot.rb
CHANGED
@@ -4,11 +4,9 @@ module Capybara
|
|
4
4
|
def screen_shot_and_save_page
|
5
5
|
require 'capybara/util/save_and_open_page'
|
6
6
|
path = "/#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}"
|
7
|
-
puts "After body from within Gem: #{page.body}"
|
8
7
|
Capybara.save_page body, "#{path}.html"
|
9
8
|
if page.driver.respond_to?(:render)
|
10
9
|
page.driver.render Rails.root.join "#{Capybara.save_and_open_page_path}" "#{path}.png"
|
11
|
-
puts "Saved screen shot, #{Capybara.save_and_open_page_path}/#{path}.png"
|
12
10
|
end
|
13
11
|
end
|
14
12
|
end
|
metadata
CHANGED
@@ -1,89 +1,121 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-screenshot
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Matthew O'Riordan
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2011-10-20 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: cucumber
|
16
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
25
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 15
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 0
|
33
|
+
version: "1.0"
|
22
34
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
26
37
|
name: capybara
|
27
|
-
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
40
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 15
|
45
|
+
segments:
|
46
|
+
- 1
|
47
|
+
- 0
|
48
|
+
version: "1.0"
|
33
49
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
37
52
|
name: rspec
|
38
|
-
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
39
55
|
none: false
|
40
|
-
requirements:
|
56
|
+
requirements:
|
41
57
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 15
|
60
|
+
segments:
|
61
|
+
- 2
|
62
|
+
- 6
|
63
|
+
version: "2.6"
|
44
64
|
type: :development
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
and HTML file of the current page
|
49
|
-
email:
|
65
|
+
version_requirements: *id003
|
66
|
+
description: When a Cucumber step fails, it is useful to create a screenshot image and HTML file of the current page
|
67
|
+
email:
|
50
68
|
- matthew.oriordan@gmail.com
|
51
69
|
executables: []
|
70
|
+
|
52
71
|
extensions: []
|
72
|
+
|
53
73
|
extra_rdoc_files: []
|
54
|
-
|
74
|
+
|
75
|
+
files:
|
55
76
|
- .gitignore
|
56
77
|
- CHANGELOG.md
|
57
78
|
- Gemfile
|
79
|
+
- LICENSE
|
58
80
|
- README.md
|
59
81
|
- Rakefile
|
60
82
|
- capybara-screenshot.gemspec
|
61
83
|
- lib/capybara-screenshot.rb
|
62
84
|
- lib/capybara-screenshot/version.rb
|
63
85
|
- lib/capybara-screenshot/world.rb
|
86
|
+
has_rdoc: true
|
64
87
|
homepage: http://github.com/mattheworiordan/capybara-screenshot
|
65
88
|
licenses: []
|
89
|
+
|
66
90
|
post_install_message:
|
67
91
|
rdoc_options: []
|
68
|
-
|
92
|
+
|
93
|
+
require_paths:
|
69
94
|
- lib
|
70
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
96
|
none: false
|
72
|
-
requirements:
|
73
|
-
- -
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
hash: 3
|
101
|
+
segments:
|
102
|
+
- 0
|
103
|
+
version: "0"
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
105
|
none: false
|
78
|
-
requirements:
|
79
|
-
- -
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
hash: 3
|
110
|
+
segments:
|
111
|
+
- 0
|
112
|
+
version: "0"
|
82
113
|
requirements: []
|
114
|
+
|
83
115
|
rubyforge_project: capybara-screenshot
|
84
|
-
rubygems_version: 1.
|
116
|
+
rubygems_version: 1.3.7
|
85
117
|
signing_key:
|
86
118
|
specification_version: 3
|
87
|
-
summary: Automatically create snapshots when Cucumber steps fail with Capybara and
|
88
|
-
Rails
|
119
|
+
summary: Automatically create snapshots when Cucumber steps fail with Capybara and Rails
|
89
120
|
test_files: []
|
121
|
+
|