Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2단계 - 자동차 경주 구현] 곤이(김기융) 미션 제출합니다. #40

Merged
merged 10 commits into from
Feb 18, 2021
Merged
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<img width="400" src="https://techcourse-storage.s3.ap-northeast-2.amazonaws.com/7c76e809d82a4a3aa0fd78a86be25427">
</p>

### 🎮URL

- https://yungo1846.github.io/javascript-racingcar/

### 🎯 step1

- [x] 주어진 횟수 동안 n대의 자동차는 전진 또는 멈출 수 있다.
Expand All @@ -29,10 +33,10 @@

### 🎯🎯 step2

- [ ] 자동차 경주 게임의 턴이 진행 될 때마다 1초의 텀(progressive 재생)을 두고 진행한다.
- [ ] 애니메이션 구현을 위해 setInterval, setTimeout, requestAnimationFrame 을 활용한다.
- [ ] 정상적으로 게임의 턴이 다 동작된 후에는 결과를 보여주고, 2초 후에 축하의 alert 메세지를 띄운다.
- [ ] 위 기능들이 정상적으로 동작하는지 Cypress를 이용해 테스트한다.
- [x] 자동차 경주 게임의 턴이 진행 될 때마다 1초의 텀(progressive 재생)을 두고 진행한다.
- [x] 애니메이션 구현을 위해 setInterval, setTimeout, requestAnimationFrame 을 활용한다.
- [x] 정상적으로 게임의 턴이 다 동작된 후에는 결과를 보여주고, 2초 후에 축하의 alert 메세지를 띄운다.
- [x] 위 기능들이 정상적으로 동작하는지 Cypress를 이용해 테스트한다.

<br>

Expand Down
14 changes: 12 additions & 2 deletions cypress/integration/carRacing.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,21 @@ context('carRacing', () => {
});

it('다시 시작하기를 눌렀을 때도 정상적으로 게임이 플레이 되는지 확인한다.', () => {
const racingCount = 3;
inputCarNames('car1, car2, car3');
inputRacingCount(5);
inputRacingCount(racingCount);
cy.wait(racingCount * 1000);
clickRestartButton();

checkRacingRound('car1, car2, car3');
});

it('최종 우승자가 정상적으로 출력되는지 확인한다.', () => {
const racingCount = 3;
inputCarNames('car1, car2, car3');
inputRacingCount(5);
inputRacingCount(racingCount);

cy.wait(racingCount * 1000);

const winners = [];
let maxCount = -1;
Expand All @@ -101,6 +106,11 @@ context('carRacing', () => {
});

cy.get('.winners-list').should('have.text', winners.join(', '));
cy.wait(2000).then(() => {
cy.on('window:alert', (message) => {
expect(message).to.equal(alertConstants.WINNER_CONGRATULATION_MESSAGE(winners));
});
});
});
});
});
299 changes: 0 additions & 299 deletions cypress/integration/examples/actions.spec.js

This file was deleted.