UNPKG

@progress/kendo-e2e

Version:

Kendo UI end-to-end test utilities.

110 lines (109 loc) 5.11 kB
import { By, ThenableWebDriver, WebElement, WebElementCondition } from "selenium-webdriver"; import { WaitCondition } from "./conditions"; /** * This class encapsulates common location and interaction functionality over a {@link ThenableWebDriver}. */ export declare class WebApp { driver: ThenableWebDriver; constructor(driver: ThenableWebDriver); find(locator: By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<WebElement>; findAll(locator: By | string): Promise<WebElement[]>; findChild(rootElement: WebElement | By | string, locator: By | string, { waitForChild, timeout, pollTimeout }?: { waitForChild?: boolean; timeout?: number; pollTimeout?: number; }): Promise<WebElement>; findChildren(rootElement: WebElement | By | string, locator: By | string, { waitForChild, timeout, pollTimeout }?: { waitForChild?: boolean; timeout?: number; pollTimeout?: number; }): Promise<WebElement[]>; click(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<void>; hover(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<void>; focus(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<void>; contextClick(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<void>; doubleClick(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<void>; waitForAnimationAndClick(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<void>; scrollAndClick(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<void>; scrollIntoView(locator: By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<void>; dragTo(source: WebElement | By, target: WebElement | By): Promise<void>; dragByOffset(element: WebElement | By | string, offsetX: number, offsetY: number): Promise<void>; type(element: WebElement | By | string, text: string, { clear, sendEnter }?: { clear?: boolean; sendEnter?: boolean; }): Promise<void>; sendKey(key: string): Promise<void>; sendKeyCombination(key1: string, key2: string): Promise<void>; sendKeysCombination(keys: string[]): Promise<void>; sendControlKeyCombination(key: string): Promise<void>; isVisible(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<boolean>; isNotVisible(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<boolean>; isInViewport(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<boolean>; isNotInViewport(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<boolean>; hasFocus(element: WebElement | By | string): Promise<boolean>; hasNoFocus(element: WebElement | By | string): Promise<boolean>; hasText(element: WebElement | By | string, text: string): Promise<boolean>; hasValue(element: WebElement | By | string, value: string): Promise<boolean>; hasAttribute(element: WebElement | By | string, attribute: string, value: string, exactMatch?: boolean): Promise<boolean>; hasClass(element: WebElement | By | string, value: string, exactMatch?: boolean): Promise<boolean>; sleep(milliseconds: number): Promise<void>; wait(condition: WebElementCondition | WaitCondition, { timeout, message, pollTimeout }?: { timeout?: number; message?: string; pollTimeout?: number; }): Promise<void>; waitSafely(condition: WebElementCondition | WaitCondition, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<boolean>; waitForAnimation(element: WebElement | By | string, { timeout, pollTimeout }?: { timeout?: number; pollTimeout?: number; }): Promise<void>; getScreenshot(): Promise<string>; executeScript(script: string | Function): Promise<unknown>; getText(element: WebElement | By | string): Promise<string>; getAttribute(element: WebElement | By | string, attribute: string): Promise<string>; getProperty(element: WebElement | By | string, property: string): Promise<string>; getColor(element: WebElement | By | string): Promise<string>; getBackgroundColor(element: WebElement | By | string): Promise<string>; }