e2e 수정
This commit is contained in:
@@ -79,10 +79,10 @@ test("프리뷰 폼 제출 후 제출 내역 페이지에서 데이터가 보여
|
||||
await page.getByRole("button", { name: "폼 컨트롤러" }).click();
|
||||
|
||||
const fieldMappingGroup = page.getByRole("group", { name: "폼 필드 매핑" });
|
||||
const fieldCheckboxes = fieldMappingGroup.getByRole("checkbox");
|
||||
const fieldCheckboxes = fieldMappingGroup.locator("> label > input[type='checkbox']");
|
||||
const fieldCount = await fieldCheckboxes.count();
|
||||
for (let i = 0; i < fieldCount; i += 1) {
|
||||
await fieldCheckboxes.nth(i).check();
|
||||
await fieldCheckboxes.nth(i).check({ force: true });
|
||||
}
|
||||
|
||||
const submitSelect = page.getByRole("combobox", { name: "Submit 버튼" });
|
||||
@@ -101,10 +101,10 @@ test("프리뷰 폼 제출 후 제출 내역 페이지에서 데이터가 보여
|
||||
|
||||
// 해당 프로젝트 행에서 "편집" 링크를 클릭해 /editor?slug=... 로 이동한다.
|
||||
const projectRow = page.locator("tr", { hasText: projectSlug }).first();
|
||||
await projectRow.getByRole("link", { name: "편집" }).click();
|
||||
|
||||
// 에디터 페이지로 이동했는지 확인한다.
|
||||
await expect(page).toHaveURL(/\/editor/);
|
||||
await Promise.all([
|
||||
page.waitForURL(/\/editor/, { timeout: 15000 }),
|
||||
projectRow.getByRole("link", { name: "편집" }).click({ force: true }),
|
||||
]);
|
||||
|
||||
// 에디터 헤더의 "프리뷰 열기" 링크를 클릭해 프리뷰 페이지로 이동한다.
|
||||
await page.getByRole("link", { name: "프리뷰 열기" }).click();
|
||||
@@ -116,10 +116,16 @@ test("프리뷰 폼 제출 후 제출 내역 페이지에서 데이터가 보여
|
||||
const emailValue = `submitted-${now}@example.com`;
|
||||
const messageValue = "E2E 테스트 메시지";
|
||||
|
||||
const textboxes = page.getByRole("textbox");
|
||||
const textboxes = page.getByTestId("preview-form-input");
|
||||
const inputCount = await textboxes.count();
|
||||
// 최소 이름/이메일 2개 필드는 항상 존재해야 한다.
|
||||
expect(inputCount).toBeGreaterThanOrEqual(2);
|
||||
|
||||
await textboxes.nth(0).fill(nameValue);
|
||||
await textboxes.nth(1).fill(emailValue);
|
||||
await textboxes.nth(2).fill(messageValue);
|
||||
if (inputCount >= 3) {
|
||||
await textboxes.nth(2).fill(messageValue);
|
||||
}
|
||||
|
||||
// 프리뷰에는 기본 submit 버튼이 없고, 사용자 버튼 블록이 submit 으로 동작해야 한다.
|
||||
await page.getByRole("link", { name: "버튼" }).click();
|
||||
@@ -145,5 +151,7 @@ test("프리뷰 폼 제출 후 제출 내역 페이지에서 데이터가 보여
|
||||
// 테이블에 방금 제출한 값들이 포함되어 있어야 한다.
|
||||
await expect(page.getByText(nameValue)).toBeVisible();
|
||||
await expect(page.getByText(emailValue)).toBeVisible();
|
||||
await expect(page.getByText(messageValue)).toBeVisible();
|
||||
if (inputCount >= 3) {
|
||||
await expect(page.getByText(messageValue)).toBeVisible();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user