UNPKG

3.29 kBTypeScriptView Raw
1import { promise as wdpromise, WebDriver } from 'selenium-webdriver';
2export interface ExtendedWebDriver extends WebDriver {
3 getNetworkConnection: () => wdpromise.Promise<0 | 1 | 2 | 3 | 4 | 5 | 6 | 7>;
4 setNetworkConnection: (typeOrAirplaneMode: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | boolean, wifi?: boolean, data?: boolean) => wdpromise.Promise<void>;
5 toggleAirplaneMode: () => wdpromise.Promise<void>;
6 toggleWiFi: () => wdpromise.Promise<void>;
7 toggleData: () => wdpromise.Promise<void>;
8 toggleLocationServices: () => wdpromise.Promise<void>;
9 getGeolocation: () => wdpromise.Promise<{
10 latitude: number;
11 longitude: number;
12 altitude: number;
13 }>;
14 setGeolocation: (latitude?: number, longitude?: number, altitude?: number) => wdpromise.Promise<void>;
15 getCurrentDeviceActivity: () => wdpromise.Promise<string>;
16 startDeviceActivity: (appPackage: string, appActivity: string, appWaitPackage?: string, appWaitActivity?: string) => wdpromise.Promise<void>;
17 getAppiumSettings: () => wdpromise.Promise<{
18 [name: string]: any;
19 }>;
20 setAppiumSettings: (settings: {
21 [name: string]: any;
22 }) => wdpromise.Promise<void>;
23 getCurrentContext: () => wdpromise.Promise<string>;
24 selectContext: (name: string) => wdpromise.Promise<void>;
25 listContexts: () => wdpromise.Promise<string[]>;
26 getScreenOrientation: () => wdpromise.Promise<'LANDSCAPE' | 'PORTRAIT'>;
27 setScreenOrientation: (orientation: string) => wdpromise.Promise<void>;
28 isDeviceLocked: () => wdpromise.Promise<boolean>;
29 lockDevice: (delay?: number) => wdpromise.Promise<void>;
30 unlockDevice: () => wdpromise.Promise<void>;
31 installApp: (appPath: string) => wdpromise.Promise<void>;
32 isAppInstalled: (bundleId: string) => wdpromise.Promise<boolean>;
33 removeApp: (appId: string) => wdpromise.Promise<void>;
34 pullFileFromDevice: (path: string) => wdpromise.Promise<string>;
35 pullFolderFromDevice: (path: string) => wdpromise.Promise<any>;
36 pushFileToDevice: (path: string, base64Data: string) => wdpromise.Promise<void>;
37 uploadFile: (base64Data: string) => wdpromise.Promise<void>;
38 switchToParentFrame: () => wdpromise.Promise<void>;
39 fullscreen: () => wdpromise.Promise<void>;
40 sendAppToBackground: (delay?: number) => wdpromise.Promise<void>;
41 closeApp: () => wdpromise.Promise<void>;
42 getAppStrings: (language?: string) => wdpromise.Promise<string[]>;
43 launchSession: () => wdpromise.Promise<void>;
44 resetApp: () => wdpromise.Promise<void>;
45 hideSoftKeyboard: (strategy?: 'default' | 'tapOutside' | 'tapOut' | 'swipeDown' | 'pressKey' | 'press', key?: string) => wdpromise.Promise<void>;
46 getDeviceTime: () => wdpromise.Promise<string>;
47 openDeviceNotifications: () => wdpromise.Promise<void>;
48 rotationGesture: (x?: number, y?: number, duration?: number, rotation?: number, touchCount?: 1 | 2 | 3 | 4 | 5) => wdpromise.Promise<void>;
49 shakeDevice: () => wdpromise.Promise<void>;
50 sendChromiumCommand: (cmd: string, params: Object) => wdpromise.Promise<void>;
51 sendChromiumCommandAndGetResult: (cmd: string, params: Object) => wdpromise.Promise<Object>;
52}
53export declare function extend(baseDriver: WebDriver, fallbackGracefully?: boolean): ExtendedWebDriver;