automated visual testing that doesn't suck!

48
Adam Carmi (@carmiadam) Co-Founder and VP R&D at Applitools [email protected] AUTOMATED VISUAL TESTING THAT DOES NOT SUCK

Upload: applitools

Post on 26-Jul-2015

127 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Automated Visual Testing That Doesn't Suck!

Adam Carmi (@carmiadam)Co-Founder and VP R&D at Applitools

[email protected]

AUTOMATED VISUAL TESTING THAT DOES

NOT SUCK

Page 2: Automated Visual Testing That Doesn't Suck!

YOU CAN AND SHOULD AUTOMATE YOUR VISUAL

TESTS!

Page 3: Automated Visual Testing That Doesn't Suck!
Page 4: Automated Visual Testing That Doesn't Suck!

AGENDA

Why automated visual testing?Tools & TechnologyWhere does it fit?

Page 5: Automated Visual Testing That Doesn't Suck!

WHAT IS VISUAL TESTING?

A quality assurance activity aimed to verify that a

Graphical User Interface appears correctly to users

Page 6: Automated Visual Testing That Doesn't Suck!

A VISUAL BUG

Page 7: Automated Visual Testing That Doesn't Suck!

WHY SHOULD IT BE AUTOMATED?

THE TEST MATRIX IS TOO BIG TO APPROXIMATE MANUALLY

Web browsers Operating systems Screen resolutions Responsive designs L10n

Page 8: Automated Visual Testing That Doesn't Suck!

WHY SHOULD IT BE AUTOMATED?

Page 9: Automated Visual Testing That Doesn't Suck!

MANUALVISUALTESTINGISERRORPRONE

WHY SHOULD IT BE AUTOMATED?

Page 10: Automated Visual Testing That Doesn't Suck!

WHY SHOULD IT BE AUTOMATED?

Many are already doing it (and sharing)…

PhantomCSS Fighting Layout Bugs

CSSCritiqueWraith

Needle

Grunt PhotoBox

dpdxt

WebdriverCSS

EyesHuxley

FBSnapshotTestCase

GeminiSelenium Visual Diff

VisualCeption

Specter

Snap And Compare

Page 11: Automated Visual Testing That Doesn't Suck!

AGENDA

Why automated visual testing?Tools & TechnologyWhere does it fit?

Page 12: Automated Visual Testing That Doesn't Suck!

THE WORKFLOW Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 13: Automated Visual Testing That Doesn't Suck!

DEMOhttps://github.com/webdriverio/webdrivercss

Page 14: Automated Visual Testing That Doesn't Suck!

THE WORKFLOW Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 15: Automated Visual Testing That Doesn't Suck!

DRIVING AND CAPTURING

OTHER

PhantomCSS (CasperJS)

Fighting Layout Bugs (Java) CSSCritique (URLs)Wraith (URLs)

Needle (Python)Grunt PhotoBox (URLs)

WebdriverCSS (JS)

Eyes (All)

Huxley (RP)

FBSnapshotTestCaseSelenium Visual Diff (Java)

VisualCeption (PHP)

Specter (JS)

Wraith-Selenium (Ruby)

Snap And Compare (URLs)

Eyes (All)

Gemini (JS)

dpdxt (URLs)

Gemini (JS)

Page 16: Automated Visual Testing That Doesn't Suck!

SCREENSHOTS

Real browsers?Full page?Frames?Regions?Viewport size?Page stabilization?Page preparation?

Page 17: Automated Visual Testing That Doesn't Suck!

THE WORKFLOW Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 18: Automated Visual Testing That Doesn't Suck!
Page 19: Automated Visual Testing That Doesn't Suck!

WHY NOT?

FALSE POSITIVES

Page 20: Automated Visual Testing That Doesn't Suck!

ANTI-ALIASING?

Page 21: Automated Visual Testing That Doesn't Suck!

ANTI ALIASING 1/2

Page 22: Automated Visual Testing That Doesn't Suck!

ANTI ALIASING 2/2

Page 23: Automated Visual Testing That Doesn't Suck!

BRIGHTNESS 1/2

Page 24: Automated Visual Testing That Doesn't Suck!

BRIGHTNESS 2/2

Page 25: Automated Visual Testing That Doesn't Suck!

SUB PIXEL SHIFTS 1/2

Page 26: Automated Visual Testing That Doesn't Suck!

SUB PIXEL SHIFTS 2/2

Page 27: Automated Visual Testing That Doesn't Suck!

SUB PIXEL SHIFTS 1/2

Page 28: Automated Visual Testing That Doesn't Suck!

SUB PIXEL SHIFTS 2/2

Page 29: Automated Visual Testing That Doesn't Suck!

AND MORE…1 pixel offsets in element positioning

Dynamic contentMoving elementsImages of different size

Page 30: Automated Visual Testing That Doesn't Suck!
Page 31: Automated Visual Testing That Doesn't Suck!

Image Comparison APIs

Page 32: Automated Visual Testing That Doesn't Suck!

ImageMagick A powerful command line tool for image processing. APIs are available for most programming languages. Fuzzing is used to eliminate slight color differences An error ratio is usually used to determine a match

$ compare –metric AE –fuzz 5% img1.png img2.png diff.png

2246

Page 33: Automated Visual Testing That Doesn't Suck!

Resemble.js An image comparison tool

implemented in Javascript Used by PhantomCSS and other

tools. Good de-antialiasing An error ratio is usually used to

determine a match http://huddle.github.io/Resemble.js/

Page 34: Automated Visual Testing That Doesn't Suck!

Applitools Eyes A specialized image processing stack

designed to compare computer generated UI images Anti-aliasing Partial and full pixel offsets Images of different size Dynamic content Moving elements Layout matching

Available as a cloud service

Page 35: Automated Visual Testing That Doesn't Suck!

DEMO

Page 36: Automated Visual Testing That Doesn't Suck!

THE WORKFLOW Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 37: Automated Visual Testing That Doesn't Suck!

REPORT DIFFERENCESAs files on the file system (combined with source control)

Page 38: Automated Visual Testing That Doesn't Suck!

REPORT DIFFERENCESAs a Gallery (example from Selenium Visual Diff)

Page 39: Automated Visual Testing That Doesn't Suck!

THE WORKFLOW Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 40: Automated Visual Testing That Doesn't Suck!

UPDATE THE BASELINE

Rename or commit individual image files

Overwrite mode

Page 41: Automated Visual Testing That Doesn't Suck!

UPDATE THE BASELINE

GUI (Gemini GUI)

Automatic maintenance (demo)

Page 42: Automated Visual Testing That Doesn't Suck!

AGENDA

Why automated visual testing?Tools & TechnologyWhere does it fit?

Page 43: Automated Visual Testing That Doesn't Suck!

WHERE DOES IT FIT?

• Components

• Code review

• Developers

• Designers• QA

Page 44: Automated Visual Testing That Doesn't Suck!

WHERE DOES IT FIT?

• Pages• Page

sections

• Developers

• Designers• QA• Others

Page 45: Automated Visual Testing That Doesn't Suck!

WHERE DOES IT FIT?

• Staging vs. Production

• Ops• QA

Page 46: Automated Visual Testing That Doesn't Suck!

WHERE DOES IT FIT?

• Monitoring

• Ops• QA

Page 47: Automated Visual Testing That Doesn't Suck!

QUESTIONS?

Page 48: Automated Visual Testing That Doesn't Suck!

Adam Carmi (@carmiadam)Co-Founder and VP R&D at Applitools

[email protected]

THANK YOU