0% found this document useful (0 votes)
458 views17 pages

Introduction To Cypress

This lightning talk introduces Cypress, an open source tool for testing web applications. It summarizes that Cypress is faster and more reliable than Selenium for end-to-end testing. It does not use Selenium under the hood. Key features highlighted include the test runner, time travel debugging capabilities, automatic waiting and retries, and support for real-time reloads and network traffic control. Some limitations are that it only supports Chromium currently and does not allow testing across multiple tabs, browsers or domains.

Uploaded by

Alan Schveitzer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
458 views17 pages

Introduction To Cypress

This lightning talk introduces Cypress, an open source tool for testing web applications. It summarizes that Cypress is faster and more reliable than Selenium for end-to-end testing. It does not use Selenium under the hood. Key features highlighted include the test runner, time travel debugging capabilities, automatic waiting and retries, and support for real-time reloads and network traffic control. Some limitations are that it only supports Chromium currently and does not allow testing across multiple tabs, browsers or domains.

Uploaded by

Alan Schveitzer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Lightning Talk – Introduction to Cypress

Jul 20, 2019 at E2E Test Automation Day with Selenium


Mitsuyuki Shiiba
EC Incubation Development Dept.
Rakuten, Inc. tw: bufferings
Testing Pyramid

• Slow?
E2E • Unreliable?
• Hard?
Integration

Unit

2
https://www.cypress.io/
"Fast, easy and reliable testing for anything
that runs in a browser."
Cypress doesn't use Selenium.

Free / Open Source / MIT License

3
Cypress Test Runner

4
Cypress Test Runner

Test Spec

5
Cypress Test Runner

Test Spec Target App

6
Demo

7
Easy to install, easy to run

# Install everything with one command


$ npm install cypress --save-dev

# GUI Runner
$ npx cypress open

# Headless Runner
$ npx cypress run
8
Fast
Selenium WebDriver's Architecture

Test Script WebDriver Browser

HTTP Control

9
Fast
Cypress runs in the same run-loop as your app.

Test Spec Target App

10
Time Travel
We can check DOM snapshot for each test step.

11
Automatic Waiting & Retry
We can focus on what to test.
it('adds 2 todos', function () {
cy.visit('/')
cy.get('.new-todo')
.type('learn testing{enter}')
.type('be cool{enter}')
cy.get('.todo-list li')
.should('have.length', 2)
})
12
Debuggability
We can debug our application.

13
Cypress Architecture
Browser
NodeJS Process (Using same domain with proxy)
Cypress Start with Proxy
Tests App (iframe)
(iframe)
DOM

Web Proxy LocalStorage

Service Worker
Websocket
OS ...

Reference Dominic Elm - Cypress: The future of E2E testing https://youtu.be/pXyBligMMr0?t=1107

14
Many other good parts!
• Real time reloads
• Spies, stubs, and clocks
• Network traffic control
• Consistent results
• Screenshots and videos (headless runner)
• Dashboard (paid feature)

15
Restrictions
• Only support Chromium currently
• Seem to be working on Firefox, IE, Edge
• Not supported (because of its architecture)
• Multiple tabs/browsers
• Multiple domains in one test case

16
Let's talk about Cypress!
and we want you!

17

You might also like