Cypress.io - Automation tool
------------------------------------
How to install cypress: https://docs.cypress.io/guides/getting-started/installing-cypress.html
---------------------------------------------------------------------------------------------------------------
1. install Homebrew (if not already installed)
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. install node:
- brew install node
- brew upgrade node
- check node -v
2. install npm:
- npm is the world's largest Software Library (Registry)
- npm is also a software Package Manager and Installer)
- check if npm is already installed by checking npm -v
- if not, type install npm
- check npm -v
3. install cypress:
- npm install cypress --save-dev
4. install supporting libraries:
- npm install --save-dev @testing-library/dom
- npm install --save-dev @testing-library/react
- npm install --save-dev @testing-library/jest-dom
- npm install --save-dev cypress @testing-library/cypress
- npm install -g eslint
- npm install -g node-modules
More info here:
1. https://github.com/cypress-io/cypress
2. https://docs.cypress.io/guides/getting-started/installing-cypress.html
Cypress FAQ:
-----------------
1. how to open cypress(once installed)
./node_modules/.bin/cypress open
or, npx cypress open (prefer)
or, yarn run cypress open
2. how to create a file
- open terminal and create a file e.g. test1.js inside folder: /Users/rakesh/cypress/integration
3. how to run the above file using cypress - test runner
- in the testrunner, under integration , look for above file(test1.js) and click on it
- it will launch in chrome (url: http://localhost:51636/__/#/tests/integration/test1.js) and
shows the result
4. how to run cypress in headless mode:
https://snipcart.com/blog/frontend-testing-cypress
$ cypress run
5. how to run a js code locally in the terminal:
node file.js
Cypress Pros and Cons:
-----------------------------
Pros:
1. its built for front end/automation developers
2. it uses JS language, which front end webpages are also written in
3. it uses Mocha testing framework
Cons:
1. Cypress does not support cross browser testing:
- latest update: https://github.com/cypress-io/cypress/issues/310
2. Cypress supports only JS
Cypress Best practises:
-----------------------------
1. how to select elements properly:
https://docs.cypress.io/guides/references/best-practices.html#Selecting-Elements
2. assertions:
https://docs.cypress.io/guides/references/assertions.html#Chai
------------------------------------
How to install cypress: https://docs.cypress.io/guides/getting-started/installing-cypress.html
---------------------------------------------------------------------------------------------------------------
1. install Homebrew (if not already installed)
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. install node:
- brew install node
- brew upgrade node
- check node -v
2. install npm:
- npm is the world's largest Software Library (Registry)
- npm is also a software Package Manager and Installer)
- check if npm is already installed by checking npm -v
- if not, type install npm
- check npm -v
3. install cypress:
- npm install cypress --save-dev
4. install supporting libraries:
- npm install --save-dev @testing-library/dom
- npm install --save-dev @testing-library/react
- npm install --save-dev @testing-library/jest-dom
- npm install --save-dev cypress @testing-library/cypress
- npm install -g eslint
- npm install -g node-modules
More info here:
1. https://github.com/cypress-io/cypress
2. https://docs.cypress.io/guides/getting-started/installing-cypress.html
Cypress FAQ:
-----------------
1. how to open cypress(once installed)
./node_modules/.bin/cypress open
or, npx cypress open (prefer)
or, yarn run cypress open
2. how to create a file
- open terminal and create a file e.g. test1.js inside folder: /Users/rakesh/cypress/integration
3. how to run the above file using cypress - test runner
- in the testrunner, under integration , look for above file(test1.js) and click on it
- it will launch in chrome (url: http://localhost:51636/__/#/tests/integration/test1.js) and
shows the result
4. how to run cypress in headless mode:
https://snipcart.com/blog/frontend-testing-cypress
$ cypress run
5. how to run a js code locally in the terminal:
node file.js
Cypress Pros and Cons:
-----------------------------
Pros:
1. its built for front end/automation developers
2. it uses JS language, which front end webpages are also written in
3. it uses Mocha testing framework
Cons:
1. Cypress does not support cross browser testing:
- latest update: https://github.com/cypress-io/cypress/issues/310
2. Cypress supports only JS
Cypress Best practises:
-----------------------------
1. how to select elements properly:
https://docs.cypress.io/guides/references/best-practices.html#Selecting-Elements
2. assertions:
https://docs.cypress.io/guides/references/assertions.html#Chai
3 comments:
Your blog is interesting to read, thanks for sharing this and keep update your blog regularly.
React JS Training in Chennai
React JS course in Chennai
AngularJS Training in Chennai
Angular 6 Training in Chennai
Web Designing course in Chennai
PHP Training Institute in Chennai
ccna course in Chennai
React JS Training in Velachery
This is an wonderful blog with an unique and awesome information.
AngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery
Really informative and useful information.
Cyber Security Training Course in Chennai | Certification | Cyber Security Online Training Course | Ethical Hacking Training Course in Chennai | Certification | Ethical Hacking Online Training Course |
CCNA Training Course in Chennai | Certification | CCNA Online Training Course | RPA Robotic Process Automation Training Course in Chennai | Certification | RPA Training Course Chennai | SEO Training in Chennai | Certification | SEO Online Training Course
Post a Comment