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
3 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
8 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
12 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) })
14 Cypress Architecture Browser (Using same domain with proxy) NodeJS Process Reference Dominic Elm - Cypress: The future of E2E testing https://youtu.be/pXyBligMMr0?t=1107 Tests (iframe) App (iframe) Cypress Proxy OS Web Websocket Start with Proxy DOM LocalStorage ... Service Worker
15 Many other good parts! • Real time reloads • Spies, stubs, and clocks • Network traffic control • Consistent results • Screenshots and videos (headless runner) • Dashboard (paid feature)
16 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