You need to sign in or sign up before continuing.
runner.d.ts 3.27 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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
/// <reference types="node" />
/// <reference types="q" />
import { EventEmitter } from 'events';
import * as q from 'q';
import { promise as wdpromise } from 'selenium-webdriver';
import { ProtractorBrowser } from './browser';
import { Config } from './config';
import { DriverProvider } from './driverProviders';
import { Plugins } from './plugins';
export declare class Runner extends EventEmitter {
    config_: Config;
    preparer_: any;
    driverprovider_: DriverProvider;
    o: any;
    plugins_: Plugins;
    restartPromise: q.Promise<any>;
    frameworkUsesAfterEach: boolean;
    ready_?: wdpromise.Promise<void>;
    constructor(config: Config);
    /**
     * Registrar for testPreparers - executed right before tests run.
     * @public
     * @param {string/Fn} filenameOrFn
     */
    setTestPreparer(filenameOrFn: string | Function): void;
    /**
     * Executor of testPreparer
     * @public
     * @param {string[]=} An optional list of command line arguments the framework will accept.
     * @return {q.Promise} A promise that will resolve when the test preparers
     *     are finished.
     */
    runTestPreparer(extraFlags?: string[]): q.Promise<any>;
    /**
     * Called after each test finishes.
     *
     * Responsible for `restartBrowserBetweenTests`
     *
     * @public
     * @return {q.Promise} A promise that will resolve when the work here is done
     */
    afterEach(): q.Promise<void>;
    /**
     * Grab driver provider based on type
     * @private
     *
     * Priority
     * 1) if directConnect is true, use that
     * 2) if seleniumAddress is given, use that
     * 3) if a Sauce Labs account is given, use that
     * 4) if a seleniumServerJar is specified, use that
     * 5) try to find the seleniumServerJar in protractor/selenium
     */
    loadDriverProvider_(config: Config): void;
    /**
     * Responsible for cleaning up test run and exiting the process.
     * @private
     * @param {int} Standard unix exit code
     */
    exit_: (exitCode: number) => any;
    /**
     * Getter for the Runner config object
     * @public
     * @return {Object} config
     */
    getConfig(): Config;
    /**
     * Get the control flow used by this runner.
     * @return {Object} WebDriver control flow.
     */
    controlFlow(): any;
    /**
     * Sets up convenience globals for test specs
     * @private
     */
    setupGlobals_(browser_: ProtractorBrowser): void;
    /**
     * Create a new driver from a driverProvider. Then set up a
     * new protractor instance using this driver.
     * This is used to set up the initial protractor instances and any
     * future ones.
     *
     * @param {Plugin} plugins The plugin functions
     * @param {ProtractorBrowser=} parentBrowser The browser which spawned this one
     *
     * @return {Protractor} a protractor instance.
     * @public
     */
    createBrowser(plugins: any, parentBrowser?: ProtractorBrowser): any;
    /**
     * Final cleanup on exiting the runner.
     *
     * @return {q.Promise} A promise which resolves on finish.
     * @private
     */
    shutdown_(): q.Promise<void>;
    /**
     * The primary workhorse interface. Kicks off the test running process.
     *
     * @return {q.Promise} A promise which resolves to the exit code of the tests.
     * @public
     */
    run(): q.Promise<any>;
}