
์ธ์ ํ
์คํธ(acceptance test)๋ ์์คํ
์ด ์๊ตฌ์ฌํญ์ ์ถฉ์กฑํ๋์ง ํ์ธํ๋ ํ
์คํธ๋ค.
๋ณดํต ์ค์ ์ฌ์ฉ์์ ์๋๋ฆฌ์ค๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ
์คํธํ๋ฉฐ, ๊ธฐ๋ฅ์ด ์ ๋๋ก ๋์ํ๋์ง๋ฅผ ๊ฒ์ฆํ๋ค.
์ด ํ ์คํธ๋ฅผ ์๋ํํ๋ฉด ํ์ง์ ์ ์งํ๋ฉด์ ๋น ๋ฅธ ๋ฐฐํฌ๊ฐ ๊ฐ๋ฅํด์ง๋ค.
์ธ์ ํ ์คํธ๋ ์ฌ์ฉ์์ ์๊ตฌ์ฌํญ์ด๋ ์๋๋ฆฌ์ค๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์์ฑํ๋ค. ๋ค์๊ณผ ๊ฐ์ ๋ชฉ์ ์ด ์๋ค:
| ๋๊ตฌ | ์ค๋ช |
|---|---|
| Cypress | ๋ธ๋ผ์ฐ์ ๊ธฐ๋ฐ E2E ํ ์คํธ ํ๋ ์์ํฌ |
| Playwright | ํฌ๋ก์ค ๋ธ๋ผ์ฐ์ ์๋ํ ํ๋ ์์ํฌ, Microsoft ์ ๊ณต |
| Selenium | ์ ํต์ ์ธ ์๋ํ ํ๋ ์์ํฌ, ๋ค์ํ ์ธ์ด ์ง์ |
# ์ค์น
$ npm install cypress --save-dev
# ์คํ
$ npx cypress open
// cypress/e2e/sample.cy.js
describe('๋ก๊ทธ์ธ ๊ธฐ๋ฅ ํ
์คํธ', () => {
it('์ฌ์ฉ์๋ ์ฌ๋ฐ๋ฅธ ์ ๋ณด๋ฅผ ์
๋ ฅํ๋ฉด ๋ก๊ทธ์ธํ ์ ์๋ค', () => {
cy.visit('http://localhost:3000/login');
cy.get('input[name="email"]').type('test@example.com');
cy.get('input[name="password"]').type('12345678');
cy.get('button[type="submit"]').click();
cy.url().should('include', '/dashboard');
});
});