Automating Browser Testing

A presentation at BuzzJS in June 2018 in New York, NY, USA by Colin Bendell

Slide 1

Slide 1

1 Browser Test Automation (in 2018) @ ColinBendell CTO Office, Cloudinary

Slide 2

Slide 2

Slide 3

Slide 3

Agenda Te s t M e t h o d o l o g i e s We bDr i ve r. i o Mocha tests How Browsers Work & Browser APIs We b Pl at for m Te st Mobile & Device Emulation Accessibility Operational: DNS, Paralyzing, CI Real User Testing 9:00 AM Welcome | 10:30 AM Break | 12:00 AM Lunch | 2:30 PM Break | 4:00 PM Wrap

up & Q&A

Slide 4

Slide 4

Cloudinary's Two Probl ems Felix Zilber New Digital

Asset

Management Front

End Automating CDN Changes

Slide 5

Slide 5

5 Why Do We Test?

Slide 6

Slide 6

Slide 7

Slide 7

Slide 8

Slide 8

Slide 9

Slide 9

Slide 10

Slide 10

10 Te s t i n g : P r e p a r e f o r t h e U n e x p e c t e d

Slide 11

Slide 11

“I just want to buy my Mom’s birthday present.” “I just want to know if it will rain today.” “I just want to share pictures of my vacation”

Slide 12

Slide 12

Te s t i n g = = = M e e t i n g U s e r E x p e c t a t i o n s

Slide 13

Slide 13

Te s t i n g M o d e l s

Slide 14

Slide 14

Kinds of Testing https:// stackoverflow.com /questions/2741832/unit

tests

vs

functional

tests

Slide 15

Slide 15

Functional v. Non

Functional

Slide 16

Slide 16

Unit Testing • Smallest testable component • Usually simple inputs and outputs • Moch objects v. skeleton dev services

Slide 17

Slide 17

Unit Testing const expect

require( "chai" ).expect; const converter

require( "../app/converter" ); describe( "Color Code Converter" , function () { describe( "RGB to Hex conversion" , function () { it( "converts the basic colors" , function () { var redHex

converter.rgbToHex ( 255 , 0 , 0 ); var greenHex

converter.rgbToHex ( 0 , 255 , 0 ); var blueHex

converter.rgbToHex ( 0 , 0 , 255 ); expect( redHex ). to.equal ( "ff0000" ); expect( greenHex ). to.equal ( "00ff00" ); expect( blueHex ). to.equal ( "0000ff" ); }); }); });

Slide 18

Slide 18

Unit Testing • Blurred line to integration tests • Encourages small component logic v. monoliths • Large volume of Tests

Slide 19

Slide 19

Integration Tests

Slide 20

Slide 20

Integration Tests describe( "Color Code Converter API" , function () { describe( "RGB to Hex conversion" , function () { let url

"http://localhost:3000/ rgbToHex?red =255&green=255&blue=255" ; it( "returns status 200" , function () {}); it( "returns the color in hex" , function () {}); }); describe( "Hex to RGB conversion" , function () { let url = "http://localhost:3000/ hexToRgb?hex =00ff00" ; it( "returns status 200" , function () {}); it( "returns the color in RGB" , function () {}); }); });

Slide 21

Slide 21

System Tests • Does it match design? • Meet expectations of design • Often focused on workflows • Vol ume, l oad, stress, securi ty • Usability, Accessibility

Slide 22

Slide 22

System Tests

Slide 23

Slide 23

Slide 24

Slide 24

Acceptance Tests • Meet business objectives • End

to

End • Can the end user accomplish what we wanted it to do? • Alpha/Beta Feedback cycle

Slide 25

Slide 25

Kinds of Testing

Slide 26

Slide 26

“We develop in the Zoo, But release in the Jungle”

Melanie Cey

Slide 27

Slide 27

Kinds of Testing https:// stackoverflow.com /questions/2741832/unit

tests

vs

functional

tests

Slide 28

Slide 28

Why do we need browser testing • Functional User experience • Wo r k f l o ws • Design & Layout • Preserve Presentation • Above the fold, responsive web • Mobi l e experi ences v. Watch v. ?? • Accessibility • Screen readers • audits • Performance measurement • Performance budgets • Request flows

