1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-23 08:07:35 +00:00
bramw_baserow/e2e-tests/pages/components/templateModal.ts
2024-11-14 12:30:42 +00:00

30 lines
797 B
TypeScript

import { Locator, Page } from "@playwright/test";
export class TemplateModal {
private readonly page: Page;
private readonly templateBodyLayout: Locator;
private readonly modelLoadingSpinner: Locator;
private readonly useThisTemplateButton: Locator;
constructor(page: Page) {
this.page = page;
this.templateBodyLayout = this.page.locator(".templates__body .layout");
this.modelLoadingSpinner = this.page.locator(
".modal__box .header__loading"
);
this.useThisTemplateButton = this.page.getByText(/use this template/i);
}
async waitUntilLoaded() {
await this.templateBodyLayout.waitFor();
}
getLoadingSpinner() {
return this.modelLoadingSpinner;
}
async clickUseThisTemplateButton() {
await this.useThisTemplateButton.click();
}
}