import { WebElement } from '@contour/fet/lib/elements'; import { Button } from '@contour/fet/lib/elements/button'; import { Label } from '@contour/fet/lib/elements/label'; import { ContourBasePage } from '../../base/basePage'; import locator from './dcListing.locator'; export default class DcListing extends ContourBasePage { constructor(url?: string) { super(locator, url); } getSearchSubmitButton(): Button { return new Button(this.getLocatorAsString('searchSubmitButton')); } getSearchDCInput(): Button { return new Button(this.getLocatorAsString('searchDCInput')); } getCreateButton(): Button { return new Button(this.locators.createBtn); } getDcRefByUuid(uuid: string): Label { return new Label(this.getLocatorAsString('dcRef').replace('#UUID_REF#', uuid)); } getDcBeneficiaryByUuid(uuid: string): Label { return new Label(this.getLocatorAsString('dcBeneficiary').replace('#UUID_REF#', uuid)); } getDcAmountByUuid(uuid: string): Label { return new Label(this.getLocatorAsString('dcAmount').replace('#UUID_REF#', uuid)); } getDcExpiryDateByUuid(uuid: string): Label { return new Label(this.getLocatorAsString('dcExpiryDate').replace('#UUID_REF#', uuid)); } getDcExpiryDateByExpiryDate(expiryDate: string): Label { return new Label(this.getLocatorAsString('dcExpiryDateByText').replace('#EXPIRY_DATE#', expiryDate)); } getDcMainStatusByUuid(): Label { return new Label(this.getLocatorAsString('dcMainStatus')); } getDcSubStatusByUuid(): Label { return new Label(this.getLocatorAsString('dcSubStatus')); } getAmendmentMainStatus(uuid: string): Label { return new Label(this.getLocatorAsString('amendmentMainStatus').replace('#UUID_REF#', uuid)); } getAmendmentSubStatus(uuid: string): Label { return new Label(this.getLocatorAsString('amendmentSubStatus').replace('#UUID_REF#', uuid)); } getDpMainStatusByUuid(uuid: string): Label { return new Label(this.getLocatorAsString('dpMainStatus').replace('#UUID_REF#', uuid)); } getDpSubStatusByUuid(uuid: string): Label { return new Label(this.getLocatorAsString('dpSubStatus').replace('#UUID_REF#', uuid)); } async getLatestUUID(): Promise { const ele = new Label(this.getLocatorAsString('row1UUID')); await browser.waitUntil(() => { return ele.isExisting(); }); return ele.getText(); } getErrorMessage() { return new WebElement(this.getLocatorAsString('pageErrorMessage')); } getNoRecordsDisplay() { return new WebElement(this.getLocatorAsString('noRecordsDisplay')); } }