platform/qms-tests/sanity/tests/model/contact-page.ts
Alexey Zinoviev f3c231df0a
UBERF-9502: Account uuids in models (#8125)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
2025-03-05 12:22:15 +07:00

29 lines
884 B
TypeScript

import { expect, type Locator, type Page } from '@playwright/test'
export class ContactPage {
page: Page
constructor (page: Page) {
this.page = page
}
readonly appContact = (): Locator => this.page.locator('[id="app-contact\\:string\\:Contacts"]')
readonly employeeNavElement = (Employee: string): Locator =>
this.page.locator(`.hulyNavItem-container:has-text("${Employee}")`)
readonly employeeEntry = (first: string, last: string): Locator =>
this.page.locator(`td:has-text("${last} ${first}")`)
async clickAppContact (): Promise<void> {
await this.appContact().click()
}
async clickEmployeeNavElement (Employee: string): Promise<void> {
await this.employeeNavElement(Employee).click()
}
async checkIfPersonIsCreated (first: string, last: string): Promise<void> {
await expect(this.employeeEntry(first, last)).toBeVisible()
}
}