UNPKG

flagpole

Version:

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

54 lines (53 loc) 2.64 kB
import { ProtoValue, Value } from './value'; import { iValue, iAssertionContext, iScenario, iDOMElement, iMessageAndCallback } from './interfaces'; import { Link } from './link'; import { ResponseType } from './enums'; export declare abstract class DOMElement extends ProtoValue implements iValue, iDOMElement { protected _path: string; protected _tagName: string; readonly path: string; readonly name: string; readonly tagName: string; protected constructor(input: any, context: iAssertionContext, name?: string | null, path?: string); abstract click(a?: string | Function, b?: Function): Promise<iScenario | void>; abstract fillForm(formData: any): Promise<void>; abstract submit(a?: string | Function, b?: Function): Promise<iScenario | void>; abstract find(selector: string): Promise<iValue | null>; abstract findAll(selector: string): Promise<iValue[]>; protected abstract _getTagName(): Promise<string>; protected abstract _getAttribute(key: string): Promise<string | null>; toString(): string; getClassName(): Promise<Value>; hasClassName(className: string): Promise<Value>; getTagName(): Promise<Value>; getInnerText(): Promise<Value>; getInnerHtml(): Promise<Value>; getOuterHtml(): Promise<Value>; hasAttribute(key: string): Promise<Value>; getAttribute(key: string): Promise<Value>; hasProperty(key: string): Promise<Value>; getProperty(key: string): Promise<Value>; hasData(key: string): Promise<Value>; getData(key: string): Promise<Value>; getValue(): Promise<Value>; getText(): Promise<Value>; load(): iScenario; load(callback: Function): 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 _getMessageAndCallbackFromOverloading(a: any, b: any): iMessageAndCallback; protected _getLambdaScenarioOpts(newScenarioType: ResponseType): any; protected _completedAction(verb: string, noun?: string): Promise<void>; protected _failedAction(verb: string, noun?: string): Promise<void>; }