Files
HKSingleParty/99_references/cf-identity-wallet-main/tests/screen-objects/base.screen.ts
2025-05-28 09:55:51 +08:00

17 lines
550 B
TypeScript

export const delay = (ms: number) => new Promise((res) => setTimeout(res, ms));
export const findFilterAndClickElement = async (locator: string) => {
await delay(100);
await $(locator).waitForExist();
const element = await $$(locator).filter((element) => element.isClickable());
await element[0].click();
};
export const findAndClickLocator = async (locator: string) => {
const element = await $(locator);
await element.waitForExist();
await element.waitForDisplayed();
await element.waitForClickable();
await element.click();
};