Open terminal and do --------npm init
Accept all defaults,then do following ------npm install Cypress (It will take some time to install) -----npm i prettier (for code formatting) Then add .prettierrc with list of default code in json format
Open Cypress dashboard using below command: npx Cypress Open
This will create Cypress folder and Cypress.json file in workspace
Create tsconfig.json and paste following configuration in it: { "compilerOptions": { "allowJs": true, "baseUrl": "../node_modules", "types": [ "cypress" ] }, "include": [ "**/." ] }
Under package.json add following: "scripts": { "cy:open": "cypress open" }, From Terminal fire below command: This should open Cypress dashboard npm run cy:open
"cy:run": "cypress run"
Fixtures: Are used to store static data
https://docs.cypress.io/api/commands/wait#Syntax
https://docs.cypress.io/api/commands/get#Selector
In Cypress Mocha provides hooks like Before() and After() before-- to setup system state after --- to clean the state, cookies/local storage
it.skip will skip the test it.only will run that test only
npm i cypress-xpath then add following under support>>index.js file require('cypress-xpath')
npx cypress run --spec="cypress/integration/examples/ScrollPage.spec.js
This file contains all the configuration required for working in project References: https://docs.cypress.io/guides/references/configuration#cypress-json options are: Global, timeouts,file/folders,screenshot path,videos,downloads,viewport,browser
https://example.com/
https://books.toscrape.com/
https://demoqa.com/automation-practice-form
https://itera-qa.azurewebsites.net/home/automation
https://devexpress.github.io/testcafe/example/