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
|
Launch CypressIO
|
npx cypress open
|
|
Launch URL
|
cy.visit(url)
|
|
Launch URL with prefix
|
Update baseUrl in cypress.json (as a prefix) and use cy.visit(url)
|
|
Make HTTP Request
|
cy.request(url)
|
|
Click Event
|
.click()
|
|
Double Click Event
|
.dblclick()
|
|
Right Click Event
|
.rightclick()
|
|
Input on Text Box Fields
|
.type(text)
|
|
Clear Event
|
.clear()
|
|
Check on Checkboxes
|
.check()
|
|
Uncheck on Checkboxes
|
.uncheck()
|
|
Select from Dropdowns
|
.select(value)
|
|
Mouse-Down
|
.trigger('mousedown')
|
|
Mouse-Up
|
.trigger('mouseup')
|
|
Mouse-Leave
|
.trigger('mouseleave')
|
|
Mouse-Move
|
.trigger('mousemove')
|
|
Mouse-Over
|
.trigger('mouseover')
|
|
Focus on an object
|
.focus()
|
|
Debug on a click event
|
.debug().click()
|
|
Force Click
|
.click({ force: true })
|
|
Basic Tools Needed
|
Nodejs (version 10 or above),Gitbash,Visual Studio Code (or any IDE)
|
|
Step1
|
npm install
|
|
Step2
|
npm link
|
|
Step3
|
npm link cypress-cucumber-preprocessor
|
|
Step4
|
npm install through
|
|
Cypress Image Snapshot
|
|
|
Percy (Visual Testing & Review)
|
|
|
cypress-skip-and-only-ui
|
|
|
cypress-watch-and-reload
|
|
|
cypress-testing-library
|
|
|
cypress-file-upload
|
|
|
Cypress Reportportal
|
|
|
Cypress Drag and Drop
|
|
|
Cypress iframe
|
|
|
Cypress Xpath
|
|
|
Cypress Lighthouse Audit
|
|
|
Cypress Dark (Theme)
|
|
|
Cypress Docker
|
|
|
Cypress Mochawesome Reporter
|
|
|
Cypress Terminal Report
|
|
|
Cypress Visual Regression
|
|
CSS Selectors
|
cy.get(selector)
|
|
Xpath (cypress.xpath extension to be installed from https://github.com/cypress-io/cypress-xpath)
|
cy.xpath(selector)
|
|
Variable
|
const,let,var
|
|
Aliases
|
.as('nameTheAliases')
|
|
Run commands before each test
|
beforeEach()
|
|
Error name
|
This is the type of the error (e.g. AssertionError, CypressError)
|
|
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 documentation.
|
|
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
|
|
Cypress Documentation
|
|
|
Cypress Test Techniques
|
|
|
Cypress Book
|
|
Cypress 4.0.0 or above
|
Google Chrome,Canary, Mozilla Firefox, Microsoft Edge(Chromium Based),Electron
|
|
Cypress 3.8.3 or below
|
Google Chrome and Electron
|
|
Cypress Test Techniques
|
|
|
Cypress Testing Library
|
|
|
Cypress Axe (Accessibility)
|
|
|
Cypress Code Coverage
|
|
|
Cypress Example API Testing
|
|
|
Cypress Lighthouse Audit
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.