본문 바로가기

Test

codeceptJS 설치법

1. node 버전을 최신으로 바꾼다.

 

2. 프로젝트 폴더에 들어가서 다음을 입력해 codeceptjs를 설치한다.

 

npx create-codeceptjs .

 

3. 다음을 입력해 초기 설정을 한다.

 

npx codeceptjs init

 

여러 옵션을 선택할 수 있는 리스트가 나타나고 default로 하되

helpers를 물을 때에는 Playwright를 선택한다.

 

4. _test.js 파일의 내용을 바꾼다.

 

Feature('My First Test');

 

Scenario('test something', ({ I }) => {

    I.amOnPage('https://github.com');

    I.see('GitHub');

});

 

5. 다음을 입력해 위의 내용 대로 테스트 한다.

 

npm run codeceptjs

 

아래의 두 가지 다른 모드로 테스트할 수도 있다.

 

npm run codeceptjs:headless

npm run codeceptjs:ui

 

깃허브 : github.com/ipf-gwkim/simple-codecept

참고 : codecept.io/quickstart/