Cypress.io基础-01

 1.What you should have?

  • Solid foundation in JavaScript syntax. In particular ES6 syntax.

2. The software you'll need?

  • nodejs
  • NPM
    npm install -g npm
    npm -v

    If you get an error saying something like permission denied, just use sudo before everything.

3. Why Cypress?

  • Test the application that represent the user's point of view.
  • scalable end-to-end testing
  • easy to use library that allow us to conduct automated testing
  • Open source and free
  • Tests run inside a real browser
  • It also has access to the network layer over application, which allow us to controll all the network requests that go in and out of application(simulationg when our server has an error)
  • Element visibility
  • Access all the browser resources

4. Limitations

  • Data mining
  • Web-crawling
  • Only language Cypress supports for writing test in is JavaScript
  • Can't test multiple tabs or windows/ browsers at the same time
  • Doesn't allow multiplee superdomains(domain name) in one test

5. Cypress 捆绑的库: 

Cypress relies on many best-of-breed open source testing libraries to lend stability and familiarity to the platform from the get-go.

  • Mocha
  • Chai
  • Chai-jQuery
  • Sinon.JS
  • Sinon-Chai

6. Running

  • IDE: VSCode
  • Set up an npm package and install it. Initialize directory as an npm package:
    npm init -y //=>create file package.json
  • Install Cypress in project:
    npm install --save-dev cypress
  • Open Cypress:
    npx cypress open
posted @ 2022-09-19 13:43  jane21  阅读(31)  评论(0)    收藏  举报