wraith 2.8.0 → 2.8.1

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
  SHA1:
3
- metadata.gz: bf63697eac76217c8011ef49428c9699433a6e89
4
- data.tar.gz: 28179715439e86a3102ec17113e9d2e9ae878997
3
+ metadata.gz: 322bea139215b0b76a3fbee69b95ca2e715b2229
4
+ data.tar.gz: d0c66b25dafb3df3fe601dad9a618c2e924c573c
5
5
  SHA512:
6
- metadata.gz: 8ab5d69ea95075c115620d955f807e507f5f20d481278a3c30b30281d61cf6458bf690958376d08e7d5f9cdf77729425e21838d2b2fd85225c8bb90509d49f2f
7
- data.tar.gz: 88c70548dace9ca18d2210cca2bd3438e18fa2b507383228f1135bb031b739cc4409e93cefe51c87c59da4faa4c569e7b5458226b53b848548f74c0200cace09
6
+ metadata.gz: dd04184a6fc39dd9cedb1a8f099abb4567d740b3650b69ef31ef7c53eea2db97e8cb49e96eb29452e82dfb725695155458b4c3bd96924e3e73062d0e3e7933b2
7
+ data.tar.gz: 22cd83978f44aecb5bbaaf9b72792d9114c6104c9bfd79e41bc884aeb9be49da52d1b9059ea6d723894bfe6983586f420b2df65355a7d23c63b3ba6e68550ab2
data/.travis.yml CHANGED
@@ -6,7 +6,6 @@ script: bundle exec rspec
6
6
  notifications:
7
7
  email:
8
8
  recipients:
9
- - david.blooman@bbc.co.uk
10
9
  - chris.ashton@bbc.co.uk
11
10
  on_failure: change
12
11
  on_success: never
data/README.md CHANGED
@@ -11,122 +11,78 @@
11
11
  <p align="center">
12
12
  Wraith is a screenshot comparison tool, created by developers at BBC News.
13
13
  <br>
14
- <a href="http://responsivenews.co.uk" target="_blank">Website</a> • <a href="http://github.com/bbc-news/wraith" target="_blank">Source</a>
14
+ <a href="http://bbc-news.github.io/wraith/index.html" target="_blank">Documentation</a> • <a href="http://github.com/bbc-news/wraith" target="_blank">Source</a> • <a href="http://responsivenews.co.uk" target="_blank">Responsive News Website</a>
15
15
  </p>
16
16
 
17
17
  ## What is it?
18
18
 
