@badisi/wdio-harness
Version:
WebdriverIO support for Angular component test harnesses.
32 lines (31 loc) • 1.81 kB
TypeScript
import type { ComponentHarness, HarnessQuery } from '@angular/cdk/testing';
import { WebdriverIOHarnessEnvironment } from './WebdriverIOHarnessEnvironment.js';
/**
* Searches for all instances of the component corresponding to the given harness type under the
* `HarnessLoader`'s root element, and returns a list of `ComponentHarness` for each instance.
* @param query A query for a harness to create
* @return A list of instances of the given harness type
*/
export declare const getAllHarnesses: <T extends ComponentHarness>(query: HarnessQuery<T>) => Promise<T[]>;
/**
* Searches for an instance of the component corresponding to the given harness type or host element
* under the `HarnessLoader`'s root element, and returns a `ComponentHarness` for that instance. If
* multiple matching components are found, a harness for the first one is returned. If no matching
* component is found, an error is thrown.
* @param query A query for a harness to create
* @param element A raw host element for a harness to create
* @return An instance of the given harness type
* @throws If a matching component instance can't be found
*/
export declare const getHarness: <T extends ComponentHarness>(query: HarnessQuery<T>, element?: WebdriverIO.Element) => Promise<T>;
/**
* Returns a base harness environment instance.
* @return An HarnessLoader instance for the current HTML document, rooted at the document's root element
*/
export declare const createHarnessEnvironment: (rootElement?: WebdriverIO.Element) => Promise<WebdriverIOHarnessEnvironment>;
/**
* Returns a promise that resolves when the application is "stable".
* The promise might be rejected due to timeouts, or async tasks in the client
* app that never finish (timers, etc).
*/
export declare const waitForAngular: () => Promise<void>;