* Fix invalid select options * Add test for multiselect filling and fix bug with csv reporting * Fix options getting duplicated * Add getQueryBuilderConfig tests
20 lines
484 B
TypeScript
20 lines
484 B
TypeScript
import type { Page } from "@playwright/test";
|
|
|
|
export const selectInteractions = {
|
|
async chooseOption({
|
|
page,
|
|
selector,
|
|
optionText,
|
|
}: {
|
|
page: Page;
|
|
selector: string;
|
|
optionText: string;
|
|
}): Promise<void> {
|
|
// Open dropdown
|
|
await page.locator(selector).click();
|
|
const selectParentWithOptions = page.locator(`:has(> ${selector})`);
|
|
// Select option
|
|
await selectParentWithOptions.getByText(optionText, { exact: true }).click();
|
|
},
|
|
};
|