文件
wangsli 96488d8052 R7E-16D 审批动作二次确认
Refs: R7E-16D BIZ8-12B QAOPS8-17
2026-05-15 21:20:49 +08:00

81 行
2.1 KiB
TypeScript

import { expect, type Page } from "@playwright/test";
import { TEST_IDS } from "../testIds";
export class WorkflowTaskDetailPageObject {
readonly page: Page;
constructor(page: Page) {
this.page = page;
}
get overview() {
return this.page.getByTestId(TEST_IDS.workflow.overview);
}
get summary() {
return this.page.getByTestId(TEST_IDS.workflow.summary);
}
get approveBtn() {
return this.page.getByTestId(TEST_IDS.workflow.approve);
}
get rejectCommentInput() {
return this.page.getByTestId(TEST_IDS.workflow.rejectComment);
}
get rejectBtn() {
return this.page.getByTestId(TEST_IDS.workflow.reject);
}
get returnCommentInput() {
return this.page.getByTestId(TEST_IDS.workflow.returnComment);
}
get returnBtn() {
return this.page.getByTestId(TEST_IDS.workflow.returnBtn);
}
get actionError() {
return this.page.getByTestId(TEST_IDS.workflow.actionError);
}
get actionConfirmDialog() {
return this.page.getByTestId("workflow-action-confirm-dialog");
}
get actionConfirmSubmit() {
return this.page.getByTestId("workflow-action-confirm-submit");
}
get transferApproverSelect() {
return this.page.getByTestId(TEST_IDS.workflow.transferApprover);
}
async assertLoaded() {
await expect(this.overview).toBeVisible({ timeout: 15_000 });
await expect(this.summary).toBeVisible({ timeout: 15_000 });
}
async approve() {
await this.approveBtn.click();
await expect(this.actionConfirmDialog).toContainText("确认后将进入下一审批节点");
await this.actionConfirmSubmit.click();
}
async reject(comment: string) {
await this.rejectCommentInput.fill(comment);
await this.rejectBtn.click();
await expect(this.actionConfirmDialog).toContainText("当前流程将终止");
await this.actionConfirmSubmit.click();
}
async returnTask(comment: string) {
await this.returnCommentInput.fill(comment);
await this.returnBtn.click();
await expect(this.actionConfirmDialog).toContainText("回到申请人修改态");
await this.actionConfirmSubmit.click();
}
}