Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
import { Page } from 'playwright';
const selectors = {
actionButton: ( text: string ) => `button:has-text("${ text }")`,
};
/**
*
*/
export class ReactModalComponent< PageObject > {
private page: Page;
readonly pageObject: PageObject;
/**
* Constructs an instance of this component.
*
* @param {Page} page The underlying page.
* @param {any} pageObject Dependency injected page object.
*/
constructor( page: Page, pageObject: PageObject ) {
this.page = page;
this.pageObject = pageObject;
}
/**
* Clicks on the button on the modal.
*
* @param {string} text Text to match on the button.
*/
async clickButton( text: string ): Promise< void > {
const locator = this.page.locator( selectors.actionButton( text ) );
await locator.click();
}
}