git clone https://github.com/bappasahabapi/cypress-basic.gitnpm installnpx cypress open
--
🌱 basic set up commands
npm init -ynpm install cypress-
`npx cypress open` and automatically cypress folder created for testing npx cypress -vnpx cypress verify
--
-
- how to write base url
- configure e2e testing
- configure components testing
- common configuration for both
-
Cypres press enter key -
Access Elements
Page Object Model
a design principlekeep the objects & methods separate from test script- efficient reusability
- easier, efficient and faster changes & maintenance
Page objects problems
- Page objects make tests slow
- page objects are hard to maintain and take away time from actual application development.
- Page objects try to fit multiple cases into a uniform interface, falling back to conditional logic - a huge anti-pattern in our opinion.
Alternative to page objects that I call “Application Actions”
*Read and write files in cypress
- Read files using
fixture() - Read files using
readFile() - Write files using
writeFile()