Skip to content

Commit d5eb31b

Browse files
committed
test: 단위테스트를 제거
1 parent beaf85f commit d5eb31b

File tree

10 files changed

+464
-991
lines changed

10 files changed

+464
-991
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
unit:
13+
basic:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v3
@@ -24,11 +24,10 @@ jobs:
2424
with:
2525
node-version: 22
2626
cache: 'pnpm'
27-
- name: Install dependencies
28-
run: |
27+
- run: |
2928
pnpm install
30-
pnpm run test
31-
e2e:
29+
pnpm run test:e2e:basic
30+
advanced:
3231
timeout-minutes: 60
3332
runs-on: ubuntu-latest
3433
steps:
@@ -47,4 +46,4 @@ jobs:
4746
run: |
4847
pnpm install
4948
npx playwright install --with-deps
50-
pnpm run test:e2e
49+
pnpm run test:e2e:advanced

e2e/E2EHelpers.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export class E2EHelpers {
2+
constructor(page) {
3+
this.page = page;
4+
}
5+
6+
// 페이지 로딩 대기
7+
async waitForPageLoad() {
8+
await this.page.waitForSelector('[data-testid="products-grid"], #products-grid', { timeout: 10000 });
9+
await this.page.waitForFunction(() => {
10+
const text = document.body.textContent;
11+
return text.includes("총") && text.includes("개");
12+
});
13+
}
14+
15+
// 상품을 장바구니에 추가
16+
async addProductToCart(productName) {
17+
await this.page.click(
18+
`text=${productName} >> xpath=ancestor::*[contains(@class, 'product-card')] >> .add-to-cart-btn`,
19+
);
20+
await this.page.waitForSelector("text=장바구니에 추가되었습니다", { timeout: 5000 });
21+
}
22+
23+
// 장바구니 모달 열기
24+
async openCartModal() {
25+
await this.page.click("#cart-icon-btn");
26+
await this.page.waitForSelector(".cart-modal-overlay", { timeout: 5000 });
27+
}
28+
}

0 commit comments

Comments
 (0)