-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathappium-driver.d.ts
165 lines (165 loc) · 6.13 KB
/
appium-driver.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
export declare var should: any;
import { ElementHelper } from "./element-helper";
import { SearchOptions } from "./search-options";
import { UIElement } from "./ui-element";
import { Direction } from "./direction";
import { Locator } from "./locators";
import { INsCapabilities } from "./interfaces/ns-capabilities";
import { IRectangle } from "./interfaces/rectangle";
import { Point } from "./point";
import { ImageHelper } from "./image-helper";
export declare class AppiumDriver {
private _driver;
private _wd;
private _webio;
private _driverConfig;
private _args;
private static pngFileExt;
private static partialUrl;
private _defaultWaitTime;
private _elementHelper;
private _imageHelper;
private _isAlive;
private _locators;
private _logPath;
private _storageByDeviceName;
private _storageByPlatform;
private constructor(_driver, _wd, _webio, _driverConfig, _args);
readonly imageHelper: ImageHelper;
defaultWaitTime: number;
readonly capabilities: any;
readonly platformName: any;
readonly platformVersion: any;
readonly elementHelper: ElementHelper;
readonly locators: Locator;
readonly isAlive: boolean;
readonly isAndroid: boolean;
readonly isIOS: boolean;
readonly driver: any;
webio(): any;
wd(): any;
click(args: any): Promise<any>;
navBack(): Promise<any>;
/**
*
* @param xPath
* @param waitForElement
*/
findElementByXPath(xPath: string, waitForElement?: number): Promise<UIElement>;
/**
*
* @param xPath
* @param waitForElement
*/
findElementsByXPath(xPath: string, waitForElement?: number): Promise<UIElement[]>;
/**
* Search for element by given text. The seacrch is case insensitive for android
* @param text
* @param match
* @param waitForElement
*/
findElementByText(text: string, match?: SearchOptions, waitForElement?: number): Promise<UIElement>;
/**
* Search for elements by given text. The seacrch is case insensitive for android
* @param text
* @param match
* @param waitForElement
*/
findElementsByText(text: string, match?: SearchOptions, waitForElement?: number): Promise<UIElement[]>;
/**
* Searches for element by element native class name like button, textView etc which will be translated to android.widgets.Button or XCUIElementTypeButton (iOS 10 and higher) or UIElementButton (iOS 9)
* Notice this is not the same as css class
* @param className
* @param waitForElement
*/
findElementByClassName(className: string, waitForElement?: number): Promise<UIElement>;
/**
* Searches for element by element native class name like button, textView etc which will be translated to android.widgets.Button or XCUIElementTypeButton (iOS 10 and higher) or UIElementButton (iOS 9)
* Notice this is not the same as css class
* @param className
* @param waitForElement
*/
findElementsByClassName(className: string, waitForElement?: number): Promise<UIElement[]>;
/**
* Find element by automationText
* @param id
* @param waitForElement
*/
findElementByAccessibilityId(id: any, waitForElement?: number): Promise<UIElement>;
/**
* Find elements by automationText
* @param id
* @param waitForElement
*/
findElementsByAccessibilityId(id: string, waitForElement?: number): Promise<UIElement[]>;
/**
* Scrolls from point to other point with minimum inertia
* @param direction
* @param y
* @param x
* @param yOffset
* @param xOffset
*/
scroll(direction: Direction, y: number, x: number, yOffset: number, xOffset?: number): Promise<void>;
/**
*
* @param direction
* @param element
* @param startPoint
* @param yOffset
* @param xOffset
* @param retryCount
*/
scrollTo(direction: Direction, element: any, startPoint: Point, yOffset: number, xOffset?: number, retryCount?: number): Promise<any>;
/**
* Swipe from point with offset and inertia according to duatio
* @param y
* @param x
* @param yOffset
* @param inertia
* @param xOffset
*/
swipe(y: number, x: number, yOffset: number, inertia?: number, xOffset?: number): Promise<void>;
/**
* Click a point by providing coordinates
* @param x
* @param y
*/
clickPoint(xCoordinate: number, yCoordinate: number): Promise<void>;
source(): Promise<any>;
sessionId(): Promise<any>;
compareElement(element: UIElement, imageName: string): Promise<boolean>;
compareRectangle(rect: IRectangle, imageName: string, timeOutSeconds?: number, tollerance?: number): Promise<boolean>;
compareScreen(imageName: string, timeOutSeconds?: number, tollerance?: number): Promise<boolean>;
private compare(imageName, timeOutSeconds?, tollerance?, rect?);
prepareImageToCompare(filePath: string, rect: IRectangle): Promise<void>;
takeScreenshot(fileName: string): Promise<string>;
logScreenshot(fileName: string): Promise<string>;
logPageSource(fileName: string): Promise<void>;
static createAppiumDriver(port: number, args: INsCapabilities): Promise<AppiumDriver>;
private static applyAdditionalSettings(args);
resetApp(): Promise<void>;
init(): Promise<void>;
quit(): Promise<void>;
private convertArrayToUIElements(array, searchM, args);
private static configureLogging(driver, verbose);
private getExpectedImagePath(imageName);
/**
* Wait specific amount of time before continue execution
* @param miliseconds
*/
wait(miliseconds: number): Promise<void>;
/**
* Search for element by given xPath but does not throw error if can not find it. Instead returns 'undefined'.
* @param xPath
* @param waitForElement
*/
findElementByXPathIfExists(xPath: string, waitForElement?: number): Promise<any>;
/**
* Search for element by given text but does not throw error if can not find it. Instead returns 'undefined'.
* @param text
* @param match
* @param waitForElement
*/
findElementByTextIfExists(text: string, match?: SearchOptions, waitForElement?: number): Promise<any>;
}