feat: localize optimizer interface

This commit is contained in:
Codex
2026-06-21 23:43:02 +08:00
parent 1298456683
commit 1596de4527
6 changed files with 72 additions and 56 deletions
+14 -14
View File
@@ -1,31 +1,31 @@
import { expect, test } from "@playwright/test";
test("happy path creates optimized article and export links", async ({ page }) => {
test("中文界面可以生成优化文章和导出链接", async ({ page }) => {
await page.goto("/");
await page.getByLabel("Title").fill("Example Technology Co., Ltd. GEO guide");
await page.getByLabel("标题").fill("Example Technology Co., Ltd. GEO 指南");
await page
.getByLabel("Body")
.getByLabel("正文")
.fill(
"Example Technology Co., Ltd. has 8 years of GEO optimization experience. Example GEO helps marketing teams improve content structure.",
"Example Technology Co., Ltd. has 8 years of GEO optimization experience. Example GEO 帮助市场团队优化内容结构。",
);
await page.getByLabel("Images").fill("Product dashboard");
await page.getByLabel("User instructions").fill("Keep factual");
await page.getByLabel("图片描述或图片链接").fill("产品仪表盘截图");
await page.getByLabel("用户要求").fill("保持事实准确,语气自然。");
await page.getByRole("button", { name: "Analyze" }).click();
await expect(page.getByText("Candidate fact card created.")).toBeVisible();
await page.getByRole("button", { name: "分析文章" }).click();
await expect(page.getByText("候选事实卡已生成。")).toBeVisible();
await page
.locator("label")
.filter({ hasText: "uncertain items" })
.filter({ hasText: "待确认事项" })
.locator("textarea")
.fill("");
await page.getByRole("button", { name: "Confirm" }).click();
await expect(page.getByText("Fact card confirmed.")).toBeVisible();
await page.getByRole("button", { name: "确认事实卡" }).click();
await expect(page.getByText("事实卡已确认。")).toBeVisible();
await page.getByRole("button", { name: "Optimize" }).click();
await expect(page.getByText("Optimization complete.")).toBeVisible();
await expect(page.getByText("Quality Report")).toBeVisible();
await page.getByRole("button", { name: "开始优化" }).click();
await expect(page.getByText("优化完成。")).toBeVisible();
await expect(page.getByText("质量报告")).toBeVisible();
await expect(page.getByRole("link", { name: "optimized.md" })).toBeVisible();
await expect(page.getByRole("link", { name: "optimized.docx" })).toBeVisible();