文件
hyb-oa/client/tests/e2e/helpers/pageObjects/WorkflowTaskDetailPage.ts
T

67 行
1.5 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 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();
}
}