import { HotStaq } from "./HotStaq";
import { HotRouteMethod } from "./HotRouteMethod";
import { HotTestDriver } from "./HotTestDriver";
import { HotTestMap, HotTestPath } from "./HotTestMap";
import { HotTestDestination } from "./HotTestDestination";
import { HotTestPage } from "./HotTestPage";
import { HotDestination } from "./HotDestination";
import { HotTestStop } from "./HotTestStop";
/**
 * Executes tests.
 */
export declare abstract class HotTester {
    /**
     * The tester name.
     */
    name: string;
    /**
     * The timeout for each test.
     */
    timeout: number;
    /**
     * The base url that will construct future urls.
     */
    baseUrl: string;
    /**
     * The associated processor.
     */
    processor: HotStaq;
    /**
     * The test maps to test.
     */
    testMaps: {
        [name: string]: HotTestMap;
    };
    /**
     * The driver to use when running tests.
     */
    driver: HotTestDriver;
    /**
     * Has this tester finished loading?
     */
    finishedLoading: boolean;
    /**
     * Has this tester finished setting up?
     */
    hasBeenSetup: boolean;
    /**
     * Has this tester been destroyed?
     */
    hasBeenDestroyed: boolean;
    /**
     * The current page currently executing.
     */
    currentPage: HotTestPage;
    /**
     * The number of tests that have failed.
     */
    numFailures: number;
    constructor(processor: HotStaq, name: string, baseUrl: string, driver: HotTestDriver, testMaps?: {
        [name: string]: HotTestMap;
    });
    /**
     * Executed when setting up the tester.
     */
    setup(isWebRoute: boolean, url: string, destinationKey?: string): Promise<void>;
    /**
     * Executed when destroying up the tester.
     */
    destroy(): Promise<void>;
    /**
     * Executed when tests are started. If this returns true, it will
     * continue and execute all test paths. If this returns it will
     * skip all test paths and execute onTestEnd instead.
     */
    onTestStart?(destination: HotDestination, url: string, destinationKey?: string): Promise<boolean>;
    /**
     * Executed when an API test path has started. If this returns false,
     * the testPath will not be immediately executed afterwards.
     */
    onTestAPIPathStart?(destination: HotDestination, method: HotRouteMethod, testName: string, continueWhenTestIsComplete?: boolean): Promise<boolean>;
    /**
     * Executed when an API test path has ended.
     */
    onTestAPIPathEnd?(destination: HotDestination, method: HotRouteMethod, testName: string, result: any, continueWhenTestIsComplete?: boolean): Promise<void>;
    /**
     * Executed when page tests are started. If this returns false, the testPath will not be
     * immediately executed afterwards.
     */
    onTestPagePathStart?(destination: HotDestination, stop: HotTestStop, continueWhenTestIsComplete?: boolean): Promise<boolean>;
    /**
     * Executed when a page test has ended.
     */
    onTestPagePathEnd?(destination: HotDestination, testPath: HotTestPath, result: any, continueWhenTestIsComplete?: boolean): Promise<void>;
    /**
     * Executed when a command is executed.
     */
    onCommand?(destination: HotDestination, stop: HotTestStop, cmd: string, args: string[], cmdFunc: ((cmdArgs: string[]) => Promise<void>)): Promise<void>;
    /**
     * Executed when tests are finished.
     */
    onTestEnd?(destination: HotDestination): Promise<void>;
    /**
     * Executed when this tester has been executed from the API.
     */
    onExecute?(): Promise<void>;
    /**
     * Executed when this tester has finished loading all data from the API.
     * If this returns true, the newPage will be added as the tester's current
     * page that is executing. If it returns false, newPage will not be set as the
     * current page.
     */
    onFinishedLoading?(newPage: HotTestPage): Promise<boolean>;
    /**
     * Executed when this tester has finished unloading.
     */
    onFinishedUnloading?(): Promise<void>;
    /**
     * Waits for the API to finish loading all data.
     *
     * `finishedLoading` flips to true when the test page POSTs its test
     * paths to HotTesterAPI. If the browser never gets there — page-side
     * JS error, missing register call, anything — this used to spin
     * forever and the CI job ran all the way to its 15-30 minute
     * wallclock limit. Bound the wait so we get a clear error instead.
     * Override the cap with HOTSTAQ_WAIT_FOR_DATA_TIMEOUT_MS.
     */
    waitForData(): Promise<void>;
    /**
     * Get a destination JSON object to use.
     */
    static interpretDestination(mapName: string, testDest: HotTestDestination): HotDestination;
    /**
     * Execute an API's test path.
     */
    executeTestAPIPath(destination: HotDestination, method: HotRouteMethod, testName: string, skipEventCalls?: boolean, continueWhenTestIsComplete?: boolean): Promise<any>;
    /**
     * Execute all test paths in an API route.
     *
     * @fixme This needs a better implementation...
     */
    executeTestAPIPaths(destination: HotDestination): Promise<any[]>;
    /**
     * Execute a test page path.
     */
    executeTestPagePath(destination: HotDestination, stop: HotTestStop, skipEventCalls?: boolean, continueWhenTestIsComplete?: boolean): Promise<any>;
    /**
     * Execute a command. Example:
     * page:Dashboard -> cmd:click(button)
     */
    executeCommand(destination: HotDestination, stop: HotTestStop, cmd: string): Promise<void>;
    /**
     * Execute all test paths in a page.
     */
    executeTestPagePaths(destination: HotDestination, continueWhenTestIsComplete?: boolean): Promise<any[]>;
    /**
     * Execute the tests.
     */
    execute(mapName: string): Promise<void>;
}
//# sourceMappingURL=HotTester.d.ts.map