INNER CODE UNIT · TypeScript
queryAppState
blokadaorg/blokada · automation/appium/wdio/src/flows/app.ts:6
async function queryAppState(bundleId: string): Promise<number> {
return driver.execute("mobile: queryAppState", { bundleId });
}
export async function waitForAppForeground(bundleId: string, timeout = 20000): Promise<void> {
await driver.waitUntil(
async () => {
const state = await queryAppState(bundleId);
return state === APP_STATE_RUNNING_IN_FOREGROUND;
},
{
timeout,
timeoutMsg: `App ${bundleId} did not reach foreground state within ${timeout}ms`
}
);
}
export async function waitForAppTermination(bundleId: string, timeout = 10000): Promise<void> {