/// import Element from './Element'; import Server from './Server'; import { CancellablePromise } from '@theintern/common'; import Locator, { Strategy } from './lib/Locator'; import { Capabilities, Geolocation, LogEntry, WebDriverCookie } from './interfaces'; export default class Session extends Locator, CancellablePromise, CancellablePromise> { private _sessionId; private _server; private _capabilities; private _closedWindows; private _timeouts; private _movedToElement; private _lastMousePosition; private _lastAltitude; private _nextRequest; constructor(sessionId: string, server: Server, capabilities: Capabilities); get capabilities(): Capabilities; get sessionId(): string; get server(): Server; private _delegateToServer; serverGet(path: string, requestData?: any, pathParts?: string[]): CancellablePromise; serverPost(path: string, requestData?: any, pathParts?: string[]): CancellablePromise; serverDelete(path: string, requestData?: any, pathParts?: string[]): CancellablePromise; getTimeout(type: Timeout): CancellablePromise; setTimeout(type: Timeout, ms: number): CancellablePromise; getCurrentWindowHandle(): CancellablePromise; getAllWindowHandles(): CancellablePromise; getCurrentUrl(): CancellablePromise; get(url: string): CancellablePromise; goForward(): CancellablePromise; goBack(): CancellablePromise; refresh(): CancellablePromise; execute(script: Function | string, args?: any[]): CancellablePromise; executeAsync(script: Function | string, args?: any[]): CancellablePromise; takeScreenshot(): CancellablePromise; getAvailableImeEngines(): CancellablePromise; getActiveImeEngine(): CancellablePromise; isImeActivated(): CancellablePromise; deactivateIme(): CancellablePromise; activateIme(engine: string): CancellablePromise; switchToFrame(id: string | number | Element | null): CancellablePromise; switchToWindow(handle: string): CancellablePromise; switchToParentFrame(): CancellablePromise; closeCurrentWindow(): CancellablePromise; setWindowSize(width: number, height: number): CancellablePromise; setWindowSize(windowHandle: string, width: number, height: number): CancellablePromise; getWindowSize(windowHandle?: string): CancellablePromise<{ width: number; height: number; }>; getWindowRect(): CancellablePromise<{ width: number; height: number; x: number; y: number; }>; setWindowRect(rect: { x: number; y: number; width: number; height: number; }): CancellablePromise; setWindowPosition(x: number, y: number): CancellablePromise; setWindowPosition(windowHandle: string, x: number, y: number): CancellablePromise; getWindowPosition(windowHandle?: string): CancellablePromise<{ x: number; y: number; }>; maximizeWindow(windowHandle?: string): CancellablePromise; getCookies(): CancellablePromise; setCookie(cookie: WebDriverCookie): CancellablePromise; clearCookies(): CancellablePromise; deleteCookie(name: string): CancellablePromise; getPageSource(): CancellablePromise; getPageTitle(): CancellablePromise; find(using: Strategy, value: string): CancellablePromise; findAll(using: Strategy, value: string): CancellablePromise; getActiveElement(): CancellablePromise; pressKeys(keys: string | string[]): CancellablePromise; getOrientation(): CancellablePromise; setOrientation(orientation: string): CancellablePromise; getAlertText(): CancellablePromise; typeInPrompt(text: string | string[]): CancellablePromise; acceptAlert(): CancellablePromise; dismissAlert(): CancellablePromise; moveMouseTo(): CancellablePromise; moveMouseTo(xOffset?: number, yOffset?: number): CancellablePromise; moveMouseTo(element?: Element, xOffset?: number, yOffset?: number): CancellablePromise; clickMouseButton(button?: number): CancellablePromise; pressMouseButton(button?: number): CancellablePromise; releaseMouseButton(button?: number): CancellablePromise; doubleClick(): CancellablePromise; tap(element: Element): CancellablePromise; pressFinger(x: number, y: number): CancellablePromise; releaseFinger(x: number, y: number): CancellablePromise; moveFinger(x: number, y: number): CancellablePromise; touchScroll(xOffset: number, yOffset: number): CancellablePromise; touchScroll(element?: Element, xOffset?: number, yOffset?: number): CancellablePromise; doubleTap(element?: Element): CancellablePromise; longTap(element?: Element): CancellablePromise; flickFinger(element: Element, xOffset: number, yOffset: number, speed?: number): CancellablePromise; flickFinger(xOffset: number, yOffset: number, speed?: number): CancellablePromise; getGeolocation(): CancellablePromise; setGeolocation(location: Geolocation): CancellablePromise; getLogsFor(type: string): CancellablePromise; getAvailableLogTypes(): CancellablePromise; getApplicationCacheStatus(): CancellablePromise; quit(): CancellablePromise; getLocalStorageKeys(): CancellablePromise; setLocalStorageItem(key: string, value: string): CancellablePromise; clearLocalStorage(): CancellablePromise; getLocalStorageItem(key: string): CancellablePromise; deleteLocalStorageItem(key: string): CancellablePromise; getLocalStorageLength(): CancellablePromise; getSessionStorageKeys(): CancellablePromise; setSessionStorageItem(key: string, value: string): CancellablePromise; clearSessionStorage(): CancellablePromise; getSessionStorageItem(key: string): CancellablePromise; deleteSessionStorageItem(key: string): CancellablePromise; getSessionStorageLength(): CancellablePromise; findDisplayed(using: Strategy, value: string): CancellablePromise; waitForDeleted(using: Strategy, value: string): CancellablePromise; getExecuteAsyncTimeout(): CancellablePromise; setExecuteAsyncTimeout(ms: number): CancellablePromise; getFindTimeout(): CancellablePromise; setFindTimeout(ms: number): CancellablePromise; getPageLoadTimeout(): CancellablePromise; setPageLoadTimeout(ms: number): CancellablePromise; } export interface WebDriverTimeouts { script: number; pageLoad: number; implicit: number; } declare type Timeout = 'script' | 'implicit' | 'page load'; export {};