8일차: Cypress 공식문서 Getting Started 공부 - 1 : Writing Your First Test

용어정리

install

npm i cypress -D

execute

$(npm bin)/cypress open
npx cypress open
{
  "scripts": {
    "cypress:open": "cypress open"
  }
}

Add a test file

touch {your_project}/cypress/integration/sample_spec.js

3A or GWT of Cypress

  1. Visit a web page
  2. Query for an element.
  3. Interact with that element. ⇒ 페이지 이동시 URL Assertion 해야함.
  4. Assert about the content on the page.

자신의 서버에서 테스트해야하는 이유

  1. 언제든지 사이트가 바뀔수가 있다
  2. 해당 사이트가 A/B 테스트 중이라 결과에 일관성이 없을 수도 있다
  3. Google 과 같은 사이트는 이런 스크립트를 감지해서 접근 거부한다.