Cypressio Cheat Sheet

A Software › Chrome cheat sheet in English by Narayanan Palani

Cypressio cheat sheet helps in using right code examples for the automation frameworks. This cheat sheet is created for the participants of online training platform: https://engineers-hub.teachable.com/p/cypressio

Apache Testing IDE Browser Server Java Software Framework Cucumber Data Firefox Automation PDF Builder Keyword Is What By Xpath Interview Online Point Selenium Jenkins In Tutorial Example Questions Architecture Annotations Training Assert Testng Webdriver Download Wait Qtp Guru99 Driven Standalone Javascriptexecutor Locators Toolsqa Cross Using Chromedriver Appium Poi Tutorialspoint Tutorials Javatpoint Arun Gc Reddy Fluentwait Org-openqa-selenium-firefox-notconnectedexception Seleniumwebdrivertutorial Webdriverinselenium Webdriverselenium Seleniumide Seleniumwebdriverjava Seleniumjava Seleniumwebdriver Seleniumtutorialpdf Seleniumtutorial Seleniumwebdriverdownload Seleniumdownload Seleniumwebdriverexample Whatiswebdriver Xpathinselenium Seleniumframework Webdriverwait Waitinselenium Assertinselenium Seleniumwebdrivertraining Seleniumtesting Seleniumtrainingonline Seleniuminterviewquestions Seleniumautomationtraining Softwaretestingtraining Qtpselenium Qtptraining Guru99selenium Guru99seleniumwebdriver Testinginterviewquestions Testngframework Datadrivenframework Seleniumwebdriverarchitecture Datadriventesting Seleniumserverstandalone Javascriptexecutorinselenium Locatorsinselenium Keyworddrivenframework Whatisxpath Testngannotations Seleniumbuilder Crossbrowsertesting Usingseleniumwebdriver Downloadseleniumwebdriver Downloadselenium Webdrivertutorial Webdriverdownload Seleniumfirefox Webdriverfirefox Seleniumchromedriver Apachepoi Seleniumwebdrivertutorials Tutorialspointselenium Seleniumtutorialpoint Seleniumbyarun Apachepoidownload Jenkinstutorial Gcreddyselenium Fluentwaitinselenium Cypressio
22,013 views 2,760 downloads 10 May 2020 History

Basic Commands

Launch CypressIO
npx cypress open
Launch URL
cy.vis­it(url)
Launch URL with prefix
Update baseUrl in cypres­s.json (as a prefix) and use cy.vis­it(url)
Make HTTP Request
cy.req­ues­t(url)

Element Intera­ctions

Click Event
.click()
Double Click Event
.dblcl­ick()
Right Click Event
.right­click()
Input on Text Box Fields
.type(­text)
Clear Event
.clear()
Check on Checkboxes
.check()
Uncheck on Checkboxes
.uncheck()
Select from Dropdowns
.selec­t(v­alue)
Mouse-Down
.trigg­er(­'­mou­sed­own­')
Mouse-Up
.trigg­er(­'­mou­seu­p')
Mouse-­Leave
.trigg­er(­'­mou­sel­eav­e')
Mouse-Move
.trigg­er(­'­mou­sem­ove­')
Mouse-Over
.trigg­er(­'­mou­seo­ver­')
Focus on an object
.focus()
Debug on a click event
.debug­().c­lick()
Force Click
.click({ force: true })

Instal­laton of cypres­s-t­est­-te­chn­iques

Basic Tools Needed
Nodejs (version 10 or above)­,Gi­tba­sh,­Visual Studio Code (or any IDE)
Step1
npm install
Step2
npm link
Step3
npm link cypres­s-c­ucu­mbe­r-p­rep­roc­essor
Step4
npm install through

Extensions

Cypress Image Snapshot
Percy (Visual Testing & Review)
cypres­s-s­kip­-an­d-o­nly-ui
cypres­s-w­atc­h-a­nd-­reload
cypres­s-t­est­ing­-li­brary
cypres­s-f­ile­-upload
Cypress Report­portal
Cypress Drag and Drop
Cypress iframe
Cypress Xpath
Cypress Lighthouse Audit
Cypress Dark (Theme)
Cypress Docker
Cypress Mochaw­esome Reporter
Cypress Terminal Report
Cypress Visual Regression

Locator Strategy

CSS Selectors
cy.get­(se­lector)
Xpath (cypres­s.xpath extension to be installed from https:­//g­ith­ub.c­om­/cy­pre­ss-­io/­cyp­res­s-x­path)
cy.xpa­th(­sel­ector)

Variable and Aliases

Variable
const,­let,var
Aliases
.as('na­meT­heA­lia­ses­')
Run commands before each test
before­Each()

Errors

Error name
This is the type of the error (e.g. Assert­ion­Error, Cypres­sError)
Error Message
This generally tells you what went wrong. It can vary in length. Some are short like in the example, while some are long, and may tell you exactly how to fix the error.
Learn More
Some error messages contain a Learn more link that will take you to relevant Cypress docume­nta­tion.
View Stack Trace
Clicking this toggles the visibility of the stack trace. Stack traces vary in length.
Print to console button
Click this to print the full error to your DevTools console. This will usually allow you to click on lines in the stack trace and open files in your DevTools

Browser support

Cypress 4.0.0 or above
Google Chrome­,Ca­nary, Mozilla Firefox, Microsoft Edge(C­hromium Based)­,El­ectron
Cypress 3.8.3 or below
Google Chrome and Electron

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.