UNPKG

flagpole

Version:

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

56 lines (55 loc) 2.8 kB
/// <reference types="node" /> import { Value } from "./value"; import { iValue, iAssertionContext, iScenario, iMessageAndCallback } from "./interfaces"; import { Link } from "./link"; import { ResponseType } from "./enums"; import { HttpRequestOptions } from "./httprequest"; export declare abstract class DOMElement extends Value { get name(): string; protected constructor(input: any, context: iAssertionContext, name?: string | null, path?: string); abstract find(selector: string): Promise<iValue>; abstract findAll(selector: string): Promise<iValue[]>; protected abstract _getTagName(): Promise<string>; protected abstract _getAttribute(key: string): Promise<string | null>; toString(): string; getClassName(): Promise<iValue>; hasClassName(className: string): Promise<iValue>; getInnerText(): Promise<iValue>; getInnerHtml(): Promise<iValue>; getOuterHtml(): Promise<iValue>; hasAttribute(key: string): Promise<iValue>; getAttribute(key: string): Promise<iValue>; getStyleProperty(key: string): Promise<iValue>; hasProperty(key: string): Promise<iValue>; getProperty(key: string): Promise<iValue>; hasData(key: string): Promise<iValue>; getData(key: string): Promise<iValue>; getValue(): Promise<iValue>; getText(): Promise<iValue>; download(): Promise<Buffer | null>; download(localFilePath: string): Promise<Buffer | null>; download(localFilePath: string, opts: HttpRequestOptions): Promise<Buffer | null>; download(opts: HttpRequestOptions): Promise<Buffer | null>; download(localFilePath: string, opts: HttpRequestOptions): Promise<string | null>; download(opts: HttpRequestOptions): Promise<string | null>; load(): iScenario; load(message: string): iScenario; load(callback: Function): iScenario; load(scenario: iScenario): iScenario; load(message: string, callback: Function): iScenario; protected _isFormTag(): Promise<boolean>; protected _isButtonTag(): Promise<boolean>; protected _isLinkTag(): Promise<boolean>; protected _isImageTag(): Promise<boolean>; protected _isVideoTag(): Promise<boolean>; protected _isAudioTag(): Promise<boolean>; protected _isScriptTag(): Promise<boolean>; protected _isStylesheetTag(): Promise<boolean>; protected _isClickable(): Promise<boolean>; protected _getUrl(): Promise<string | null>; protected _getLambdaScenarioType(): Promise<ResponseType>; protected _getLink(): Promise<Link>; protected _getLambdaScenarioOpts(newScenarioType: ResponseType): any; protected _createSubScenario(overloaded: iMessageAndCallback, defaultResponseType?: ResponseType, defaultOpts?: any): iScenario; protected _loadSubScenario(overloaded: iMessageAndCallback): iScenario; }