Skip to content

Commit

Permalink
refactor: 통합 테스트 관련 파일을 폴더로 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Aug 24, 2023
1 parent a55c838 commit b9bb1f9
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 29 deletions.
19 changes: 19 additions & 0 deletions e2e/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
playwright:
build:
context: ..
dockerfile: e2e/dockerfile
command: pnpm e2e # ls -al e2e # pnpm e2e
environment:
DISPLAY: ${DISPLAY}
env_file: ../.env
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- ../src:/app/src:ro
- ../vite.config.ts:/app/vite.config.ts:ro
- ../package.json:/app/package.json:ro
- ../e2e:/app/e2e:ro
- ../test-results.docker:/app/test-results
- ../playwright-report.docker:/app/playwright-report.docker
ports:
- 9323:9323
3 changes: 3 additions & 0 deletions playwright.dockerfile → e2e/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ RUN corepack enable && corepack prepare pnpm@latest --activate
# 브라우저 의존성 설치
RUN pnpm dlx playwright install-deps

COPY package.json pnpm-lock.yaml /app/
RUN pnpm install --frozen-lockfile

ENV IS_DOCKER=true
File renamed without changes.
1 change: 0 additions & 1 deletion playwright.config.ts → e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const baseURL = `http://127.0.0.1:${process.env.PORT || 4242}`;
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./e2e",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/search.spec.ts → e2e/tests/search.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test } from "@playwright/test";

test("전체 도서 목록 열람", async ({ page }) => {
await page.goto("http://localhost:4242/");
await page.getByRole("link").filter({ hasText: "도서목록" }).click();
await page.getByRole("link", { name: "도서목록" }).click();
await page.getByRole("button", { name: "IT 일반" }).click();
await page.getByRole("button", { name: "nextCategory" }).click();
await page.getByRole("button", { name: "preCategory" }).click();
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"build": "vite build",
"serve": "vite preview",
"lint": "eslint src",
"e2e": "playwright test",
"e2e:docker": "docker compose -f playwright.compose.yml up"
"e2e": "playwright test --config e2e",
"e2e:docker": "docker compose -f e2e/compose.yml up"
},
"eslintConfig": {
"extends": [
Expand Down
14 changes: 0 additions & 14 deletions playwright.compose.yml

This file was deleted.

11 changes: 0 additions & 11 deletions playwright.env.d.ts

This file was deleted.

0 comments on commit b9bb1f9

Please sign in to comment.