R31-1 R31-4: 收口详情页工作台化与 E2E 契约
这个提交包含在:
@@ -0,0 +1,66 @@
|
||||
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 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();
|
||||
}
|
||||
|
||||
async reject(comment: string) {
|
||||
await this.rejectCommentInput.fill(comment);
|
||||
await this.rejectBtn.click();
|
||||
}
|
||||
|
||||
async returnTask(comment: string) {
|
||||
await this.returnCommentInput.fill(comment);
|
||||
await this.returnBtn.click();
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户