Files
twenty/packages/twenty-e2e-testing/lib/pom/helper/iconSelect.ts
BOHEUS c571c9bdca Playwright POM (#8109)
Related to #6641
2024-11-07 15:38:28 +01:00

24 lines
710 B
TypeScript

import { Locator, Page } from '@playwright/test';
export class IconSelect {
private readonly iconSelectButton: Locator;
private readonly iconSearchInput: Locator;
constructor(public readonly page: Page) {
this.iconSelectButton = page.getByLabel('Click to select icon (');
this.iconSearchInput = page.getByPlaceholder('Search icon');
}
async selectIcon(name: string) {
await this.iconSelectButton.click();
await this.iconSearchInput.fill(name);
await this.page.getByTitle(name).click();
}
async selectRelationIcon(name: string) {
await this.iconSelectButton.nth(1).click();
await this.iconSearchInput.fill(name);
await this.page.getByTitle(name).click();
}
}