Show Menu
Cheatography

Cypressio cheat sheet helps in using right code examples for the automation frameworks. This cheat sheet is created for the participants of udemy course: www.udemy.com/course/cypressio

Basic Commands

Launch CypressIO
npx cypress open
Launch URL
cy.vis­it(url)
Launch URL with prefix
Update baseUrl in cypr­ess.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(­'mo­use­down')
Mouse-Up
.trigg­er(­'mo­useup')
Mouse-­Leave
.trigg­er(­'mo­use­leave')
Mouse-Move
.trigg­er(­'mo­use­move')
Mouse-Over
.trigg­er(­'mo­use­over')
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

 

Locator Strategy

CSS Selectors
cy.get­(se­lector)
Xpath (cyp­res­s.x­path 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('n­ame­The­Ali­ases')
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

Learn

Record and Playback

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

Framework Reposi­tories

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          ISTQB Test Automation Engineering Cheat Sheet
          Selenium WebDriver Cheat Sheet Cheat Sheet

          More Cheat Sheets by Narayanan Palani

          Selenium WebDriver Cheat Sheet Cheat Sheet
          ISTQB Test Automation Engineering Cheat Sheet