feat: v2.1.0 界面与凭据改进 —— 单一 API/MCP Key、邮件 Markdown 正文、/inboxs 域名筛选、暗色主题
- 单一 Key:API 与 MCP 共用一个 wmh_ Key,凭据迁移至 settings 表(0004 删除 api_credentials) - Markdown:入库时 HTML→Markdown(mailhook 同思路),webhook payload 新增 markdown 字段 - /emails 路由改为 /inboxs 并支持域名筛选;设置按钮移入头像下拉 - 主题切换按钮(头像左侧,亮/暗持久化);设置模态仅 全局 Webhook/账号密码 两 tab 且高度限屏 - 列表操作列按钮加 SVG 图标;mailboxes 去 Webhook 列;最近邮件加收件人列
This commit is contained in:
+19
-11
@@ -42,7 +42,7 @@ await page.click("button[type=submit]");
|
||||
await page.waitForURL(`${BASE}/`, { timeout: 8000 });
|
||||
await page.waitForSelector("text=概览", { timeout: 8000 });
|
||||
check("登录成功进入概览页", true);
|
||||
// 品牌区版本号 tag(v1.1.0,来源 package.json)
|
||||
// 品牌区版本号 tag(v2.1.0,来源 package.json)
|
||||
const versionTag = await page.locator(".brand-version").textContent();
|
||||
check("LOGO 版本号 tag 显示", Boolean(versionTag && /^v\d+\.\d+\.\d+$/.test(versionTag.trim())), versionTag?.trim());
|
||||
await page.waitForTimeout(600);
|
||||
@@ -53,7 +53,7 @@ const pages = [
|
||||
{ path: "/accounts", expect: "账号", shot: "03-accounts.png" },
|
||||
{ path: "/domains", expect: "域名", shot: "04-domains.png" },
|
||||
{ path: "/mailboxes", expect: "邮箱", shot: "05-mailboxes.png" },
|
||||
{ path: "/emails", expect: "邮件", shot: "06-emails.png" },
|
||||
{ path: "/inboxs", expect: "收件箱", shot: "06-inboxs.png" },
|
||||
];
|
||||
for (const p of pages) {
|
||||
await page.goto(`${BASE}${p.path}`, { waitUntil: "domcontentloaded" });
|
||||
@@ -76,7 +76,7 @@ await page.screenshot({ path: `${SHOT_DIR}/07-domain-drawer.png` });
|
||||
await page.keyboard.press("Escape");
|
||||
|
||||
// 5. 邮件详情(点击第一行)
|
||||
await page.goto(`${BASE}/emails`, { waitUntil: "domcontentloaded" });
|
||||
await page.goto(`${BASE}/inboxs`, { waitUntil: "domcontentloaded" });
|
||||
await page.waitForSelector(".ant-table-row", { timeout: 8000 });
|
||||
await page.locator(".ant-table-row").first().click();
|
||||
await page.waitForSelector(".ant-drawer-open", { timeout: 8000 });
|
||||
@@ -86,18 +86,26 @@ await page.screenshot({ path: `${SHOT_DIR}/08-email-detail.png` });
|
||||
await page.keyboard.press("Escape");
|
||||
|
||||
// 6. 设置模态窗口:基本设置 + 生成 MCP Key
|
||||
await page.locator("button[aria-label='设置']").click();
|
||||
// 头像下拉里打开设置(设置按钮已移入下拉菜单)
|
||||
await page.locator(".ant-dropdown-trigger, .app-header .ant-dropdown-trigger").first().hover();
|
||||
await page.waitForSelector(".ant-dropdown:not(.ant-dropdown-hidden)", { timeout: 8000 });
|
||||
await page.click(".ant-dropdown .ant-dropdown-menu-item:has-text('设置')");
|
||||
await page.waitForSelector(".ant-modal:has-text('全局 Webhook')", { timeout: 8000 });
|
||||
check("设置模态窗口打开(全局 Webhook / Ingress / 密码)", true);
|
||||
await page.screenshot({ path: `${SHOT_DIR}/09-settings-general.png` });
|
||||
check("设置模态窗口经头像下拉打开(仅 全局 Webhook / 账号密码 两 tab)", true);
|
||||
await page.screenshot({ path: `${SHOT_DIR}/09-settings-webhook.png` });
|
||||
|
||||
await page.click(".ant-tabs-tab:has-text('MCP Keys')");
|
||||
await page.waitForSelector("button:has-text('生成 MCP Key')", { timeout: 8000 });
|
||||
await page.click("button:has-text('生成 MCP Key')");
|
||||
// 单一 API/MCP Key:在 全局 Webhook tab 内生成
|
||||
const genBtn = page.getByRole("button", { name: /生成/ });
|
||||
await genBtn.waitFor({ state: "visible", timeout: 8000 });
|
||||
await genBtn.click();
|
||||
await page.waitForSelector(".ant-modal:has-text('仅显示一次')", { timeout: 8000 });
|
||||
const keyText = await page.locator(".ant-modal:has-text('仅显示一次') .mono").first().textContent();
|
||||
check("生成 MCP Key 弹窗(wmh_ 32 位)", Boolean(keyText && keyText.trim().startsWith("wmh_") && keyText.trim().length === 32), keyText?.trim());
|
||||
await page.screenshot({ path: `${SHOT_DIR}/10-mcp-key-created.png` });
|
||||
check("生成 API/MCP Key 弹窗(wmh_ 32 位,单一 Key)", Boolean(keyText && keyText.trim().startsWith("wmh_") && keyText.trim().length === 32), keyText?.trim());
|
||||
await page.screenshot({ path: `${SHOT_DIR}/10-api-key-created.png` });
|
||||
|
||||
// 主题切换按钮存在(头像左侧)
|
||||
const themeBtn = await page.locator("button[aria-label='切换主题']").count();
|
||||
check("主题切换按钮存在(头像左侧)", themeBtn === 1);
|
||||
|
||||
await browser.close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user