68
Spot the difference Automating visual regression testing @11vlr

Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

  • Upload
    others

  • View
    15

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

Spot the difference Automating visual

regression testing

@11vlr

Page 2: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

Spot the difference Automating visual

regression testing

Page 3: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

• Automated testing is more reliable, as

it is performed by tools and/or scripts.

• Automated testing is executed by

software tools, so it is significantly

faster than a manual approach.

WHY AUTOMATE END

TO END UI TESTS?

@11vlr

Page 4: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

• Investment is required

• Automated testing is a practical option

when the test cases are run

repeatedly over a long time period.

• Automated testing entail

human observation and cannot

guarantee user-friendliness or positive

customer experience.

COMMON UI

AUTOMATION ISSUES

DOES NOT

Page 5: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

IT CAN BE A SLIPPERY SLOPE

@11vlr

Page 6: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

ICE-CREAM CONE ANTI-PATTERN

@11vlr

Unit

Service

UI

Manual & Exploratory

Testing

£

£££

Adaption of https://watirmelon.blog/testing-pyramids/

Page 7: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

HOUR GLASS ANTI-PATTERN

@11vlr

£

£££

£

£££

UI

Unit

Manual & Exploratory

Testing

Adaption of: https://www.getautoma.com/blog/the-test-hourglass

Page 8: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

WHEN YOU HAVE

UNIT BUT NO

INTEGRATION TESTS

Page 9: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

TESTINGfrAgile

Page 10: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

TESTING PYRAMID

@11vlr

£

£££

UI

Service

Unit

Manual & Exploratory

Testing

Adaption of https://martinfowler.com/bliki/TestPyramid.html

Page 11: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

WHY NOT JUST STICK

WITH MANUAL

TESTING THEN?

• Manual testing allows for human

observation, which may be more

useful if the goal is user-friendliness

or improved customer experience.

UI

Service

Unit

Manual & Exploratory

Testing

Page 12: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

• Can be time intensive

• Is not accurate at all times due to

human error, hence it is less reliable.

• Is time-consuming, taking up human

resources.

• Is only practical when the test cases

are run once or twice, and frequent

repetition is not required.

MANUAL TESTING

Page 13: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

WE DON’T HAVE TIME TO AUTOMATE

@11vlr

Page 14: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

CATCH 22

@11vlr

We don’t automate

We don’t have time

BECAUSE BECAUSE

Page 15: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

MANY OPTIONS

Page 16: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

• Open source; anybody can see the

code and help

• Big community of support

• Can operate on almost any OS

• Multiple language support (Python,

Ruby, .Net, PHP, Java, JavaScript)

• Supports a range of browsers like

Opera, Chrome, IE (6,7,8,9,10,11),

Mozilla Firefox, Safari

SELENIUM

Page 17: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

IT’S NOT A SILVER BULLET

@11vlr

Page 18: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

• Speed to execute tests

• Render differently

BROWSER

COMPATIBILITY

ISSUES

Page 19: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

EXECUTION SPEED

@11vlr

Page 20: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

MAINTAINABILITY

@11vlr

Page 21: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

HOW VALUABLE ARE THESE TESTS?

Page 22: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

WHAT THE….

Page 23: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

ALL IS NOT WHAT IT SEEMS

Page 24: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

MAKING TESTS LESS

FLAKY

Page 25: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

• Page object patterns

MAKING TESTS LESS

FLAKY

http://martinfowler.com/bliki/PageObject.html

Page 26: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

• Qa-selectors

MAKING TESTS LESS

FLAKY

Page 27: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

Qa- selectors

Page 28: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

HOW GOOD ARE YOU AT SPOT THE

DIFFERENCE

Page 29: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

HOW MANY DIFFERENCES CAN YOU FIND?

Page 30: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

HOW MANY DIFFERENCES DID YOU FIND?

@11vlr

Page 31: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

THERE WERE 11 DIFFERENCES

@11vlr

Page 32: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

HOW DO YOU KNOW WHEN YOU’VE

FOUND THEM ALL?

@11vlr

Page 33: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

CAN WE ADD MORE VALUE TO OUR

TESTS?

@11vlr

UI

Service

Unit

Manual & Exploratory

Testing

Page 34: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

WHAT IF WE COULD SIMPLY

@11vlr

equalsAssert

Page 35: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

VISUAL TESTING

@11vlr

Page 36: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

• Didn’t work straight out of the box

and/or contained lots of bloat

• Steep learning curve

• Small community so lack of support

• Needed to work with our current

automation framework

• Costs

ISSUES WITH OTHER

OFFERINGS

Page 37: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

• Been in development 1 year

• Facing many challenges which are

because of the products we offer, the

ways in which we have developed

them and the way in which we test

them

ROLLING OUR OWN

Page 38: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

• Browser rendering issues

RELIABILITY

Page 39: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

EXECUTION SPEED

Page 40: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

HUMAN VS MACHINE

Page 41: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

HUMAN VS MACHINE

Page 42: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

LETS ZOOM IN A LITTLE

Page 43: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

LETS ZOOM IN A LITTLE BIT MORE…

Page 44: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

GOT HIM!

Page 45: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

HOW QUICK WAS THE MACHINE?

Page 46: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

MAINTAINABILITY

Old code

Page 47: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

MAINTAINABILITY

Old code

New code using some helpers

Page 48: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

MAINTAINABILITY

New code using Specflow

New code using some helpers

Page 49: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

EASILY IDENTIFY THE DIFFERENCES

Page 50: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

ACCURACY

Page 51: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

IMAGE QUALITY DIFFERENCE

Page 52: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

CHALLENGES SO FAR

Page 53: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

MAINTAINING BASE

IMAGES

Keep a base image for each driver

type

Page 54: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

SCREENSHOTS

• Viewport (default - WebDriver

W3C standard)

• Full Screen (stitching)

• Capture images of just

elements

Page 55: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

SCREEN RESOLUTIONS

Page 56: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

SCREEN RESOLUTIONS

Page 57: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

Responsive design

Page 58: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

HARDWARE ISSUES

Machine hardware rendering

snapshots slightly differently

Page 59: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

STORAGE

Database / Online storage – file

sizes (many images)

Page 60: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

DYNAMIC CONTENT

Page 61: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

DYNAMIC CONTENT

class=“attendeesLink"

Page 62: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

MOVING ELEMENTS

• CSS animations

• Videos

Page 63: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

VISUALLY CHECKING DOCUMENTS

Page 64: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

PDF DYNAMIC

CONTENT

• A way to blanket content within

documents

Page 65: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

UPCOMING CHALLENGES

@11vlr

Page 66: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

MORE COMPARISON

OPTIONS

• Text only

• Layout only

Page 67: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

ANOTHER TOOL TO ADD TO YOUR BELT

@11vlr

Page 68: Spot the difference · Spot the difference Automating visual regression testing @11vlr. @11vlr Spot the difference Automating visual regression testing • Automated testing is more

@11vlr

THANK YOU

Git repository: http://bit.ly/VisualTesting

NuGet.org Package:

@11VLR

WWW.VIVRICHARDS.CO.UK