19
- Wraith uses either [PhantomJS](http://phantomjs.org), [CasperJS](http://casperjs.org/) or
20
- [SlimerJS](http://slimerjs.org) to create screen-shots of webpages on different environments
21
- and then creates a diff of the two images, the affected areas are highlighted in
22
- blue
19
+ Wraith uses a headless browser to create screenshots of webpages on different environments (or at different moments in time) and then creates a diff of the two images; the affected areas are highlighted in blue.
23
20
 
24
- ![Photo of BBC News with a
25
- diff](http://bbc-news.github.io/wraith/img/wraith.png)
21
+ ![Photo of BBC News with a diff](http://bbc-news.github.io/wraith/img/wraith.png)
26
22
 
27
23
  ## Documentation
28
24
 
29
- [The main documentation can be found here, this will cover all the features and options for Wraith as well as sample configs.](http://bbc-news.github.io/wraith/index.html)
25
+ For instructions on how to install, set up and use Wraith and all of its features, [visit the Wraith documentation](http://bbc-news.github.io/wraith/index.html).
30
26
 
27
+ A brief overview of how Wraith works is provided below.
31
28
 
32
- ## Requirements
33
-
34
- Imagemagick and PhantomJS are required to use Wraith, install via your favourite package manager. You can also use SlimerJS and CasperJS, CasperJS can be used to target specific selectors. To read our detailed instructions for setup and install, as well as example configs, visit [wraith docs](http://bbc-news.github.io/wraith/index.html)
35
-
36
- ```sh
37
- brew install phantomjs
38
- brew install imagemagick
39
- ```
40
-
41
- ## Installation
42
-
43
- Open terminal and run
44
-
45
- gem install wraith
46
-
47
- You can then run the following to create a template snap.js and config file:
48
-
49
- wraith setup
29
+ ## Wraith modes
50
30
 
51
- ## Using Wraith
52
- You can type `wraith` into terminal to bring up the list of commands, but the one to start Wraith is
31
+ There are several ways in which Wraith can be used:
53
32
 
54
- ```sh
55
- wraith capture config_name
56
- ```
33
+ 1. Comparison of 2 domains (`wraith capture`). There are also some specialist options within this mode:
34
+ * Spidering 2 domains for changes (`wraith capture` when no `paths` property is provided in the configuration file)
35
+ * Running several comparisons at once (`wraith multi_capture`)
36
+ 2. Comparing the same domain over time (`wraith history`, then `wraith latest`)
57
37
 
58
- This assumes that your snap.js and config.yaml are in the folders that were created on setup. To run the setup, create a folder and inside run
38
+ Whichever mode you decide to run Wraith in, the process it follows is generally the same:
59
39
 
60
- ```sh
61
- wraith setup
62
- ```
40
+ * takes screenshots of your webpages
41
+ * runs a comparison task across them
42
+ * outputs a diff PNG file comparing the two images, and a data.txt file which contains the percentage of pixels that have changed
43
+ * packages all of this up into a gallery.html, ready for you to view
44
+ * if any screenshot's diff is above the threshold you specified in your configuration file, the task exits with a system error code (useful for CI)
45
+ * the failed screenshot will also be highlighted in the gallery
63
46
 
64
- ### CLI
65
-
66
- There are other commands also available, these all expect a config_name to be passed as an option. Wraith will look for the config file at `configs/[config_name].yaml`.
67
-
68
- ```sh
69
- wraith capture [config_name] # A full Wraith job
70
- wraith compare_images [config_name] # compares images to generate diffs
71
- wraith crop_images [config_name] # crops images to the same height
72
- wraith generate_gallery [config_name] # create page for viewing images
73
- wraith generate_thumbnails [config_name] # create thumbnails for gallery
74
- wraith history [config_name] # Setup a baseline set of shots
75
- wraith latest [config_name] # Capture new shots to compare with baseline
76
- wraith multi_capture [filelist] # A Batch of Wraith Jobs
77
- wraith reset_shots [config_name] # removes all the files in the shots folder
78
- wraith save_images [config_name] # captures screenshots
79
- wraith setup # creates config folder and default config
80
- wraith setup_folders [config_name] # create folders for images
81
- ```
82
-
83
- ## Output
84
-
85
- After each screenshot is captured, the compare task will run, this will output a diff.png and a data.txt. The data.txt for each file will show the number of pixels that have changed. There is a main data.txt which is in the root of the output folder that will combine all of these values to easier view all the pixel changes.
47
+ ## Requirements
86
48
 
87
- ## Gallery
49
+ [ImageMagick](http://www.imagemagick.org/) is required to compare the screenshots.
88
50
 
89
- A gallery is available to view each of the images and the respective diff images located in the shots folder once all the images have been compared. You can set thresholds in the config file, if above this value, the gallery will indicate the shots above the threshold.
51
+ Wraith also requires at least one of these headless browsers:
90
52
 
91
- ## Changelog - updated 2014-12-09
92
- In the latest release I have implemented thresholds for Wraith, this makes finding failed shots easier. Set the threshold value in the config to a value you want, by default it is 0. When a failure is detected, the terminal will show a failure message and the gallery will have a red cross next to the set of shots.
53
+ * [PhantomJS](http://phantomjs.org)
54
+ * [CasperJS](http://casperjs.org/) (which can be used to target specific selectors)
55
+ * [SlimerJS](http://slimerjs.org)
93
56
 
94
57
  ## Contributing
95
58
 
96
59
  If you want to add functionality to this project, pull requests are welcome.
97
60
 
98
- * Create a branch based off master and do all of your changes with in it.
99
- * If you have to pause to add a 'and' anywhere in the title, it should be two pull requests.
100
- * Make commits of logical units and describe them properly
61
+ * Fork a branch based off BBC-News/wraith:master and do all of your changes within it.
62
+ * Make commits of logical units and describe them properly.
101
63
  * Check for unnecessary whitespace with git diff --check before committing.
102
64
  * If possible, submit tests to your patch / new feature so it can be tested easily.
103
- * Assure nothing is broken by running all the test
65
+ * Assure nothing is broken by running all the tests (`bundle exec rspec`).
104
66
  * Please ensure that it complies with coding standards.
67
+ * When writing the title of your Pull Request, if you have to pause to add an 'and' anywhere in the title - it should be two pull requests.
105
68
 
106
69
  **Please raise any issues with this project as a GitHub issue.**
107
70
 
108
71
  ## License
109
72
 
110
- Wraith is available to everyone under the terms of the Apache 2.0 open source license.
111
- Take a look at the LICENSE file in the code.
73
+ Wraith is available to everyone under the terms of the Apache 2.0 open source license. [Take a look at Wraith's LICENSE file](https://github.com/BBC-News/wraith/blob/master/LICENSE).
112
74
 
113
75
  ## Credits
114
76
 
115
77
  * [Dave Blooman](https://twitter.com/dblooman)
116
78
  * [John Cleveley](https://twitter.com/jcleveley)
117
79
  * [Simon Thulbourn](https://twitter.com/sthulb)
80
+ * [Chris Ashton](https://twitter.com/chrisbashton)
118
81
 
119
82
  ## Selenium-Wraith
120
83
 
121
- Anyone interested in integrating selenium capability with Wraith should check out
122
- Selenium-Wraith by Andrew Tekle-Cadman of Future Visible.
123
-
124
- Selenium-Wraith was forked from the BBC repo on 16/04/14 and adds the following capabilities to Wraith
84
+ Anyone interested in integrating selenium capability with Wraith should check out [Selenium-Wraith](https://github.com/andrewccadman/wraith-selenium) (by Andrew Tekle-Cadman of Future Visible), which was forked from BBC's Wraith on 16/04/14 and adds the following capabilities:
125
85
 
126
86
  1. Selenium integration, both running locally on a desktop or on a selenium grid
127
87
  2. Browser to browser screenshot comparison
128
88
  3. Page component-based comparison
129
-
130
- You can check out Andrew's Project on GitHub here:
131
-
132
- https://github.com/andrewccadman/wraith-selenium
@@ -64,11 +64,15 @@ class Wraith::GalleryGenerator
64
64
  def figure_out_url(group, category)
65
65
  root = wraith.domains["#{group}"]
66
66
  return '' if root.nil?
67
- path = wraith.paths["#{category}"]['path']
67
+ path = get_path(category)
68
68
  url = root + path
69
69
  url
70
70
  end
71
71
 
72
+ def get_path(category)
73
+ wraith.paths[category]['path'] || wraith.paths[category]
74
+ end
75
+
72
76
  def get_group_from_match(match)
73
77
  group = match[2]
74
78
  dash = match[2].rindex('-')
@@ -49,7 +49,9 @@
49
49
  <a href="<%=file[:filename]%>">
50
50
  <img class="short-screenshot img-thumbnail" src="<%=path%><%=file[:thumb]%>">
51
51
  </a>
52
- <p class="text-center"><%=file[:name]%></p>
52
+ <p class="text-center">
53
+ <a href="<%=file[:url]%>" target="_blank"><%=file[:name]%></a>
54
+ </p>
53
55
  </div>
54
56
  <% end %>
55
57
  <div class="col-lg-3">
@@ -76,4 +78,4 @@
76
78
  </div>
77
79
  </div>
78
80
  </body>
79
- </html>
81
+ </html>
@@ -1,3 +1,3 @@
1
1
  module Wraith
2
- VERSION = "2.8.0"
2
+ VERSION = "2.8.1"
3
3
  end
File without changes
data/spec/wraith_spec.rb CHANGED
@@ -109,27 +109,27 @@ describe Wraith do
109
109
 
110
110
  images = [
111
111
  {
112
- :filename => 'test/test_image-1.png',
113
- :thumb => 'thumbnails/test/test_image-1.png'
112
+ :filename => 'home/test_image-afrique.png',
113
+ :thumb => 'thumbnails/home/test_image-afrique.png'
114
114
  },
115
115
  {
116
- :filename => 'test/test_image-2.png',
117
- :thumb => 'thumbnails/test/test_image-2.png'
116
+ :filename => 'home/test_image-russian.png',
117
+ :thumb => 'thumbnails/home/test_image-russian.png'
118
118
  }
119
119
  ]
120
120
 
121
- dirs['test'][0][:variants].each_with_index do |image, i|
121
+ dirs['home'][0][:variants].each_with_index do |image, i|
122
122
  expect(image[:filename]).to eq images[i][:filename]
123
123
  expect(image[:thumb]).to eq images[i][:thumb]
124
124
  end
125
125
 
126
126
  diff = {
127
- :filename => 'test/test_image-diff.png',
128
- :thumb => 'thumbnails/test/test_image-diff.png'
127
+ :filename => 'home/test_image-diff.png',
128
+ :thumb => 'thumbnails/home/test_image-diff.png'
129
129
  }
130
130
 
131
- expect(dirs['test'][0][:diff][:filename]).to eq 'test/test_image-diff.png'
132
- expect(dirs['test'][0][:diff][:thumb]).to eq 'thumbnails/test/test_image-diff.png'
131
+ expect(dirs['home'][0][:diff][:filename]).to eq 'home/test_image-diff.png'
132
+ expect(dirs['home'][0][:diff][:thumb]).to eq 'thumbnails/home/test_image-diff.png'
133
133
  end
134
134
  end
135
135
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wraith
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Blooman
@@ -10,160 +10,160 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-11-05 00:00:00.000000000 Z
13
+ date: 2015-11-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pry
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - '>='
19
+ - - ">="
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - '>='
26
+ - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  version: '0'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rspec
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - '>='
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: '0'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - '>='
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rake
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - '>='
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: image_size
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - '>='
61
+ - - ">="
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - '>='
68
+ - - ">="
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: anemone
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - '>='
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - '>='
82
+ - - ">="
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: robotex
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - '>='
89
+ - - ">="
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - '>='
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: nokogiri
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - '>='
103
+ - - ">="
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  type: :runtime
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - '>='
110
+ - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: log4r
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - '>='
117
+ - - ">="
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  type: :runtime
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - '>='
124
+ - - ">="
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: thor
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - '>='
131
+ - - ">="
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  type: :runtime
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - '>='
138
+ - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: parallel
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - '>='
145
+ - - ">="
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  type: :runtime
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
- - - '>='
152
+ - - ">="
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: casperjs
157
157
  requirement: !ruby/object:Gem::Requirement
158
158
  requirements:
159
- - - '>='
159
+ - - ">="
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  type: :runtime
163
163
  prerelease: false
164
164
  version_requirements: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - '>='
166
+ - - ">="
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  description: Wraith is a screenshot comparison tool, created by developers at BBC
@@ -177,11 +177,11 @@ executables:
177
177
  extensions: []
178
178
  extra_rdoc_files: []
179
179
  files:
180
- - .gemset
181
- - .gitignore
182
- - .rubocop.yml
183
- - .ruby-version
184
- - .travis.yml
180
+ - ".gemset"
181
+ - ".gitignore"
182
+ - ".rubocop.yml"
183
+ - ".ruby-version"
184
+ - ".travis.yml"
185
185
  - Dockerfile
186
186
  - Gemfile
187
187
  - LICENSE
@@ -210,9 +210,9 @@ files:
210
210
  - spec/helpers.rb
211
211
  - spec/js/global.js
212
212
  - spec/js/path.js
213
- - spec/thumbnails/test/test_image-1.png
214
- - spec/thumbnails/test/test_image-2.png
215
- - spec/thumbnails/test/test_image-diff.png
213
+ - spec/thumbnails/home/test_image-afrique.png
214
+ - spec/thumbnails/home/test_image-diff.png
215
+ - spec/thumbnails/home/test_image-russian.png
216
216
  - spec/wraith_spec.rb
217
217
  - templates/README.md
218
218
  - templates/configs/component.yaml
@@ -237,17 +237,17 @@ require_paths:
237
237
  - lib
238
238
  required_ruby_version: !ruby/object:Gem::Requirement
239
239
  requirements:
240
- - - '>='
240
+ - - ">="
241
241
  - !ruby/object:Gem::Version
242
242
  version: '0'
243
243
  required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  requirements:
245
- - - '>='
245
+ - - ">="
246
246
  - !ruby/object:Gem::Version
247
247
  version: '0'
248
248
  requirements: []
249
249
  rubyforge_project:
250
- rubygems_version: 2.4.8
250
+ rubygems_version: 2.4.5.1
251
251
  signing_key:
252
252
  specification_version: 4
253
253
  summary: Wraith is a screenshot comparison tool, created by developers at BBC News.
@@ -259,7 +259,7 @@ test_files:
259
259
  - spec/helpers.rb
260
260
  - spec/js/global.js
261
261
  - spec/js/path.js
262
- - spec/thumbnails/test/test_image-1.png
263
- - spec/thumbnails/test/test_image-2.png
264
- - spec/thumbnails/test/test_image-diff.png
262
+ - spec/thumbnails/home/test_image-afrique.png
263
+ - spec/thumbnails/home/test_image-diff.png
264
+ - spec/thumbnails/home/test_image-russian.png
265
265
  - spec/wraith_spec.rb