1 | import { CancellablePromise } from '@theintern/common';
|
2 | import { Executor } from './executors/Executor';
|
3 | import Deferred from './Deferred';
|
4 | import { InternError } from './types';
|
5 | import { Remote } from './executors/Node';
|
6 | import Suite from './Suite';
|
7 | export default class Test implements TestProperties {
|
8 | name: string;
|
9 | parent: Suite;
|
10 | skipped: string | undefined;
|
11 | test: TestFunction;
|
12 | error: InternError | undefined;
|
13 | suiteError: InternError | undefined;
|
14 | protected _hasPassed: boolean;
|
15 | protected _isAsync: boolean;
|
16 | protected _timeout: number | undefined;
|
17 | protected _runTask: CancellablePromise<any> | undefined;
|
18 | protected _timeElapsed: number | undefined;
|
19 | protected _timer: any | undefined;
|
20 | protected _usesRemote: boolean;
|
21 | constructor(options: TestOptions & {
|
22 | timeElapsed?: number;
|
23 | hasPassed?: boolean;
|
24 | });
|
25 | readonly executor: Executor;
|
26 | readonly hasPassed: boolean;
|
27 | readonly id: string;
|
28 | readonly isAsync: boolean;
|
29 | readonly parentId: string;
|
30 | readonly remote: Remote;
|
31 | readonly sessionId: string;
|
32 | readonly timeElapsed: number | undefined;
|
33 | timeout: number;
|
34 | async(timeout?: number, numCallsUntilResolution?: number): Deferred<any>;
|
35 | restartTimeout(timeout?: number): void;
|
36 | run(): CancellablePromise<void>;
|
37 | skip(message?: string): void;
|
38 | toJSON(): {
|
39 | [key: string]: any;
|
40 | };
|
41 | }
|
42 | export declare function isTest(value: any): value is Test;
|
43 | export declare function isTestOptions(value: any): value is TestOptions;
|
44 | export interface TestFunction {
|
45 | (this: Test, test: Test): void | PromiseLike<any>;
|
46 | }
|
47 | export declare function isTestFunction(value: any): value is TestFunction;
|
48 | export interface TestProperties {
|
49 | hasPassed: boolean;
|
50 | name: string;
|
51 | parent: Suite;
|
52 | skipped: string | undefined;
|
53 | test: TestFunction;
|
54 | timeout: number;
|
55 | }
|
56 | export declare type TestOptions = Partial<TestProperties> & {
|
57 | name: string;
|
58 | test: TestFunction;
|
59 | };
|
60 | export declare const SKIP: any;
|