mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
13 lines
376 B
JavaScript
13 lines
376 B
JavaScript
|
import findAsync from './find-async';
|
||
|
|
||
|
export const clickDropdownItemByText = async (dropdown, text) => {
|
||
|
let item;
|
||
|
await dropdown.waitUntil(async () => {
|
||
|
const items = await dropdown.react$$('DropdownItem');
|
||
|
item = await findAsync(items, async i => (await i.getText()) === text);
|
||
|
return !!item;
|
||
|
});
|
||
|
await item.waitForDisplayed();
|
||
|
await item.click();
|
||
|
};
|