rspec-page-regression 0.2.99 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -5
- data/lib/rspec/page-regression/matcher.rb +2 -2
- data/lib/rspec/page-regression/version.rb +1 -1
- data/rspec-page-regression.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 989c90a06a9ad0ad6e5e69c61118c8960999019e
|
4
|
+
data.tar.gz: a1ef462d3075a522528bc39fb7b076a84ed9ba30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07a4e7baeee04af73847b73030880baee7d6b06d81acc6edbad15f5a3ea65ae4c94e8da465ec4ed9584b81053038227430b4fcb053a22c7a6d77dcaa99714006
|
7
|
+
data.tar.gz: 195e79f35b7e35511be05af0bb01a3a177a919f7f48197efe6ed3401b15f2373abc59901770e6977200c3762ef2c5172b9a3d17895d27f2174586d68e38333b2
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ that makes it easy to headlessly regression test your web application pages to m
|
|
11
11
|
|
12
12
|
It provides an RSpec matcher that compares the test snapshot to an expected image, and facilitates management of the images.
|
13
13
|
|
14
|
-
Rspec-page-regression uses [PhantomJS](http://www.phantomjs.org/) to headlessly render web page snapshots, by virtue of the [Poltergeist](https://github.com/jonleighton/poltergeist) driver for [Capybara](https://github.com/jnicklas/capybara).
|
14
|
+
Rspec-page-regression uses [PhantomJS](http://www.phantomjs.org/) to headlessly render web page snapshots, by virtue of the [Poltergeist](https://github.com/jonleighton/poltergeist) driver for [Capybara](https://github.com/jnicklas/capybara). You can also use the Selenium driver to test against real browsers.
|
15
15
|
|
16
16
|
|
17
17
|
## Installation
|
@@ -34,6 +34,18 @@ And in your spec_helper:
|
|
34
34
|
|
35
35
|
Rspec-page-regression presupposes the convention that your spec files are somwhere under a directory named `spec` (checked in to your repo), which has a sibling directory `tmp` (.gitignore'd)
|
36
36
|
|
37
|
+
To install for use with Selenium, [see instructions below](#selenium).
|
38
|
+
|
39
|
+
#### Note on versions:
|
40
|
+
Rspec-page-regression has multiple versions that work in concert with the [significant changes in RSpec version 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3). If you're using bundler, the gem dependencies should automatically find the proper version of rspec-page-regression for your chosen version of RSpec.
|
41
|
+
|
42
|
+
| Rspec Version | Rspec-page-regression |
|
43
|
+
| ------------- | --------------------- |
|
44
|
+
| >= 3.0.* | >= 0.3.0 |
|
45
|
+
| 2.99 | 0.2.99 |
|
46
|
+
| <= 2.14.* | <= 0.2.1 |
|
47
|
+
|
48
|
+
|
37
49
|
## Usage
|
38
50
|
|
39
51
|
Rspec-page-regression provides a matcher that renders the page and compares
|
@@ -47,14 +59,14 @@ the resulting image against an expected image. To use it, you need to enable Ca
|
|
47
59
|
visit my_page_path
|
48
60
|
end
|
49
61
|
|
50
|
-
it { page.
|
62
|
+
it { expect(page).to match_expectation }
|
51
63
|
|
52
64
|
context "popup help" do
|
53
65
|
before(:each) do
|
54
66
|
click_button "Help"
|
55
67
|
end
|
56
68
|
|
57
|
-
it { page.
|
69
|
+
it { expect(page).to match_expectation }
|
58
70
|
end
|
59
71
|
end
|
60
72
|
|
@@ -92,7 +104,7 @@ As per the above examples, the expectation images default to being stored under
|
|
92
104
|
|
93
105
|
If that default scheme doesn't suit you, you can pass a path to where the expectation image should be found:
|
94
106
|
|
95
|
-
page.
|
107
|
+
expect(page).to match_expectation "/path/to/my/file.png"
|
96
108
|
|
97
109
|
Everything will work normally, and the failure messages will refer to your path.
|
98
110
|
|
@@ -107,7 +119,7 @@ The default window size for the renders is 1024 x 768 pixels. You can specify a
|
|
107
119
|
|
108
120
|
Note that this specifies the size of the browser window viewport; but rspec-page-regression requests a render of the full page, which might extend beyond the window. So the rendered file dimensions may be larger than this configuration value.
|
109
121
|
|
110
|
-
|
122
|
+
## [Using the selenium driver](id:selenium)
|
111
123
|
|
112
124
|
You can also use the selenium driver with capybara. This offers the possiblity to visually test your pages against a range of real browsers.
|
113
125
|
|
@@ -144,6 +156,10 @@ Don't forget to include specs (`rake spec`) to verify your functionality. Code
|
|
144
156
|
|
145
157
|
Release Notes:
|
146
158
|
|
159
|
+
* 0.3.0 - Compatibility with rspec 3.0
|
160
|
+
|
161
|
+
* 0.2.99 - Compatibility with rspec 2.99
|
162
|
+
|
147
163
|
* 0.2.1 - Explicit dependency on rspec ~> 2.14.0
|
148
164
|
|
149
165
|
* 0.2.0 - Support selenium. Thanks to [@edwinvdgraaf](https://github.com/edwinvdgraaf)
|
@@ -11,7 +11,7 @@ module RSpec::PageRegression
|
|
11
11
|
@comparison.result == :match
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
failure_message do |page|
|
15
15
|
msg = case @comparison.result
|
16
16
|
when :missing_expected then "Missing expectation image #{@filepaths.expected_image}"
|
17
17
|
when :missing_test then "Missing test image #{@filepaths.test_image}"
|
@@ -29,7 +29,7 @@ module RSpec::PageRegression
|
|
29
29
|
msg
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
failure_message_when_negated do |page|
|
33
33
|
"Test image expected to not match expectation image"
|
34
34
|
end
|
35
35
|
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "activesupport"
|
22
22
|
spec.add_dependency "oily_png"
|
23
23
|
spec.add_dependency "poltergeist"
|
24
|
-
spec.add_dependency "rspec", "
|
24
|
+
spec.add_dependency "rspec", "~> 3.0"
|
25
25
|
spec.add_dependency "which_works"
|
26
26
|
|
27
27
|
spec.add_development_dependency "bourne"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-page-regression
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ronen barzel
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '3.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '3.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: which_works
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|