mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
694 B
26 lines
694 B
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { Page } from '@playwright/test';
|
|
|
|
export class Dropdown {
|
|
constructor(private readonly page: Page) {}
|
|
|
|
public async delete(button = /Yes/) {
|
|
await this.actionAndConfirm('Delete', button);
|
|
}
|
|
|
|
public async action(name: string) {
|
|
await this.page.getByText(name).click();
|
|
await this.page.locator('sqx-dropdown-menu').waitFor({ state: 'hidden' });
|
|
}
|
|
|
|
public async actionAndConfirm(name: string, button = /Yes/) {
|
|
await this.action(name);
|
|
await this.page.getByRole('button', { name: button }).click();
|
|
}
|
|
}
|