
ํ๋ก ํธ์๋ ๊ฐ๋ฐ์์๋ UI๊ฐ ์ฌ์ฉ์์ ์ง์ ๋ง๋ฟ์ ์๊ธฐ ๋๋ฌธ์,
์ ์ฒด์ ์ธ ์ฌ์ฉ์ ํ๋ฆ์ด ์๋๋๋ก ๋์ํ๋์ง ํ์ธํ๋ ๊ฒ์ด ๋งค์ฐ ์ค์ํ๋ค.
์ด๋ ์ฌ์ฉํ๋ ๊ฒ์ด ๋ฐ๋ก E2E(End-to-End) ํ
์คํธ์ด๋ฉฐ,
์ด๋ฅผ ์๋ํํจ์ผ๋ก์จ ๊ฐ๋ฐ ํจ์จ๊ณผ ์๋น์ค ์ ๋ขฐ์ฑ์ ๋์ผ ์ ์๋ค.
์ฌ์ฉ์๊ฐ ์ค์ ๋ก ์๋น์ค๋ฅผ ์ฌ์ฉํ๋ ํ๋ฆ ์ ์ฒด๋ฅผ ์๋ฎฌ๋ ์ด์ ํ๋ ํ ์คํธ
๋จ์ ํ ์คํธ(unit test), ํตํฉ ํ ์คํธ(integration test)์ ๋ฌ๋ฆฌ, UI๋ฅผ ํตํด ์ค์ ๋์์ ๊ฒ์ฆํ๋ค. ํ๋ก ํธ์ ๋ฐฑ์๋, DB๊ฐ ํจ๊ป ์ฐ๋๋ ์ํ์์ ํ ์คํธ๊ฐ ์ํ๋๋ค.
| ๋๊ตฌ | ํน์ง |
|---|---|
| Cypress | ์ง๊ด์ ์ธ API์ ๋น ๋ฅธ ์คํ ์๋ |
| Playwright | ๋ค์ํ ๋ธ๋ผ์ฐ์ ์ง์ (Chrome, Firefox, WebKit) |
| Puppeteer | Headless Chrome ๊ธฐ๋ฐ, Google์ด ๊ฐ๋ฐ |
npm install cypress --save-dev
cypress/e2e/login.cy.ts)describe('๋ก๊ทธ์ธ ํ
์คํธ', () => {
it('๋ก๊ทธ์ธ ์ฑ๊ณต ์ ๋ฉ์ธ ํ์ด์ง๋ก ์ด๋ํ๋ค', () => {
cy.visit('/login');
cy.get('input[name="email"]').type('user@example.com');
cy.get('input[name="password"]').type('123456');
cy.get('button[type="submit"]').click();
cy.url().should('include', '/main');
});
});
npx cypress open # UI ์คํ
npx cypress run # CLI ์คํ
cy.wait() ๋์ ๋ช
ํํ ์กฐ๊ฑด ์ฌ์ฉ