본문으로 건너뛰기

시작하기

설치:

shell
npm install cypress --save-dev
shell
npm install cypress --save-dev

사이프러스 실행:

shell
npx cypress open
shell
npx cypress open

테스트 파일 최상단에 다음 코드가 있어야 합니다.

tsx
/// <reference types="cypress" />
tsx
/// <reference types="cypress" />

프로덕션이 아닌 로컬 개발 서버에서 테스트를 해야 합니다.

cypress.config 파일에서 baseUrl을 설정할 수 있습니다.

tsx
import { defineConfig } from 'cypress';
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:8080',
},
});
tsx
import { defineConfig } from 'cypress';
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:8080',
},
});