/// <reference types="node" />
import Executor from './executors/Executor';
import Deferred from './Deferred';
import Task from '@dojo/core/async/Task';
import { InternError } from './types';
import { Remote } from './executors/Node';
import Suite from './Suite';
export default class Test implements TestProperties {
    /** The name of this test */
    name: string;
    /** This test's parent Suite */
    parent: Suite;
    /** If this test was skipped, this will contain a message indicating why */
    skipped: string | undefined;
    /** The test function that is run by this Test */
    test: TestFunction;
    /** The error that caused this Test to fail */
    error: InternError | undefined;
    protected _hasPassed: boolean;
    protected _isAsync: boolean;
    protected _timeout: number;
    protected _runTask: Task<any> | undefined;
    protected _timeElapsed: number;
    protected _timer: NodeJS.Timer | undefined;
    protected _usesRemote: boolean;
    constructor(options: TestOptions);
    readonly executor: Executor;
    /**
     * True if the test function completed successfully
     */
    readonly hasPassed: boolean;
    /**
     * The unique identifier of the test, assuming all combinations of suite + test are unique.
     */
    readonly id: string;
    /**
     * If true, this Test's test function is async
     */
    readonly isAsync: boolean;
    /**
     * The unique identifier of the test's parent.
     */
    readonly parentId: string;
    /**
     * The WebDriver interface for driving a remote environment.
     * @see Suite#remote
     */
    readonly remote: Remote;
    /**
     * An identifier for the test session this Test is running in.
     */
    readonly sessionId: string;
    /**
     * Return the number of milliseconds required for the test function to complete
     */
    readonly timeElapsed: number;
    timeout: number;
    /**
     * A convenience function that generates and returns a special Deferred that can be used for asynchronous
     * testing.
     * Once called, a test is assumed to be asynchronous no matter its return value (the generated Deferred's
     * promise will always be used as the implied return value if a promise is not returned by the test function).
     *
     * @param timeout If provided, the amount of time to wait before rejecting the test with a timeout error, in milliseconds.
     * @param numCallsUntilResolution The number of times that resolve needs to be called before the Deferred is actually resolved.
     */
    async(timeout?: number, numCallsUntilResolution?: number): Deferred<any>;
    /**
     * During an asynchronous test run, restarts the timeout timer.
     */
    restartTimeout(timeout?: number): void;
    /**
     * Runs the test.
     */
    run(): Task<void>;
    /**
     * Skips this test.
     *
     * @param message If provided, will be stored in this test's `skipped` property.
     */
    skip(message?: string): void;
    toJSON(): {
        [key: string]: any;
    };
}
export declare function isTest(value: any): value is Test;
export declare function isTestOptions(value: any): value is TestOptions;
export interface TestFunction {
    (this: Test, test: Test): void | PromiseLike<any>;
}
export declare function isTestFunction(value: any): value is TestFunction;
export interface TestProperties {
    hasPassed: boolean;
    name: string;
    parent: Suite;
    skipped: string | undefined;
    test: TestFunction;
    timeout: number;
}
export declare type TestOptions = Partial<TestProperties> & {
    name: string;
    test: TestFunction;
};
export declare const SKIP: any;
