forked from hiqdev/hipanel-module-stock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPartView.ts
27 lines (23 loc) · 918 Bytes
/
PartView.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import {Page} from "@playwright/test";
import Notification from "@hipanel-core/helper/Notification";
import DetailMenu from "@hipanel-core/helper/DetailMenu";
export default class PartView {
private page: Page;
private notification: Notification;
private detailMenu: DetailMenu;
public constructor(page: Page) {
this.page = page;
this.notification = new Notification(page);
this.detailMenu = new DetailMenu(page);
this.registerAcceptDeleteDialogHandler();
}
private registerAcceptDeleteDialogHandler() {
// By default, dialogs are auto-dismissed by Playwright, so you don't have to handle them
this.page.on('dialog', async dialog => await dialog.accept());
}
public async deletePart()
{
await this.detailMenu.clickDetailMenuItem("Delete");
await this.notification.hasNotification('Part has been deleted');
}
}