diff --git a/test-e2e/cases/PW-AUTH-02/test.spec.ts b/test-e2e/cases/PW-AUTH-02/test.spec.ts index 26519b79e0..5917e37212 100644 --- a/test-e2e/cases/PW-AUTH-02/test.spec.ts +++ b/test-e2e/cases/PW-AUTH-02/test.spec.ts @@ -1,3 +1,5 @@ +// Copyright (c) 2025-2026 Huawei Technologies Co., Ltd. All rights reserved. + import { journey } from "../../infra/automation/d4/runner/journey"; import { testUser, appPath, runToken } from "../../infra/automation/d4/runner/runtime-config"; import { AuthPage } from "../../infra/automation/d4/pages/auth.page"; @@ -77,7 +79,7 @@ journey("PW-AUTH-02", async ({ page, contract, expect }) => { await page.keyboard.press("Enter"); const [response] = await Promise.all([ page.waitForResponse((candidate) => candidate.url().includes("/api/invitations") && candidate.request().method() === "POST"), - dialog.getByRole("button", { name: "确 定", exact: true }).click(), + dialog.getByRole("button", { name: "确定", exact: true }).click(), ]); expect([200, 201]).toContain(response.status()); invitationCreated = true; @@ -150,7 +152,7 @@ journey("PW-AUTH-02", async ({ page, contract, expect }) => { await dialog.getByPlaceholder("请输入密码").fill(newUserPassword); const [response] = await Promise.all([ reloginPage.waitForResponse((candidate) => candidate.url().includes("/api/user/signin") && candidate.request().method() === "POST"), - dialog.getByRole("button", { name: "登 录", exact: true }).click(), + dialog.getByRole("button", { name: "登录", exact: true }).click(), ]); const current = await reloginPage.request.get("/api/user/current_user_info"); const body = await current.json().catch(() => null); diff --git a/test-e2e/cases/PW-PROFILE-01/test.spec.ts b/test-e2e/cases/PW-PROFILE-01/test.spec.ts index e38894ec68..3cc4667dcd 100644 --- a/test-e2e/cases/PW-PROFILE-01/test.spec.ts +++ b/test-e2e/cases/PW-PROFILE-01/test.spec.ts @@ -1,3 +1,5 @@ +// Copyright (c) 2025-2026 Huawei Technologies Co., Ltd. All rights reserved. + import { randomBytes } from "node:crypto"; import { journey } from "../../infra/automation/d4/runner/journey"; import { testUser, appPath } from "../../infra/automation/d4/runner/runtime-config"; @@ -113,14 +115,14 @@ journey("PW-PROFILE-01", async ({ page, contract, expect }) => { await dialog.getByPlaceholder("请输入密码").fill(user.password); const [oldResponse] = await Promise.all([ page.waitForResponse((candidate) => candidate.url().includes("/api/user/signin") && candidate.request().method() === "POST"), - dialog.getByRole("button", { name: "登 录", exact: true }).click(), + dialog.getByRole("button", { name: "登录", exact: true }).click(), ]); observed.oldPasswordRejected = oldResponse.status() === 401; expect(observed.oldPasswordRejected).toBeTruthy(); await dialog.getByPlaceholder("请输入密码").fill(temporaryPassword); const [newResponse] = await Promise.all([ page.waitForResponse((candidate) => candidate.url().includes("/api/user/signin") && candidate.request().method() === "POST"), - dialog.getByRole("button", { name: "登 录", exact: true }).click(), + dialog.getByRole("button", { name: "登录", exact: true }).click(), ]); observed.newPasswordAccepted = newResponse.status() === 200; expect(observed.newPasswordAccepted).toBeTruthy(); diff --git a/test-e2e/infra/automation/d4/pages/auth.page.ts b/test-e2e/infra/automation/d4/pages/auth.page.ts index 0abf170f7b..0d51e128ba 100644 --- a/test-e2e/infra/automation/d4/pages/auth.page.ts +++ b/test-e2e/infra/automation/d4/pages/auth.page.ts @@ -21,7 +21,7 @@ export class AuthPage { await this.page.getByPlaceholder("请输入密码").first().fill(user.password); const [response] = await Promise.all([ this.page.waitForResponse((candidate) => candidate.url().includes("/api/user/signin") && candidate.request().method() === "POST"), - this.page.getByRole("button", { name: "登 录", exact: true }).click(), + this.page.getByRole("button", { name: "登录", exact: true }).click(), ]); await expect(this.page.getByRole("button", { name: "登录账户" })).toBeHidden(); return response.status(); @@ -41,7 +41,7 @@ export class AuthPage { await this.page.getByRole("menuitem", { name: /退出登录/ }).click(); const [response] = await Promise.all([ this.page.waitForResponse((candidate) => candidate.url().includes("/api/user/logout")), - this.page.getByRole("button", { name: "确 定", exact: true }).click(), + this.page.getByRole("button", { name: "确定", exact: true }).click(), ]); await this.expectLoggedOut(); return response.status();