B1-B8 建立项目级流程与QA门禁
这个提交包含在:
@@ -33,9 +33,9 @@ test("E2E 企微首次绑定:未绑定回退到密码登录后可继续进入
|
||||
oauthEnabled: true,
|
||||
corpId: "wx-test-corp",
|
||||
agentId: "1000001",
|
||||
loginUrl: "/api/auth/wecom/login?returnTo=%2Fportal",
|
||||
loginUrl: "/api/auth/wecom/login?returnTo=%2Fmobile",
|
||||
bindEnabled: true,
|
||||
defaultReturnTo: "/portal",
|
||||
defaultReturnTo: "/mobile",
|
||||
status: "ready",
|
||||
statusReasons: [],
|
||||
}),
|
||||
@@ -46,6 +46,7 @@ test("E2E 企微首次绑定:未绑定回退到密码登录后可继续进入
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
headers: { "set-cookie": "has_session=1; Path=/; SameSite=Lax" },
|
||||
body: JSON.stringify(
|
||||
envelope({
|
||||
accessToken: "wecom-fallback-token",
|
||||
@@ -56,6 +57,20 @@ test("E2E 企微首次绑定:未绑定回退到密码登录后可继续进入
|
||||
),
|
||||
});
|
||||
});
|
||||
await page.route("**/api/auth/refresh", async (route) => {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
headers: { "set-cookie": "has_session=1; Path=/; SameSite=Lax" },
|
||||
body: JSON.stringify(
|
||||
envelope({
|
||||
accessToken: "wecom-fallback-token",
|
||||
expiresIn: 900,
|
||||
mustChangePassword: false,
|
||||
}),
|
||||
),
|
||||
});
|
||||
});
|
||||
await page.route("**/api/me", async (route) => {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
@@ -99,9 +114,9 @@ test("E2E 企微首次绑定:未绑定回退到密码登录后可继续进入
|
||||
persisted: true,
|
||||
profile: "small_team_internal",
|
||||
orgMode: "single_company",
|
||||
primaryEntryMode: "password",
|
||||
primaryEntryMode: "wecom",
|
||||
notificationStrategy: "in_app",
|
||||
devicePriority: "desktop",
|
||||
devicePriority: "mobile",
|
||||
moduleVisibility: {},
|
||||
createdAt: null,
|
||||
updatedAt: null,
|
||||
@@ -162,10 +177,13 @@ test("E2E 企微首次绑定:未绑定回退到密码登录后可继续进入
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto("/login?redirect=%2Fportal&wecom=unbound");
|
||||
await page.goto("/login?redirect=%2Fmobile&wecom=unbound");
|
||||
await expect(page.getByTestId("login-wecom-notice")).toContainText("当前企业微信账号尚未绑定");
|
||||
if (await page.getByTestId("login-identifier").count() === 0) {
|
||||
await page.getByRole("button", { name: "使用账号密码登录" }).click();
|
||||
}
|
||||
await page.getByTestId("login-identifier").fill("[email protected]");
|
||||
await page.getByTestId("login-password").fill("ResetA1abc123def456");
|
||||
await page.getByTestId("login-submit").click();
|
||||
await expect(page).toHaveURL(/\/portal/);
|
||||
await expect(page).toHaveURL(/\/mobile/);
|
||||
});
|
||||
|
||||
在新工单中引用
屏蔽一个用户