INNER CODE UNIT · TypeScript

waitForAppForeground

blokadaorg/blokada · automation/appium/wdio/src/flows/app.ts:10

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> {
  await driver.waitUntil(
    async () => {
      const state = await queryAppState(bundleId);
      return state === APP_STATE_NOT_RUNNING;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…