Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test-e2e/cases/PW-AUTH-02/test.spec.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions test-e2e/cases/PW-PROFILE-01/test.spec.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions test-e2e/infra/automation/d4/pages/auth.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down
Loading