UNPKG

flagpole

Version:

Simple and fast DOM integration, headless or headful browser, and REST API testing framework.

68 lines (67 loc) 3.21 kB
/// <reference types="node" /> import { URL } from "url"; import { iSuite, SuiteStatusCallback, SuiteCallback } from "../interfaces/isuite"; import { FlagpoleExecution } from "../flagpole-execution"; import { SuiteTaskManager } from "./suite-task-manager"; import { ScenarioType } from "../scenario-types"; import { ClassConstructor, KeyValue } from "../interfaces/generic-types"; import { iScenario } from "../interfaces/iscenario"; import { ScenarioCallback, ScenarioInitOptions, ScenarioMapper, ScenarioTemplateInitOptions } from "../interfaces/iscenario"; export declare class Suite implements iSuite { get baseUrl(): URL | null; get failCount(): number; get waitingToExecuteCount(): number; get executingCount(): number; get hasPassed(): boolean; get hasFailed(): boolean; get hasExecuted(): boolean; get hasFinished(): boolean; get totalDuration(): number | null; get executionDuration(): number | null; get title(): string; get finished(): Promise<void>; get executionOptions(): FlagpoleExecution; get scenarios(): iScenario[]; protected _title: string; protected _baseUrl: URL | null; protected _waitToExecute: boolean; protected _verifySslCert: boolean; protected _taskManager: SuiteTaskManager; protected _aliasedData: any; constructor(title: string); subscribe(callback: SuiteStatusCallback): this; verifyCert: (verify: boolean) => this; verifySslCert(verify: boolean): this; wait(bool?: boolean): this; setConcurrencyLimit(maxExecutions: number): this; get concurrencyLimit(): number; set concurrencyLimit(maxExecutions: number); setMaxScenarioDuration(timeout: number): this; get maxScenarioDuration(): number; set maxScenarioDuration(timeoutMs: number); setMaxSuiteDuration(timeout: number): this; get maxSuiteDuration(): number; set maxSuiteDuration(timeoutMs: number); print(exitAfterPrint?: boolean): void; scenario<T extends iScenario>(title: string, type: ScenarioType | ClassConstructor<T>, opts?: KeyValue): T; import(originalScenario: iScenario): iScenario; base(url: string): this; base(basePathsByEnvironment: {}): this; base(callback: SuiteCallback): this; execute(): this; beforeAll(callback: SuiteCallback, prepend?: boolean): this; beforeEach(callback: ScenarioCallback, prepend?: boolean): this; afterEach(callback: ScenarioCallback, prepend?: boolean): this; afterAll(callback: SuiteCallback, prepend?: boolean): this; success(callback: SuiteCallback, prepend?: boolean): this; failure(callback: SuiteCallback, prepend?: boolean): this; finally(callback: SuiteCallback, prepend?: boolean): this; promise(): Promise<iSuite>; protected _getArray(key: string): any[]; mapScenarios(key: string, map: ScenarioMapper): Promise<iScenario[]>; mapScenarios(arr: any[], map: ScenarioMapper): Promise<iScenario[]>; push(key: string, value: any): this; set<T = any>(key: string, value: T): this; get<T = any>(key: string): T; template<T extends iScenario>(templateOptions: ScenarioInitOptions<T>): (title: string, scenarioOptions: ScenarioTemplateInitOptions<T>) => T; }