-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
460 lines (450 loc) · 20.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Picture This: Automated Visual Regression Testing</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/league.css" id="theme">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<style>
#no-transform {
text-transform: none;
}
#footer {
position: absolute;
display: block;
height: 23px;
bottom: 23px;
left: 255px;
font-weight: bold;
}
#zero-padding {
padding: 0 0 0;
}
#bigger-image {
max-width: 100%;
height: auto;
}
#center {
text-align: center;
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1>Picture This</h1>
<h2>Automated Visual Regression Testing</h2>
</section>
<section data-autoslide="1000">
<h2 id="no-transform">but first, What is Jeff Koenig?</h2>
<p class="fragment" style="position: absolute;left: 4px;top: -40px;">QA</p>
<p class="fragment" style="position: absolute;left: 75%;top: -60px;">Manager</p>
<p class="fragment" style="position: absolute;left: 75%;top: 180px;">Automator</p>
<p class="fragment" style="position: absolute;left: 50%;top: 160px;">Dev</p>
<p class="fragment" style="position: absolute;left: 35%;top: 200px;">Ops</p>
<p class="fragment" data-autoslide="0" style="position: absolute;left: 10%;top: 150px;">DevOps</p>
</section>
<section>
<h2 id="no-transform">I <3 Gifs</h2>
<img src="media/fail.gif">
</section>
<section>
<section>
<h2 id="no-transform">What is Visual Regression Testing?</h2>
<aside class="notes">
There are many tools for testing behavior, but not many that test the way software looks. That is where Visual Regession Testing comes in.
</aside>
</section>
<section data-background-video="media/unit_vs_integration.mp4" data-background-video-loop data-background-video-muted>
</section>
<section>
<img id="bigger-image" src="media/unit_vs_integration_drawers.jpg">
</section>
<section>
<h2 id="no-transform">VRT verifies how a page L👀ks</h2>
</section>
<section>
<h3 id="no-transform">Example</h3>
<table>
<tr>
<td id="zero-padding">
<img id="bigger-image" src="media/good.png">
</td>
<td id="zero-padding">
<img id="bigger-image" src="media/bad.png">
</td>
</tr>
<tr>
<td id="center">
<p>Good</p>
</td>
<td id="center">
<p>Bad</p>
</td>
</tr>
</table>
<aside class="notes">
This means doing a pixel by pixel comparison
</aside>
</section>
</section>
<section>
<section>
<h2 id="no-transform">Why do we need VRT?</h2>
</section>
<section>
<h3 id="no-transform">Why do we need VRT?</h3>
<p style="font-size: 1.4em">Browsers are unreliable and inconsistent</p>
</section>
<section>
<h3 id="no-transform">Why do we need VRT?</h3>
<p style="font-size: 1.4em">Too many environments to test manually</p>
<p class="fragment">BrowserStack Supports 987 enviornments</p>
</section>
<section>
<h3 id="no-transform">Why do we need VRT?</h3>
<p class="fragment">Because it is annoying to manually test the same thing acrossing a bunch of different browsers</p>
<img src="media/manual_testing_is_boring.gif">
<aside class="notes">
Tester fatigue can become a real problem
</aside>
</section>
<section>
<h2 id="no-transform">Example</h2>
<a href="http://blog.aspiresys.com/testing/planning-your-browser-compatibility-tests/"><img src="media/different_browser_displays.jpg"></a>
</section>
</section>
<section>
<section>
<h2 id="no-transform">Are any of you doing Visual Regression Testing already?</h2>
</section>
<section>
<h2 id="no-transform">Why aren't we all doing it?</h2>
</section>
<section>
<h1>So many bad tools</h1>
<img src="media/hammer_wall.gif"/>
</section>
<section>
<h2 id="no-transform">Well..</h2>
<h2 id="no-transform">not bad,</h2>
<h2 id="no-transform">just meant for other things</h2>
<aside class="notes">
Wrong tools for the job
</aside>
</section>
<section>
<h2 id="no-transform">Tools that came before</h2>
</section>
<section>
<h2 id="no-transform"><a target="_blank" href="https://github.com/xebia/VisualReview">VisualReview</a></h2>
<p class="fragment">Server based tool, and requires manual review for approving/rejecting diffs</p>
<img class="fragment" style="position:absolute; left: 357px; top:100px;" src="media/toss_it_out.gif">
</section>
<section>
<h2 id="no-transform"><a target="_blank" href="https://github.com/wearefriday/spectre">Spectre</a></h2>
<p class="fragment">Server based as well, this one allows for a bit more integration and will pass/fail each image, for manual review</p>
<img class="fragment" style="position: absolute; left: 327px; top:100px;" src="media/go_away.gif">
</section>
<section>
<h2 id="no-transform"><a target="_blank" href="https://github.com/BBC-News/wraith">Wraith</a></h2>
<p class="fragment">Using a headless browser, takes and compares screenshots across domains, or between a domain and a history of screenshots.</p>
<img class="fragment" style="position: absolute; left: 277px; top:100px;" src="media/no.gif">
</section>
<section>
<h2 id="no-transform"><a target="_blank" href="https://github.com/andrewccadman/wraith-selenium">Selenium Wraith</a></h2>
<p class="fragment">Wraith, but with selenium support, but compares all browsers to the same baseline image</p>
<img class="fragment" style="position: absolute; left: 333px; top:53px;max-height: none; height: auto; width: 300px;" src="media/unacceptable.gif">
<aside class="notes">
This means there is a lot of weird croping and resizing to make the images the same size for comparing
</aside>
</section>
<section>
<h2 id="no-transform"><a target="_blank" href="https://github.com/Huddle/Resemble.js">Resemble.js</a></h2>
<p class="fragment">Generates really nice image differences</p>
<img class="fragment" src="media/resemble_diff.jpeg">
</section>
<section>
<h2 id="no-transform"><a target="_blank" href="https://github.com/Huddle/PhantomCSS">PhantomCSS</a></h2>
<p class="fragment" >uses headless browsers, focuses on CSS Regression Testing</p>
<img class="fragment" style="position: absolute; left: 236px; height: auto; max-height: none; top: 17px; width: 500px;" src="media/out_the_window.gif">
</section>
<section>
<h2 id="no-transform">The Problems with these tools</h2>
<ul>
<li class="fragment">Requires more infrastructure</li>
<li class="fragment">Requires a completly seperate test framework</li>
<li class="fragment">Really only work well for static sites</li>
<li class="fragment">Must use real browsers to be affective</li>
<li class="fragment">No clear test result(Pass/Fail)</li>
<li class="fragment">This makes it difficult for using with CI</li>
</ul>
</section>
</section>
<section>
<section>
<h1 id="no-transform">The Tools</h1>
</section>
<section>
<h1 id="no-transform"><a target="_blank" href="https://github.com/compatriot/compatriot">Compatriot</a></h1>
<aside class="notes">
Written in ruby<br>
Tool designed to work with Capybara by adding a `assert_no_ui_changes` method
</aside>
</section>
<section>
<h3 id="no-transform">Example</h3>
<pre><code data-trim data-noescape>
describe 'a page' do
it 'has not changed visually' do
visit url
assert_no_ui_changes
end
end
</code></pre>
</section>
<section>
<h3 id="no-transform">For multiple assertions per test</h3>
<pre><code data-trim data-noescape>
describe 'a page' do
it 'has not changed visually' do
visit url
assert_no_ui_changes 'part 1'
click_on link
assert_no_ui_changes 'part 2'
end
end
</code></pre>
</section>
<section>
<h3>Looks like your Unit and Integration tests, but they should be kept and run separately</h3>
<aside class="notes">
Because we are gonna rerun this set of tests in all our supporeted enviornments
</aside>
</section>
<section>
<div style="background-color: white;max-height: 375px;max-width: 578px;margin: auto">
<a href="https://www.browserstack.com/">
<img src="media/browserstack-logo-600x315.png">
</a>
</div>
<aside class="notes">
Scalable
Fantastic Customer Support
</aside>
</section>
</section>
<section>
<section>
<h2 id="no-transform">The Process</h2>
</section>
<section>
<h2 id="no-transform">Control Images</h2>
<aside class="notes">
Control Images should be stored in your repository for each supported environment.
This gives you a history to understand how things changed and why.
</aside>
</section>
<section>
<h2 id="no-transform">Lets Talk Image Diffing</h2>
<aside class="notes">
Process of comparing two images
</aside>
</section>
<section>
<h2 id="no-transform">How do we do it?</h2>
</section>
<section>
<h2 id="no-transform">It's sooo simple!!!</h2>
</section>
<section>
<img src="media/Standard_Model_Lagrangian_Density.png" style="margin: -48px">
<img class="fragment" src="media/i_dont_believe_you.gif" style="z-index: 100; position: absolute; left: 294px; top: 160px;">
</section>
<section>
<h2 id="no-transform">Example</h2>
<pre><code data-trim data-noescape>
def self.color_difference_of_pixels(pixel1, pixel2)
score = Math.sqrt(
(r(pixel2) - r(pixel1)) ** 2 +
(g(pixel2) - g(pixel1)) ** 2 +
(b(pixel2) - b(pixel1)) ** 2
) / Math.sqrt(MAX ** 2 * 3)
[grayscale(MAX - (score * MAX).round), score]
end
</code></pre>
<div style="font-size: 0.5em">
Thanks to <a href="http://jeffkreeftmeijer.com">Jeff Kreeftmeijer</a>,<br>
and his blog post<br>
<a href="http://jeffkreeftmeijer.com/2011/comparing-images-and-creating-image-diffs/">Comparing images and creating image diffs</a>
</div>
<aside class="notes">
MAX is maximum value of each of the 4 commponents of an image(RGBA), which is 255
</aside>
</section>
<section>
<h2 id="no-transform">Example</h2>
<table>
<tr>
<td id="zero-padding">
<img id="bigger-image" src="media/base_image.png">
</td>
<td id="zero-padding">
<img id="bigger-image" src="media/variable_image.png">
</td>
<td id="zero-padding">
<img class="fragment" id="bigger-image" data-fragment-index="2" src="media/diff_image.png">
</td>
</tr>
<tr>
<td id="center">
<p>Control</p>
</td>
<td id="center">
<p>Variable</p>
</td>
<td id="center">
<p>Diff</p>
</td>
</tr>
</table>
</section>
<section>
<h2>Assert Diff < Threshold</h2>
<h4 class="fragment">default threshold is 0.05%</h4>
</section>
</section>
<section>
<section>
<h2 id="no-transform">What I've learned on my adventure</h2>
</section>
<section>
<h2 id="no-transform">Tests are slow</h2>
<ul>
<li class="fragment">but can be parallelized!</li>
</ul>
<aside class="notes">
but they can be parallelized and kept small and efficient, it's not so bad
</aside>
</section>
<section>
<h2>Retries</h2>
<p>Reduces noise from page rendering speeds</p>
</section>
<section>
<h2>Variable Data Generation</h2>
<h4 >When shown on the page</h4>
<h4 >ie. Names, Usernames</h4>
<aside class="notes">
If these variables are shown on the page, they can cause false differences
</aside>
</section>
</section>
<section>
<section>
<h2 id="no-transform">What still needs some polish?</h2>
</section>
<section>
<h2 id="no-transform">Browser Driver are still very inconsistent</h2>
<ul>
<li>Full Page Screenshots</li>
<li>Inconsistency with driver support</li>
<aside class="notes">
Some browsers support hovering, some verying degree of access executing javascript on the page
</aside>
</ul>
</section>
</section>
<section>
<h3 id="no-transform">Better Diffing, Like ResembleJS</h3>
<table>
<tr>
<td id="zero-padding">
<img id="bigger-image" data-fragment-index="1" src="media/base_image.png">
</td>
<td id="zero-padding">
<img id="bigger-image" data-fragment-index="1" src="media/variable_image.png">
</td>
<td id="zero-padding">
<img class="fragment" id="bigger-image" src="media/resemble_diff.png">
</td>
</tr>
<tr>
<td id="center">
<p>Control</p>
</td>
<td id="center">
<p>Variable</p>
</td>
<td id="center">
<p>Diff</p>
</td>
</tr>
</table>
</section>
<section>
<h1>THE END</h1>
</section>
<section>
<h2>LINKS!!!</h2>
<ul>
<h4>Me</h4>
<li>Twitter: <a href="http://twitter.com/jeffkoenig">@JeffKoenig</a></li>
<li>Github: <a href="http://github.com/TheJefe">TheJefe</a></li>
<li>These Slides: <a href="http://TheJefe.github.io/picture_this/">TheJefe.github.io/picture_this/</a></li>
</br>
<h4>Tools</h4>
<li><a href="https://github.com/compatriot/compatriot">Compatriot</a></li>
<li><a href="https://browserstack.com">BrowserStack</a></li>
<li><a href="http://www.seleniumhq.org/">Selnium</a></li>
</ul>
</section>
<div id="footer" style="display: inline;">
<i class="fa fa-twitter fw" aria-hidden="true" style="display: inline;"></i><a href="https://twitter.com/jeffkoenig">JeffKoenig</a> | <i class="fa fa-github" aria-hidden="true" style="display: inline;"></i><a href="https://github.com/TheJefe">TheJefe</a>
</div>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
history: true,
transition: 'convex', // none/fade/slide/convex/concave/zoom/cube/page
/* parallaxBackgroundImage: 'media/hawk.jpg',*/
/* parallaxBackgroundImage: 'media/dark_city.jpeg',*/
/* parallaxBackgroundImage: 'media/reveal-parallax-1.jpg',*/
/* parallaxBackgroundImage: 'https://colorlib.com/illdy/wp-content/uploads/sites/11/2016/02/photo-1447687643809-e05fd462f350.jpg',*/
parallaxBackgroundSize: '2560px 1440px', // CSS syntax, e.g. "2100px 900px",
keyboard: {
48: function() { Reveal.slide( 0 ) },
},
menu: {
openButton: false,
},
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'socket.io/socket.io.js', async: true },
{ src: 'plugin/notes-server/client.js', async: true },
{ src: 'plugin/reveal.js-menu/menu.js' },
]
});
</script>
</body>
</html>