Home
Basics
Introduction Environment Setup Cypress Components First Test Running Tests Reports Element Identification GUI interaction Cypress Hooks Cypress Fixtures Integration with CI serversAdvanced
Page Object Model Custom Commands Intercepting Requests Backend Testing Interview Questions and AnswersInstallation of Cypress and Environment setup
Please follow below steps to setup Cypress on your machine.- Install git, Node and VSCode
- Create a project directory
- Go to newly created directory and run this command
npm init
- Install cypress
npm i cypress
Cypress Configuration
We can configure cypress in 2 ways.- E2E testing - This option is used when you want to test entire website
- Component testing - This option is used when you want to test individual components.
Cypress Configuration
console.log(Cypress.arch)
let myConfig = Cypress.config()
expect(myConfig).to.have.property('baseUrl', null)
expect(myConfig).to.have.property('viewportHeight', 1280)
expect(myConfig).to.have.property('viewportWidth', 720)
expect(myConfig).to.have.property('pageLoadTimeout', 60000)
expect(Cypress.config('pageLoadTimeout')).to.eq(60000)
// change config
Cypress.config('pageLoadTimeout', 20000)
Web development and Automation testing
solutions delivered!!