UNPKG

flagpole

Version:

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

58 lines (57 loc) 2.87 kB
/// <reference types="node" /> import { iAssertionContext, iScenario, iBounds, iValue, ScreenshotOpts, KeyValue } from "./interfaces"; import { ElementHandle } from "puppeteer-core"; import { DOMElement } from "./domelement"; export declare class PuppeteerElement extends DOMElement implements iValue { protected _input: ElementHandle; get $(): ElementHandle; static create(input: any, context: iAssertionContext, name?: string | null, path?: string): Promise<PuppeteerElement>; protected constructor(input: any, context: iAssertionContext, name?: string | null, path?: string); toString(): string; getClassName(): Promise<iValue>; hasClassName(className: string): Promise<iValue>; find(selector: string): Promise<iValue>; findAll(selector: string): Promise<PuppeteerElement[]>; getClosest(selector?: string): Promise<iValue>; getChildren(selector?: string): Promise<iValue[]>; getParent(): Promise<iValue>; getSiblings(selector?: string): Promise<iValue[]>; getPreviousSibling(selector?: string): Promise<iValue>; getPreviousSiblings(selector?: string): Promise<iValue[]>; getNextSibling(selector?: string): Promise<PuppeteerElement | iValue>; getNextSiblings(selector?: string): Promise<iValue[]>; getInnerText(): Promise<iValue>; getInnerHtml(): Promise<iValue>; getOuterHtml(): Promise<iValue>; getProperty(key: string): Promise<iValue>; getData(key: string): Promise<iValue>; getValue(): Promise<iValue>; getText(): Promise<iValue>; getBounds(boxType?: string): Promise<iBounds | null>; focus(): Promise<any>; hover(): Promise<void>; tap(): Promise<void>; press(key: string, opts?: any): Promise<void>; clearThenType(textToType: string, opts?: any): Promise<void>; type(textToType: string, opts?: any): Promise<void>; clear(): Promise<void>; fillForm(attributeName: string, formData: KeyValue): Promise<iValue>; fillForm(formData: KeyValue): Promise<iValue>; submit(): Promise<void>; submit(message: string): Promise<iScenario>; submit(callback: Function): Promise<iScenario>; submit(scenario: iScenario): Promise<iScenario>; submit(message: string, callback: Function): Promise<iScenario>; click(): Promise<void>; click(message: string): Promise<iScenario>; click(callback: Function): Promise<iScenario>; click(scenario: iScenario): Promise<iScenario>; click(message: string, callback: Function): Promise<iScenario>; screenshot(): Promise<Buffer>; screenshot(localFilePath: string): Promise<Buffer>; screenshot(localFilePath: string, opts: ScreenshotOpts): Promise<Buffer>; screenshot(opts: ScreenshotOpts): Promise<Buffer>; protected _getTagName(): Promise<string>; protected _getSourceCode(): Promise<void>; protected _getAttribute(key: string): Promise<any>; }