8일차: Cypress 공식문서 Getting Started 공부 - 1 : Writing Your First Test
용어정리
- chaining: command 들의 이야기 집합
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
- Visit a web page
- Query for an element.
- Interact with that element. ⇒ 페이지 이동시 URL Assertion 해야함.
- Assert about the content on the page.
자신의 서버에서 테스트해야하는 이유
- 언제든지 사이트가 바뀔수가 있다
- 해당 사이트가 A/B 테스트 중이라 결과에 일관성이 없을 수도 있다
- Google 과 같은 사이트는 이런 스크립트를 감지해서 접근 거부한다.