Skip to content

Commit

Permalink
feat: baseUrl 확인용 테스트코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
nakjun12 committed May 2, 2024
1 parent 4d4324f commit 45fc4b3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
14 changes: 7 additions & 7 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',
baseURL: "http://localhost:5173",

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry"
Expand Down Expand Up @@ -68,12 +68,12 @@ export default defineConfig({
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
]
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
webServer: {
command: "pnpm dev",
url: "http://localhost:5173",
reuseExistingServer: !process.env.CI
}
});
18 changes: 18 additions & 0 deletions playwright/base-url.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { test } from "@playwright/test";

test("Example test", async ({ page }) => {
// baseUrl에 정의된 URL로 이동합니다.
await page.goto("/");

// 예상 결과를 확인합니다.
// await expect(page.title()).resolves.toMatch("Expected Title");
});

test("Another test", async ({ page }) => {
// baseUrl에 정의된 URL로 이동합니다.
await page.goto("/");

// 특정 요소를 찾고 상태를 확인합니다.
// const text = await page.textContent(".selector");
// expect(text).toBe("Expected Text");
});

0 comments on commit 45fc4b3

Please sign in to comment.