the best E2E frameworks go head-to-head

Kyle Whitaker

Cypress vs. Playwright

📂 github.com/kylewhitaker/codemash-2023

📽 slides.com/kylewhitaker/cypress-vs-playwright

talk testing

2

about

1

cypress

3

playwright

4

wrap

5

talk testing

2

about

1

cypress

3

playwright

4

wrap

5

Sr. Software Engineer

since July '22

MBA Candidate

Aug '21 - May '24

IT Intern - Sr. SWE

Jan '15 - July '22

My Progressive Experience

2015

Year

CVV2

2016

PPro SL

2017

PPro SL

S2

2018

S2

2019

S2

2020

Level20

Test Guru + Selenium

Angular Shallow Specs

Jasmine w/o TestBed

IT Intern

Unit Testing for Devs

Protractor E2E

Cypress

Testing

When did I use Playwright?

 

I stumbled into Puppeteer at the end of 2019. I wrote a scrappy automated test with 20 lines of Javascript. I fell in love.

 

Six months later, I heard Playwright was coming out as the Puppeteer for all browsers. I knew immediately it would have a competitive advantage.

 

Cypress was primarily just Chrome then.

And Microsoft was building Playwright.

talk testing

2

about

1

cypress

3

playwright

4

wrap

5

Testing is hard. Prioritize DX.

Use Cypress.

Playwright is awesome, too.

Thesis

Present the facts.

Decide for yourself.

Goal

Why test?

CONFIDENCE

(mitigate risk)

Principle

Principle

Requirements

Source Code

Test Code

Test Code

Test on Day 1

Principle

Test Automation Maturity

Write tests before coding

3

Write tests during coding

2

Write tests after coding

1

New 📱 who dis?

0

Principle

Testing is hard.

The tooling should make it easy.

Principle

Unit tests help me write better code.

E2E tests help me sleep at night.

Principle

Automated tests empower your engineering team to code fearlessly!

Principle

Automated tests are the best form of documentation.

I choose E2E over all other forms of automated testing.

Unpopular Opinion

😈

Perfection is just procrastination.

Principle

talk testing

2

about

1

cypress

3

playwright

4

wrap

5

Cypress Changelog

v.12 since 12/22 - LATEST: session, origin, cookies

v.11 since 11/22 - component test SPAs, perf+

v.10 since 06/22 - component tests [beta], UI, config

v.8.2 since 08/21 - session [experimental]

v.7 since 04/21 - component tests [alpha]

v.6 since 11/20 - stub with cy.intercept()

v.5 since 08/20 - test retries

v.4 since 02/20 - firefox (beta), edge

v.3 since 05/18

v.2 since 02/18

v.1 since 10/17

App for Testing

Users

Admin, Registrar, Group Leader

Actions

CRUD event registrations & groups

CRUD system users

Upload 3rd-party registrations 

Monitor system activity

Demo

Debugging

Auto waits

Single browser tab

Learning curve

Typescript config

Documentation

OTB

Community

talk testing

2

about

1

cypress

3

playwright

4

wrap

5

Playwright Releases

v1.29 since 12/22 - LATEST
v1.28 since 11/22 - Codegen & Trace Viewer
v1.25 since 08/22 - VSCode Extension

v1.22 since 05/22 - Component tests (preview)

v1.14 since 08/21 - locators

...

v1.0 since 05/20 - Chromium, Firefox, Webkit

v0.10 since 01/20 - Is Playwright ready?

Demo

Codegen (!!)

Some manual waits (??)

Integrations

Documentation

Typescript config

Test runner config (??)

Trace Viewer (!!)

OTB, quick to learn

Typescript config

VSCode extension

it's not Cypress?

Debugging

Auto waits

Single browser tab

Learning curve

Typescript config

Documentation

OTB

Community

Codegen (!!)

Documentation

Trace Viewer (!!)

OTB

Typescript config

Debugging UX (!!!!!)

learning curve

Documentation

OTB

Typescript config

DIY coding

friendly to JS devs

Python, Java, .NET

robust auto waits

flaky waits 🤮

talk testing

2

about

1

cypress

3

playwright

4

wrap

5

Case Study

📚

Level20

Progressive

web policy servicing

new business incubator

no customers (yet)

React JS stack

millions of customers

Angular + .NET

all browsers, devices

Playwright

Chrome web only

Cypress

Stop using Protractor

Conclusion

✌️

Cypress is the best debugging experience, hands down

Conclusion

🐛

I love Cypress.

I cannot ignore Playwright.

Conclusion

😯

Best practices & good habits are the foundation, not some framework

Conclusion

🏃‍♀️

Testing is hard. Prioritize DX.

Use Cypress.

Playwright is awesome, too.

Thesis

Playwright.

Cypress

🤷‍♂️

📂 github.com/kylewhitaker/codemash-2023

📽 slides.com/kylewhitaker/cypress-vs-playwright

Made with Slides.com