增加 PC 企业微信扫码登录(07-30-pc-wecom-qr-login)
这个提交包含在:
@@ -8,6 +8,8 @@ function mockWecomConfigPayload() {
|
||||
corpId: "wx-test-corp",
|
||||
agentId: "1000001",
|
||||
loginUrl: "/api/auth/wecom/login?returnTo=%2Fmobile",
|
||||
pcWebLoginEnabled: true,
|
||||
pcLoginUrl: "/api/auth/wecom/login?returnTo=%2Fportal&entrySource=pc_qr",
|
||||
bindEnabled: true,
|
||||
defaultReturnTo: "/mobile",
|
||||
status: "ready",
|
||||
@@ -53,14 +55,23 @@ async function mockWecomConfig(page: import("@playwright/test").Page) {
|
||||
});
|
||||
}
|
||||
|
||||
test("E2E 企微入口:普通浏览器下只提示企业微信工作台打开", async ({ page }) => {
|
||||
test("E2E 企微入口:普通浏览器显示托管扫码入口并保留安全回跳", async ({ page }) => {
|
||||
await mockAuthBase(page);
|
||||
await mockWecomConfig(page);
|
||||
let loginEntryUrl = "";
|
||||
await page.route("**/api/auth/wecom/login?**", async (route) => {
|
||||
loginEntryUrl = route.request().url();
|
||||
await route.fulfill({ status: 200, contentType: "text/plain", body: "mock pc wecom login entry" });
|
||||
});
|
||||
|
||||
await page.goto("/login");
|
||||
await page.goto("/login?redirect=%2Freimbursements");
|
||||
await expect(page.getByTestId("login-password-primary-panel")).toBeVisible();
|
||||
await expect(page.getByTestId("wecom-entry-browser-notice")).toContainText("请从企业微信工作台打开 OA");
|
||||
await expect(page.getByTestId("wecom-entry-secondary")).toHaveCount(0);
|
||||
await expect(page.getByTestId("wecom-entry-pc")).toHaveText("企业微信扫码登录");
|
||||
await page.getByTestId("wecom-entry-pc").click();
|
||||
await expect.poll(() => loginEntryUrl).toContain("entrySource=pc_qr");
|
||||
expect(new URL(loginEntryUrl).searchParams.get("returnTo")).toBe("/reimbursements");
|
||||
expect(new URL(loginEntryUrl).searchParams.get("deviceFingerprint")).toBeTruthy();
|
||||
await expect(page.getByTestId("wecom-entry-browser-notice")).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("E2E 企微入口:企业微信场景优先显示企微 CTA,并展示映射缺失提示", async ({ page }) => {
|
||||
@@ -83,6 +94,7 @@ test("E2E 企微入口:企业微信场景优先显示企微 CTA,并展示映
|
||||
await page.goto("/login?redirect=%2Fportal&wecom=account_mapping_required");
|
||||
await expect(page.getByTestId("login-wecom-primary-panel")).toBeVisible();
|
||||
await expect(page.getByTestId("wecom-entry-primary")).toBeVisible();
|
||||
await expect(page.getByTestId("wecom-entry-pc")).toHaveCount(0);
|
||||
await expect(page.getByTestId("login-wecom-notice")).toContainText("企业微信账号映射尚未完成");
|
||||
await expect(page.getByTestId("login-wecom-notice")).not.toContainText("账号密码登录");
|
||||
await expect(page.getByTestId("login-password-secondary-panel")).toBeVisible();
|
||||
|
||||
在新工单中引用
屏蔽一个用户