mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
5fa8f0069d
* remove babel and add configs * add ts-node * lint scripts * eslint override * remove type module * add expect errors * update js files to ts * fix electron import * remove errors * update readme * add build step * typesync * add eslintignore
26 lines
751 B
TypeScript
26 lines
751 B
TypeScript
import findAsync from './find-async';
|
|
|
|
const findDropdownItemWithText = async (parent, text) => {
|
|
let item;
|
|
await parent.waitUntil(async () => {
|
|
const items = await parent.react$$('DropdownItem');
|
|
item = await findAsync(items, async i => (await i.getText()) === text);
|
|
return !!item;
|
|
});
|
|
return item;
|
|
};
|
|
|
|
export const clickDropdownItemByText = async (parent, text) => {
|
|
const item = await findDropdownItemWithText(parent, text);
|
|
await item.waitForDisplayed();
|
|
await item.click();
|
|
};
|
|
|
|
export const clickOpenDropdownItemByText = async (app, text) => {
|
|
const item = await app.client
|
|
.$('.dropdown__menu[aria-hidden=false]')
|
|
.then(e => e.$(`button*=${text}`));
|
|
await item.waitForDisplayed();
|
|
await item.click();
|
|
};
|