Skip to content

HP-2382 removed code duplicate #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
21 changes: 5 additions & 16 deletions tests/playwright/helper/PincodeForm.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import {expect, Locator, Page} from "@playwright/test";
import ClientView from "@hipanel-module-client/page/ClientView";
import Notification from "@hipanel-core/helper/Notification";

export default class PincodeForm {
private page: Page;
private view: ClientView;
private notification: Notification;

public constructor(page: Page, view: ClientView) {
this.page = page;
this.view = view;
this.notification = new Notification(page);
}

public async loadPincodeForm() {
Expand Down Expand Up @@ -79,25 +82,11 @@ export default class PincodeForm {
}

public async hasNotification(message: string) {
const notification = this.notification();
const successMessage = notification.locator('.alert', { hasText: message });
await expect(successMessage).toBeVisible();
}

notification(): Locator {
return this.page.locator('.ui-pnotify');
await this.notification.hasNotification(message);
}

public async closeNotification() {
const notification = this.notification();
if (await notification.isVisible()) {
await notification.hover();

const closeButton = notification.locator('.ui-pnotify-closer');
if (await closeButton.isVisible()) {
await closeButton.click();
}
}
await this.notification.closeNotification();
}

public async disablePinUsingAnswer(question: string, answer: string){
Expand Down