Slide 29

Slide 29

Browser Eco System

Slide 30

Slide 30

2007 2008 2009 2010 Present IE7 iPhone Firefox 2 IE7 iPhone 3G Firefox 3 Android Chrome 1 IE8 iPhone 3GS Firefox 3 Android 2.1 Chrome 1 IE8 iPhone 3GS Firefox 3 Android 2.1 Chrome 1 iPad ??

Slide 31

Slide 31

2012: 3,977 Different Android Devices Source: OpenSi gnal 2012: 3,977 Different Android Devices

Slide 32

Slide 32

Source: OpenSignal 2014: 18.7k Different Android Devices

Slide 33

Slide 33

Source: OpenSignal 2015: 24.0k Different Android Devices

Slide 34

Slide 34

How many browsers in a typical Thanksgiving weekend?

Slide 35

Slide 35

How many browsers in a typical Thanksgiving weekend? 572

Slide 36

Slide 36

2007 2008 2009 2010 Present IE7 iPhone Firefox 2 IE7 iPhone 3G Firefox 3 Android Chrome 1 IE8 iPhone 3GS Firefox 3 Android 2.1 Chrome 1 IE8 iPhone 3GS Firefox 3 Android 2.1 Chrome 1 iPad 572 iOS Safari MacOS Safari Android Chrome Desktop Chrome Samsung IB Opera …

Slide 37

Slide 37

“…25% of new Android phones have only 512MB of RAM. ”

Jen Fitzpatrick VP of product management for Google Maps

Slide 38

Slide 38

Browser Based Te s t i n g

Slide 39

Slide 39

How do we test the Browser? • Checklists • Support tickets • Screen capture • Pixel comparison • Programmatic control • RUM Beacons

Slide 40

Slide 40

#1 reason checklists fail to catch browser regression: Humans

Slide 41

Slide 41

open

a Safari https:// cloudinary.com killall Safari screencapture

x testoutput.png compare

identify

metric MAE baseline.png testoutput.png null

same1.png[0] PNG 640x400 640x400+0+0 8

bit DirectClass 1.64KB 0.010u 0:00.019

same2.jpg[0] JPEG 640x400 640x400+0+0 8

bit DirectClass 3.65KB 0.000u 0:00.009

