UNPKG

@badisi/wdio-harness

Version:

WebdriverIO support for Angular component test harnesses.

35 lines (34 loc) 2 kB
import { ComponentHarness, ComponentHarnessConstructor, HarnessEnvironment } from '@angular/cdk/testing'; import { WebdriverIOTestElement } from './WebdriverIOTestElement.js'; /** * A `HarnessEnvironment` implementation for WebdriverIO. */ export declare class WebdriverIOHarnessEnvironment extends HarnessEnvironment<WebdriverIO.Element> { /** * Keep a reference to the `document` element because `rawRootElement` * will be the root element of the harness's environment. */ private documentRoot; protected constructor(rawRootElement: WebdriverIO.Element, options: { documentRoot: WebdriverIO.Element; }); /** Creates a `HarnessLoader` rooted at the document root. */ static loader(documentRoot: WebdriverIO.Element): Promise<WebdriverIOHarnessEnvironment>; /** * Flushes change detection and async tasks captured in the Angular zone. * In most cases it should not be necessary to call this manually. However, there may be some edge * cases where it is needed to fully flush animation events. */ forceStabilize(): Promise<void>; waitForTasksOutsideAngular(): Promise<void>; /** Creates a `ComponentHarness` for the given harness type with the given raw host element. */ createComponentHarness<T extends ComponentHarness>(harnessType: ComponentHarnessConstructor<T>, element: WebdriverIO.Element): T; /** Gets a list of all elements matching the given selector under this environment's root element. */ protected getAllRawElements(selector: string): Promise<WebdriverIO.Element[]>; /** Gets the root element for the document. */ protected getDocumentRoot(): WebdriverIO.Element; /** Creates a `TestElement` from a raw element. */ protected createTestElement(element: WebdriverIO.Element): WebdriverIOTestElement; /** Creates a `HarnessLoader` rooted at the given raw element. */ protected createEnvironment(element: WebdriverIO.Element): HarnessEnvironment<WebdriverIO.Element>; }