Cypressio Cheat Sheet
by Narayanan Palani (Narayanan Palani) via cheatography.com/32112/cs/22731/
Basic Commands Extensions (cont)
Launch npx cypress open cypress-skip-and-o‐ https://www.npmjs.com/package/cypress-s‐
CypressIO nly-ui kip-and-only-ui
Launch URL cy.visit(url) cypress-watch-a‐ https://www.npmjs.com/package/cypress-w‐
Launch URL Update baseUrl in cypress.json (as a prefix) nd-reload atch-and-reload
with prefix and use cy.visit(url) cypress-testing-li‐ https://www.npmjs.com/package/@testing-lib‐
Make HTTP cy.request(url) brary rary/cypress
Request cypress-file-upload https://www.npmjs.com/package/cypress-file-
upload
Element Interactions
Locator Strategy
Click Event .click()
Double Click Event .dblclick() CSS Selectors cy.get‐
(selector)
Right Click Event .rightclick()
Xpath (cypress.xpath extension to be installed from cy.xpa‐
Input on Text Box Fields .type(text)
https://github.com/cypress-io/cypress-xpath) th(sel‐
Clear Event .clear()
ector)
Check on Checkboxes .check()
Uncheck on Checkboxes .uncheck() Variable and Aliases
Select from Dropdowns .select(value) Variable const,let,var
Mouse-Down .trigger('mousedown') Aliases .as('nameTheAliases')
Mouse-Up .trigger('mouseup') Run commands before each test beforeEach()
Mouse-Leave .trigger('mouseleave')
Errors
Mouse-Move .trigger('mousemove')
Error This is the type of the error (e.g. AssertionError, Cypres‐
Mouse-Over .trigger('mouseover')
name sError)
Focus on an object .focus()
Error This generally tells you what went wrong. It can vary in
Debug on a click event .debug().click()
Message length. Some are short like in the example, while some
Force Click .click({ force: true }) are long, and may tell you exactly how to fix the error.
Learn Some error messages contain a Learn more link that will
Installaton of cypress-test-techniques
More take you to relevant Cypress documentation.
Basic Tools Nodejs (version 10 or above),Gitbash,Visual Studio
View Clicking this toggles the visibility of the stack trace. Stack
Needed Code (or any IDE)
Stack traces vary in length.
Step1 npm install Trace
Step2 npm link Print to Click this to print the full error to your DevTools console.
Step3 npm link cypress-cucumber-preprocessor console This will usually allow you to click on lines in the stack
button trace and open files in your DevTools
Step4 npm install through
Extensions
Cypress Image https://www.npmjs.com/package/cypress-i‐
Snapshot mage-snapshot
Percy (Visual Testing & https://docs.percy.io/docs/cypress
Review)
By Narayanan Palani Published 10th May, 2020. Sponsored by CrosswordCheats.com
(Narayanan Palani) Last updated 10th May, 2020. Learn to solve cryptic crosswords!
cheatography.com/narayanan- Page 1 of 2. http://crosswordcheats.com
palani/
Cypressio Cheat Sheet
by Narayanan Palani (Narayanan Palani) via cheatography.com/32112/cs/22731/
Learn
Cypress Docume‐ https://docs.cypress.io/guides/overview/why-c‐
ntation ypress.html
Cypress Test https://www.udemy.com/course/cypressio
Techniques
Test Automation https://www.udemy.com/course/istqb-adva‐
Engineering nced/
Record and Playback
Cypress https://chrome.google.com/webstore/detail/cypress-reco‐
Recorder rder/glcapdcacdfkokcmicllhcjigeodacab
Cypress https://chrome.google.com/webstore/detail/cypress-scen‐
Scenario ario-recorder/fmpgoobcionmfneadjapdabmjfkmfekb?hl=en
Recorder
Browser support
Cypress 4.0.0 Google Chrome,Canary, Mozilla Firefox, Microsoft
or above Edge(Chromium Based),Electron
Cypress 3.8.3 Google Chrome and Electron
or below
Framework Repositories
Cypress Test https://github.com/narayananpalani/cypress-te‐
Techniques st-techniques
Cypress Testing https://github.com/testing-library/cypress-testi‐
Library ng-library
Cypress Axe (Acces‐ https://github.com/avanslaars/cypress-axe
sibility)
Cypress Code https://github.com/cypress-io/code-coverage
Coverage
Cypress Example API https://github.com/cypress-io/cypress-exam‐
Testing ple-api-testing
Cypress Lighthouse https://github.com/mfrachet/cypress-audit
Audit
By Narayanan Palani Published 10th May, 2020. Sponsored by CrosswordCheats.com
(Narayanan Palani) Last updated 10th May, 2020. Learn to solve cryptic crosswords!
cheatography.com/narayanan- Page 2 of 2. http://crosswordcheats.com
palani/