angular_wait_barrier.d.ts 1.77 KB
Newer Older
jatuporn Tonggasem's avatar
jatuporn Tonggasem committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
import { SimpleWebDriverClient } from './simple_webdriver_client';
import { WebDriverCommand } from './webdriver_commands';
import { WebDriverLogger } from './webdriver_logger';
import { WebDriverBarrier } from './webdriver_proxy';
/**
 * A barrier that uses Angular's Testability API to block commands until the application is stable.
 */
export declare class AngularWaitBarrier implements WebDriverBarrier {
    private client;
    rootSelector: string;
    enabled: boolean;
    logger: WebDriverLogger;
    constructor(client: SimpleWebDriverClient);
    /**
     * A CSS Selector for a DOM element within your Angular application.
     * BlockingProxy will attempt to automatically find your application, but it is
     * necessary to set rootElement in certain cases.
     *
     * In Angular 1, BlockingProxy will use the element your app bootstrapped to by
     * default.  If that doesn't work, it will then search for hooks in `body` or
     * `ng-app` elements (details here: https://git.io/v1b2r).
     *
     * In later versions of Angular, BlockingProxy will try to hook into all angular
     * apps on the page. Use rootElement to limit the scope of which apps
     * BlockingProxy waits for and searches within.
     *
     * @param rootSelector A selector for the root element of the Angular app.
     */
    setRootSelector(selector: string): void;
    private waitForAngularData();
    /**
     * Turn on WebDriver logging.
     *
     * @param logDir The directory to create logs in.
     */
    enableLogging(logDir: string): void;
    /**
     * Override the logger instance. Only used for testing.
     */
    setLogger(logger: WebDriverLogger): void;
    private sendRequestToStabilize(command);
    private shouldStabilize(command);
    onCommand(command: WebDriverCommand): Promise<void>;
}