Skip to content

Commit a8edee5

Browse files
committed
feat: 60초 동안 3명 접속 E2E 부하 테스트 작성
1 parent 8ff4011 commit a8edee5

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

Diff for: performance-test.ts

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
async function performanceTest(page) {
2+
await page.goto("https://octodocs.local");
3+
const element = await page.getByTestId("rf__node-4");
4+
5+
// tanstack이 띄워져 있으면 제거
6+
const tanstackClose = await page.locator(
7+
'button[aria-label="Close tanstack query devtools"]'
8+
);
9+
if (tanstackClose) {
10+
await tanstackClose.click();
11+
}
12+
13+
await element.scrollIntoViewIfNeeded();
14+
await element.click();
15+
const document = await page.locator('div[contenteditable="true"]');
16+
await document.waitFor({ state: "visible" }); // 요소가 보일 때까지 기다림
17+
await document.click();
18+
// "hello world"를 차례대로 입력
19+
await page.keyboard.type("h", { delay: 100 });
20+
await page.keyboard.type("e", { delay: 100 });
21+
await page.keyboard.type("l", { delay: 100 });
22+
await page.keyboard.type("l", { delay: 100 });
23+
await page.keyboard.type("o", { delay: 100 });
24+
await page.keyboard.type(" ");
25+
await page.keyboard.type("w", { delay: 100 });
26+
await page.keyboard.type("o", { delay: 100 });
27+
await page.keyboard.type("r", { delay: 100 });
28+
await page.keyboard.type("l", { delay: 100 });
29+
await page.keyboard.type("d", { delay: 100 });
30+
31+
// await page.locator('input[type="text"]').fill(""); // 기존 값 지우기
32+
// Expect a title "to contain" a substring.
33+
}
34+
35+
module.exports = { performanceTest };

Diff for: performance-test.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
config:
2+
target: https://octodocs.local
3+
phases:
4+
- duration: 60
5+
arrivalRate: 3
6+
# Load the Playwright engine:
7+
engines:
8+
playwright:
9+
{
10+
launchOptions: { headless: true },
11+
contextOptions: { ignoreHTTPSErrors: true },
12+
}
13+
# Path to JavaScript file that defines Playwright test functions
14+
# TypeScript is also supported
15+
processor: "./performance-test.ts"
16+
ignoreHTTPSErrors: true
17+
scenarios:
18+
- engine: playwright
19+
testFunction: performanceTest

0 commit comments

Comments
 (0)