UNPKG

flagpole

Version:

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

81 lines (80 loc) 4.2 kB
/// <reference types="node" /> import { iValue } from "./interfaces/ivalue"; import { HttpRequest } from "./http/http-request"; import { ValuePromise } from "./value-promise"; import { FindAllOptions, FindOptions } from "./interfaces/find-options"; import { PointerMove } from "./interfaces/pointer"; import { GestureOpts, GestureType } from "./interfaces/gesture"; import { KeyValue, OptionalXY } from "./interfaces/generic-types"; import { ScreenProperties } from "./interfaces/screen-properties"; import { iAssertionContext } from "./interfaces/iassertioncontext"; import { iScenario } from "./interfaces/iscenario"; import { iResponse } from "./interfaces/iresponse"; import { iHttpResponse } from "./interfaces/http"; export declare abstract class ProtoResponse implements iResponse { readonly scenario: iScenario; protected _currentUrl: string | null; protected _httpResponse: iHttpResponse; constructor(scenario: iScenario); init(res: iHttpResponse): void; get context(): iAssertionContext; abstract find(selector: string, opts?: FindOptions): ValuePromise; abstract find(selector: string, contains: string, opts?: FindOptions): ValuePromise; abstract find(selector: string, matches: RegExp, opts?: FindOptions): ValuePromise; abstract findAll(selector: string, opts?: FindAllOptions): Promise<iValue<any>[]>; abstract findAll(selector: string, contains: string, opts?: FindAllOptions): Promise<iValue<any>[]>; abstract findAll(selector: string, matches: RegExp, opts?: FindAllOptions): Promise<iValue<any>[]>; eval(callback: any, ...args: any[]): Promise<any>; get httpResponse(): iHttpResponse; get statusCode(): iValue<number>; get statusMessage(): iValue<string>; get body(): iValue<string>; get rawBody(): iValue<any>; get length(): iValue<number>; get headers(): iValue<KeyValue>; get cookies(): iValue<KeyValue>; get trailers(): iValue<KeyValue>; get jsonBody(): iValue<any>; get url(): iValue<string | null>; get finalUrl(): iValue<string | null>; get currentUrl(): iValue<string | null>; get redirectCount(): iValue<number>; get loadTime(): iValue<number | null>; get method(): iValue<string>; navigate(req: HttpRequest): Promise<void>; absolutizeUri(uri: string): string; getRoot(): any; getSource(): ValuePromise; header(key: string): iValue<any>; cookie(key: string): iValue<any>; waitForFunction(..._args: any[]): Promise<void>; waitForNavigation(..._args: any[]): Promise<void>; waitForLoad(..._args: any[]): Promise<void>; waitForReady(..._args: any[]): Promise<void>; waitForNetworkIdle(..._args: any[]): Promise<void>; waitForHidden(..._args: any[]): ValuePromise; waitForVisible(..._args: any[]): ValuePromise; waitForExists(..._args: any[]): ValuePromise; waitForNotExists(..._args: any[]): ValuePromise; waitForHavingText(..._args: any[]): ValuePromise; screenshot(): Promise<Buffer>; type(selector: string, textToType: string, opts?: any): ValuePromise; clear(selector: string): ValuePromise; clearThenType(selector: string, textToType: string, opts?: any): ValuePromise; waitForXPath(xPath: string): ValuePromise; findXPath(xPath: string): ValuePromise; findAllXPath(xPath: string): Promise<iValue<any>[]>; findHavingText(selector: string, searchForText: string | RegExp): ValuePromise; findAllHavingText(selector: string, searchForText: string | RegExp): Promise<iValue<any>[]>; selectOption(selector: string, value: string | string[]): ValuePromise; movePointer(...pointers: PointerMove[]): Promise<iResponse>; gesture(type: GestureType, opts: GestureOpts): Promise<iResponse>; scrollTo(_point: OptionalXY): Promise<iResponse>; click(selector: string, opts?: FindOptions): ValuePromise; click(selector: string, contains: string, opts?: FindOptions): ValuePromise; click(selector: string, matches: RegExp, opts?: FindOptions): ValuePromise; serialize(): object; rotateScreen(rotation: string | number): Promise<string | number>; getScreenProperties(): Promise<ScreenProperties>; hideKeyboard(): Promise<void>; }