https://github.com/luisvalgoi/cypress-playground
Repository dedicated to learn more about the usage of Cypress.
https://github.com/luisvalgoi/cypress-playground
cypress cypress-io test-automation testing
Last synced: over 1 year ago
JSON representation
Repository dedicated to learn more about the usage of Cypress.
- Host: GitHub
- URL: https://github.com/luisvalgoi/cypress-playground
- Owner: LuisValgoi
- Created: 2021-08-06T23:54:40.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T12:53:36.000Z (almost 5 years ago)
- Last Synced: 2025-02-05T13:43:04.535Z (over 1 year ago)
- Topics: cypress, cypress-io, test-automation, testing
- Language: JavaScript
- Homepage:
- Size: 63.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### REFERENCE
- [https://www.youtube.com/watch?v=OIAzwr-_jhY&ab_channel=codedamn](https://www.youtube.com/watch?v=OIAzwr-_jhY&ab_channel=codedamn)
### MOTIVATION
- to keep old features stables w/a breaking acting as a security layer
### COMPARISON
- `selenium` = acts as a new layer (compatability) from the browser and the app (headless)
- `cypress` = acts by sitting inside the browser (node process aka `task runner`)
### ADVANTAGES
- you have much more control of the pages
### DISAVANTAGES
- suffer by experience the native problems
### COMMANDS
- `npm i cypress` = Installing
- `npx cypress open`= Opening Cypress Local Runner
- `npx cypress run --headless` = Opening Cypress Headless
### NOTES
- Agnostic end 2 end testing framework
- if you are using variable declaration, you are using cypress wrong
- test commands are executed in a deterministic manner.
- this results in a flake-free testing.
- subjects are passsed through the chain.
### FOLDERS STRUCTURES
- `fixtures` = dummy data which you may want to use (API mock)
- `integratio` = where your spec / test files will be
- `plugins` = extending default functionalities
- `support` = utils folder
### HELPERs
There are several [commands to be used](https://docs.cypress.io/api/commands/and)
- `cy.visit` = Visit the given url.
- `cy.contains` = Get the DOM element containing the text (works partially as well).
- `cy.get` = Get one or more DOM elements by node name: input, button, etc.
- `cy.log` = Print a message to the Cypress Command Log.
- `cy.then` = Enables you to work with the subject yielded from the previous command.
- `...rightClick()` = Right-click a DOM element.
- `cy.viewport` = sets the view port of the page when launched by runner.
- `cy.intercept` = [mock/spy/stub HTTP requests.](https://docs.cypress.io/api/commands/intercept#Syntax)
### ASSERT
Normally, after `GIVEN` and `WHEN` , comes the `THEN`
So, in order to assert, exists these [commands here](https://docs.cypress.io/guides/references/assertions)
- `.should(....)` = Asserts if target is not strictly `(===)` equal to either `null` or `undefined`