0.196766 (3.00245e

Slide 42

Slide 42

open

a Safari https:// cloudinary.com killall Safari screencapture

x testoutput.png compare

identify

metric MAE baseline.png testoutput.png null

same1.png[0] PNG 640x400 640x400+0+0 8

bit DirectClass 1.64KB 0.010u 0:00.019

same2.jpg[0] JPEG 640x400 640x400+0+0 8

bit DirectClass 3.65KB 0.000u 0:00.009

0.196766 (3.00245e

Slide 43

Slide 43

open

a Safari https:// cloudinary.com killall Safari screencapture

x testoutput.png compare

identify

metric MAE baseline.png testoutput.png null

same1.png[0] PNG 640x400 640x400+0+0 8

bit DirectClass 1.64KB 0.010u 0:00.019

same2.jpg[0] JPEG 640x400 640x400+0+0 8

bit DirectClass 3.65KB 0.000u 0:00.009

0.196766 (3.00245e

Slide 44

Slide 44

open

a Safari https:// cloudinary.com killall Safari screencapture

x testoutput.png compare

identify

metric MAE baseline.png testoutput.png null

same1.png[0] PNG 640x400 640x400+0+0 8

bit DirectClass 1.64KB 0.010u 0:00.019

same2.jpg[0] JPEG 640x400 640x400+0+0 8

bit DirectClass 3.65KB 0.000u 0:00.009

0.196766 (3.00245e

Slide 45

Slide 45

Slide 46

Slide 46

How do we test the Browser? • Checklists • Support tickets • Screen capture • Pixel comparison • Programmatic control • RUM Beacons

Slide 47

Slide 47

OS API application control • Access the window model directly • Simulate Keyboard strokes and mouse movements • Interact with any application like a human • Screen Readers use this approach to supersede the OS accessibility features

Slide 48

Slide 48

Programmatic Control

Slide 49

Slide 49

How do we test the Browser? • Checklists • Support tickets • Screen capture • Pixel comparison • Programmatic control • RUM Beacons

Slide 50

Slide 50

Slide 51

Slide 51

Slide 52

Slide 52

Slide 53

Slide 53

Slide 54

Slide 54

Slide 55

Slide 55

Selenium Evolution • Selenium • Selenium Core • Selenium RC Selenium 1 • Selenium WebDriver Selenium 2 • We b D r i v e r Selenium 3 Gecko Driver (+Marionette) Chrome Driver EdgeDriver Apple Safari Driver Firefox Driver Safari Driver … https:// www.seleniumhq.org /download/

Slide 56

Slide 56

Selenium 3 (W3C WebDriver) Selenium Bindings Java Ruby C# Python JavaScript ? Selenium Grid ChromeDriver GeckoDriver SafariDriver EdgeDriver OperaDriver Browsers Chrome Firefox Safari Edge Opera JSON Wire Protocol WebDriver Wire Protocol HTTP HTTP

Slide 57

Slide 57

We bDr i ve r. i o We b Dr i ve r (or Selenium Grid) ChromeDriver GeckoDriver SafariDriver EdgeDriver OperaDriver Browsers Chrome Firefox Safari Edge Opera WebDriver Wire Protocol HTTP HTTP NodeJS

Slide 58

Slide 58

curl – X POST http://localhost:9515/session

d '{" desiredCapabilities ":{" browserName ":"chrome"}} ' { "sessionId" : "your

session

id

here" , "status" : 0 , "value" :{...}} curl http: / /localhost:9515/session/$SESSION_ID/ url \

d '{" url ":"http:// www.cnn.com /"} ' { " sessionId " : "..." , "status" : 0 , "value" : null } curl http: / /localhost:9515/session/$SESSION_ID/element

d '{"using":"tagName","value":"h1"}' { " sessionId " : "..." , "status" : 0 , "value" :{ " ELEMENT" : "element

object

id

here " }} curl http: / /localhost:9515/session/$SESSION_ID/element/$OBJECT_ID/text { " sessionId " : "..." , "status" : 0 , "value" : "Example Domain" } curl – X DELETE http: //localhost:9515/session/your

session

id

here { " sessionId " : "..." , "status" : 0 , "value" : null }

Slide 59

Slide 59

WebDriver.io

Slide 60

Slide 60

To o l c h a i n o v e r v i e w We bDr i ve r. i o Jenkins We b Platform Te s t Allure Chrome Driver Mocha Chrome Axe

Slide 61

Slide 61

Slide 62

Slide 62

Exercise 1: Getting Setup https:// github.com / colinbendell / webdriver

workshop Request https:// duckduckgo.com Enter search term ( eg : "Mr. Dressup ") Navigate to the 4th result and report the

<title>

Slide 63

Slide 63

git checkout https:// github.com / colinbendell / webdriver

workshop

Slide 64

Slide 64

npm install chromedriver

Slide 65

Slide 65

npm install webdriverio

Slide 66

Slide 66

const webdriverio

require ( ' webdriverio ' );

Slide 67

Slide 67

let options = {
host : "localhost" , port : 9515, path : "/" , desiredCapabilities : { browserName : 'chrome' }; const webdriverio

require ( ' webdriverio ' );

Slide 68

Slide 68

let options = {
host : "localhost" , port : 9515, path : "/" , desiredCapabilities : { browserName : 'chrome' }; let browser = webdriverio. remote (options); const webdriverio

require ( ' webdriverio ' );

Slide 69

Slide 69

let options = {
host : "localhost" , port : 9515, path : "/" , desiredCapabilities : { browserName : 'chrome' }; let browser = webdriverio. remote (options); const webdriverio

require ( ' webdriverio ' ); browser.init ();

Slide 70

Slide 70

let options = {
host : "localhost" , port : 9515, path : "/" , desiredCapabilities : { browserName : 'chrome' }; let browser = webdriverio. remote (options); const webdriverio

require ( ' webdriverio ' ); browser.init (); browser.url ( 'https:// amazon.com /' ); browser.saveScreenshot ( amazon.png ');

Slide 71

Slide 71

let options = {
host : "localhost" , port : 9515, path : "/" , desiredCapabilities : { browserName : 'chrome' }; let browser = webdriverio. remote (options); const webdriverio

require ( ' webdriverio ' ); browser.init ();
browser.url ( 'https:// amazon.com /' ); browser.saveScreenshot ( amazon.png '); browser.end ();

Slide 72

Slide 72

let options = {
host : "localhost" , port : 9515, path : "/" , desiredCapabilities : { browserName : 'chrome' }; let browser = webdriverio. remote (options); const webdriverio

require ( ' webdriverio ' ); browser.init ();
browser.url ( 'https:// amazon.com /' ); browser.saveScreenshot ( amazon.png '); browser.end ();

Slide 73

Slide 73

Slide 74

Slide 74

Slide 75

Slide 75

Exercise 1: Getting Setup https:// github.com / colinbendell / webdriver

workshop Request https:// duckduckgo.com Enter search term ( eg : "Mr. Dressup ") Navigate to the 4th result and report the

<title>

Slide 76

Slide 76

Te s t i n g with Mocha

Slide 77

Slide 77

Slide 78

Slide 78

Slide 79

Slide 79

Slide 80

Slide 80

https:// mochajs.org /

Slide 81

Slide 81

http:// www.chaijs.com

Slide 82

Slide 82

npm install chai wdio

mocha

framework

Slide 83

Slide 83

npm install wdio

chromedriver

service

Slide 84

Slide 84

npm install allure allure

commandline wdio

allure

reporter

Slide 85

Slide 85

wdio config

Slide 86

Slide 86

========================= WDIO Configuration Helper

? Where do you want to execute your tests? On my local machine ? Which framework do you want to use? mocha ? Shall I install the framework adapter for you? Yes ? Where are your test specs located? ./ src /**/*_ spec.js ? Which reporter do you want to use? dot, allure ? Shall I install the reporter library for you? Yes ? Do you want to add a service to your test setup? Chromedriver ? Shall I install the services for you? Yes ? Level of logging verbosity error ? In which directory should screenshots gets saved if a command fails? ./ errorShots / ? What is the base url ? http://localhost

Slide 87

Slide 87

Exercise 2: Wo r k f l o w Te s t

Adding TODO spec Install mocha, chai, allure create wdio.conf.js Navigate to todomvc.com Using Angular implementation: • add a To D o • marking it complete • clear the list

Slide 88

Slide 88

Slide 89

Slide 89

Slide 90

Slide 90

Slide 91

Slide 91

Slide 92

Slide 92

Exercise 3: POM spec Repeat Exercise 2 Use Page Object Model Simplify Allure output with wdio

allure

ts

Slide 93

Slide 93

Ta ke A c t i o n • Create workflows easily with mocha • Use a Page

Object

Model to abstract selectors for reduced maintenance • Create good & actionable outputs

Slide 94

Slide 94

How Browsers Work

Slide 95

Slide 95

How Browsers Are Supposed to work

Slide 96

Slide 96

Slide 97

Slide 97

Slide 98

Slide 98

Page Load Time: Seconds

Slide 99

Slide 99

Slide 100

Slide 100

2 Second Magic Number Page Load Time: Seconds

Slide 101

Slide 101

Slide 102

Slide 102

! " ! 50ms DNS Lookup 100ms ShoesByColin.com 8.8.8.8

Slide 103

Slide 103

! " ! 50ms DNS Lookup 100ms ShoesByColin.com 8.8.8.8

Slide 104

Slide 104

! " ! 50ms DNS Lookup 100ms TCP Connect +100ms ShoesByColin.com 8.8.8.8

Slide 105

Slide 105

! " ! 50ms DNS Lookup 100ms TCP Connect +100ms TLS Negotiation +200ms ShoesByColin.com 8.8.8.8

Slide 106

Slide 106

! " ! ! 50ms DNS Lookup 100ms TCP Connect +100ms TLS Negotiation +200ms Application +100ms

  • ?? ms ShoesByColin.com 8.8.8.8

Slide 107

Slide 107

! " ! ! 50ms DNS Lookup 100ms TCP Connect +100ms TLS Negotiation +200ms Application +100ms

  • ?? ms ~ 500ms Network
  • 500ms? App

Slide 108

Slide 108

Slide 109

Slide 109

HTML DOM JavaScript CSS Render Tr e e Layout Paint CSSOM Images Video JS Exec

Slide 110

Slide 110

Browser APIs

Slide 111

Slide 111

Real User Monitoring: JavaScript Timers Steve Souders Philip Te l l i s https:// github.com / stevesouders /episodes https:// github.com /lognormal/boomerang

Slide 112

Slide 112

Slide 113

Slide 113

https://www.w3.org/wiki/ We b_ Pe r fo r manc e /Publications

Slide 114

Slide 114

Slide 115

Slide 115

Navigation Timing API

Slide 116

Slide 116

window.performance

Slide 117

Slide 117

{ " timeOrigin ": 1528900579651.6672, "timing": { " navigationStart ": 1528900579651, " unloadEventStart ": 0, " unloadEventEnd ": 0, " redirectStart ": 0, " redirectEnd ": 0, " fetchStart ": 1528900583010, " domainLookupStart ": 1528900579730, " domainLookupEnd ": 1528900579730, " connectStart ": 1528900579730, " connectEnd ": 1528900579761, " secureConnectionStart ": 1528900579733, " requestStart ": 1528900579761, " responseStart ": 1528900582922, " responseEnd ": 1528900583010, " domLoading ": 1528900583014, " domInteractive ": 1528900583849, " domContentLoadedEventStart ": 1528900583849, " domContentLoadedEventEnd ": 1528900583876, " domComplete ": 1528900585616, " loadEventStart ": 1528900585617, " loadEventEnd ": 1528900585856 }, "navigation": {"type": 0, " redirectCount ": 0 } }

Slide 118

Slide 118

function getPageLoadTime () { let timing = window.performance.timing ; return timing.loadEventStart

timing.navigationStart }

Slide 119

Slide 119

What about … Javascript | CSS | WebFonts | Images | Videos | XHR/Fetch

Slide 120

Slide 120

Slide 121

Slide 121

Slide 122

Slide 122

window.performance

Slide 123

Slide 123

{ "name": "https:// ajax.googleapis.com /ajax/libs/ jquery /1.11.2/ jquery.min.js ", " entryType ": "resource", " startTime ": 928.70000000039, "duration": 425.8000000008906, " initiatorType ": "script", " nextHopProtocol ": "h2", " workerStart ": 0, " redirectStart ": 0, " redirectEnd ": 0, " fetchStart ": 928.70000000039, " domainLookupStart ": 937.4000000025262, " domainLookupEnd ": 945.9000000024389, " connectStart ": 945.9000000024389, " connectEnd ": 967.5999999999476, " secureConnectionStart ": 946.2000000021362, " requestStart ": 949.5999999999185, " responseStart ": 970.9000000002561, " responseEnd ": 1354.5000000012806, " transferSize ": 33798, " encodedBodySize ": 33495, " decodedBodySize ": 95931, " serverTiming ": [] }

Slide 124

Slide 124

let url = “https:// bendell.ca / logo.png ”; let me = performance.getEntriesByName ( url )[0]; let timings = { loadTime : me. duration , dns : me. domainLookupEnd

me. domainLookupStart , tcp : me. connectEnd

me. connectStart , waiting: me. responseStart

me. requestStart , fetch: me. responseEnd

me. responseStart }

Slide 125

Slide 125

200 OK HTTP/1.1 Timing

Allow

Origin: * Content

Type: application/ javascript Content

Length: 1234

Slide 126

Slide 126

• Slowest resources • Time to first image • Response time by domain • Time a group of assets • Response time by initiator type (element type) • Browser cache

hit ratio for resources • Resource Timing API • Other Uses More: http://www.slideshare.net/bluesmoon/beyond

page

level

metrics

Slide 127

Slide 127

Slide 128

Slide 128

How long does it take to display the main product image on my site?

Slide 129

Slide 129

function loadTemplate () { performance.mark (“ startTask ”); doTemplateStuff () //do stuff (assumes promise()) .then(() => { performance.mark (“ stopTask ”); //Measure the duration between the two marks performance.measure (“ taskDuration ”, “ startTask ”,“ stopTask ”); }); }

Slide 130

Slide 130

< img src ="image1.gif" onload=" performance.mark (' hero_image ')"> https:// stevesouders.com /blog/2015/05/12/hero

image

custom

metrics/

Slide 131

Slide 131

Slide 132

Slide 132

GET /resource HTTP/1.1 Host: example.com HTTP/1.1 200 OK Server

Timing: cdn , dur="130" Server

Timing: cloudinary , dur="10", desc ="new trans"

Slide 133

Slide 133

{ let url = 'https:// example.com / resource.jpg ’; let severEntries [] = window.performance.getEntriesByName ( url ) . filter (( name ) => name === " server ") ; }

Slide 134

Slide 134

Slide 135

Slide 135

Slide 136

Slide 136

Slide 137

Slide 137

let config = { attributes: true, childList : true, subtree: true }; let targetNode

document.querySelector ('body'); let callback = function(mutations) { mutations.forEach (function(mutation) { if ( mutation.type === ' childList ') { let values = []. slice.call ( list.children ) .map(node => node.nodeName ) .filter(n => / img / i.test (n)); console.log ( list_values ); } }); }; let observer = new MutationObserver (callback); observer.observe ( targetNode , config);

Slide 138

Slide 138

Slide 139

Slide 139

Exercise 4: performance budget Navigate to amazon.com Calculate the total bytes downloaded Ensure that the page load time < 2s and bytes < 2MiB Repeat with Disney.com

Slide 140

Slide 140

Ta ke A c t i o n • Add performance.mark () to measure YOUR key metrics • Eg : Hero Image, Product Image, Sport Scores • Keep performance.mark () in production code! • Define Hard and Soft targets that synthetic tests should hit • BHAG: 2s & 1MiB

Slide 141

Slide 141

Mobile Display & Network Throttling Tim Kadlec

Slide 142

Slide 142

Slide 143

Slide 143

Slide 144

Slide 144

Slide 145

Slide 145

Slide 146

Slide 146

chromeOptions : { args :[ "

incognito" , "

headless", "

disable

gpu " ] },

Slide 147

Slide 147

chromeOptions : { args :[ "

incognito" , "

disable

gpu " ], mobileEmulation : { deviceMetrics : { width : 360, height : 720, pixelRatio : 3}, networkThrottle : 'Fast 3G' } }

Slide 148

Slide 148

Slide 149

Slide 149

Ta ke A c t i o n • Run Tests in different viewport configurations to test RWD • Experiment with different Network Conditions • Similarly with different CPU throttling

Slide 150

Slide 150

Web Platform Test

Slide 151

Slide 151

https://web

platform

tests.org

Slide 152

Slide 152

https://platform.html5.org

Slide 153

Slide 153

https:// darobin.github.io /test

harness

tutorial/docs/using

testharness.html

Slide 154

Slide 154

Why Inside v. Outside Browser Testing? • Hawthorne Effect • Platform Widgets & Controls • APIs

Slide 155

Slide 155

Exercise 5: WPT Implement Responsive Images and Test the naturalWidth

Slide 156

Slide 156

A11y with AXE Léonie Watson Marcy Sutton Katie Sylor

Miller

Slide 157

Slide 157

“Websites, tools, and technologies are designed and developed so that people with disabilities can use them .” ACCESSIBILITY (a11y )

W3C Web Accessibility Initiative

Slide 158

Slide 158

THE AMERICANS WITH DISABILITIES ACT (ADA) “No individual shall be discriminated against on the basis of disability in the full and equal enjoyment of the goods, services, facilities, privileges, advantages, or accommodations of any place of public accommodation ”

ADA Sec. 12182 (a)

Slide 159

Slide 159

AMERICANS WITH A DISABILITY UNITED STATES CENSUS REPORT, JULY 2012 57 M 19%

Slide 160

Slide 160

Slide 161

Slide 161

Slide 162

Slide 162

The Basics • We b Conte nt Ac c e s s i bi l i t y Gui de l i ne s ( WCAG 2. 0)
• Developed by the W3C Web Accessibility Three levels of compliance

A, AA, AAA

Slide 163

Slide 163

Slide 164

Slide 164

Slide 165

Slide 165

Exercise 6: A11y Add axe

core npm Load 3 news websites Compare the violations Create a test case to fail on a11y violations

Slide 166

Slide 166

Ta ke A c t i o n • Good Usability === Good Accessibility • Use Semantic HTML (also great for SEO) • Add alt and description tags to media and anchors • Te s t y o u r s i t e ( a x e

core.com ) • Tr y t h e
Funkity

Disability

Simulator Chrome Extension https:// chrome.google.com /webstore/detail/ funkify

disability

simula / ojcijjdchelkddboickefhnbdpeajdjg?hl

en • Be an ally

Slide 167

Slide 167

DNS

Slide 168

Slide 168

Ta ke A c t i o n

Slide 169

Slide 169

Parallization

Slide 170

Slide 170

Ta ke A c t i o n

Slide 171

Slide 171

CI/CD/CB with Jenkins

Slide 172

Slide 172

Ta ke A c t i o n

Slide 173

Slide 173

Real User Monitoring with Lux

Slide 174

Slide 174

Synthetic Real • Consistent • Precise CPU, Network use • Availability • Engagement • Business Metrics (Rev) • Market Segment • Layout • Design

Slide 175

Slide 175

Slide 176

Slide 176

Slide 177

Slide 177

Slide 178

Slide 178

Ta ke A c t i o n • Collect Real

User browser exerpiences • Audit user experience (load time, downloaded content) • Periodically run tests in the wild • Add window.addEventListener (‘error’) to capture console errors • Use Beacon API to ensure metrics are returned

Slide 179

Slide 179

Summary • Browser testing is easy! • Synthetic testing with: • We b Dr i ve r. i o for easy functional testing • We b Pa ge Te st . org to augment performance testing • Use We bPl at for mTe st for direct platform tests • Don’t just test workflows: Design, Performance, and Accessibility • Use Real

User feedback to compare tests in the wild

Slide 180

Slide 180

@ ColinBendell

Slide 181

Slide 181

Further Reading • http:// webdri ver. i o / api.html • https:// github.com / cloudinary / wdi o

allure

ts • https:// github.com / cloudinary / wdi o

allure

ts

example • https:// www.npmjs.com /package/ webdri ver

manager • http:// blog.kevinlamping.com /testing

your

login

an

in

depth

webdri veri o

tutorial/ • https:// www.browserstack.com /automate/ webdri veri o • https:// medi um. com /@ boriscoder /setting

up

selenium

tests

wi th

webdri ver

io

cc7fc3c86629 • https://w3c.github.io/ webdri ver / • https:// www.slideshare.net / LinkMeSrl / webdri veri o?qi d =8cdf045d

9868

4ca8

a8ad

8aefb5c22289&v=&b=& from_search =1 • https:// peter.sh /experiments/chromium

command

line

switches/#load

extension • https:// www.ghacks.net /2013/10/06/list

useful

google

chrome

command

line

switches/ • https:// deliciousbrains.com /how

were

automating

acceptance

testing/ • https:// medi um. com /tech

tajawal /page

object

model

pom

design

pattern

f9588630800b

Slide 182

Slide 182

Agenda Te s t M e t h o d o l o g i e s We bDr i ve r. i o Mocha tests How Browsers Work & Browser APIs We b Pl at for m Te st Mobile & Device Emulation Accessibility Operational: DNS, Paralyzing, CI Real User Testing 9:00 AM Welcome | 10:30 AM Break | 12:00 AM Lunch | 2:30 PM Break | 4:00 PM Wrap

up & Q&A

Slide 183

Slide 183

Break 10:30

10:45 AM 183

Slide 184

Slide 184

Lunch 11:50 AM – 12:30 AM 184 Lunch 12:00 PM – 1:00PM

Slide 185

Slide 185

Break 2:30 – 2:45 PM 185

Slide 186

Slide 186

186