@@ -10,21 +10,18 @@ import { Point } from "./point";
10
10
import { ImageHelper } from "./image-helper" ;
11
11
import { ImageOptions } from "./image-options" ;
12
12
import { LogType } from "./log-types" ;
13
+ import { DeviceOrientation } from "./enums/device-orientation" ;
13
14
export declare class AppiumDriver {
14
15
private _driver ;
15
16
private _wd ;
16
17
private _webio ;
17
18
private _driverConfig ;
18
19
private _args ;
19
- private static pngFileExt ;
20
- private static partialUrl ;
21
20
private _defaultWaitTime ;
22
21
private _elementHelper ;
23
22
private _imageHelper ;
24
23
private _isAlive ;
25
24
private _locators ;
26
- private _logPath ;
27
- private _storageByDeviceName ;
28
25
private _storageByPlatform ;
29
26
private constructor ( ) ;
30
27
readonly imageHelper : ImageHelper ;
@@ -61,6 +58,7 @@ export declare class AppiumDriver {
61
58
click ( args : any ) : Promise < any > ;
62
59
navBack ( ) : Promise < any > ;
63
60
static createAppiumDriver ( args : INsCapabilities ) : Promise < AppiumDriver > ;
61
+ updateSettings ( settings : any ) : Promise < void > ;
64
62
/**
65
63
*
66
64
* @param xPath
@@ -155,27 +153,35 @@ export declare class AppiumDriver {
155
153
* @param xOffset
156
154
* @param retryCount
157
155
*/
158
- scrollTo ( direction : Direction , element : any , startPoint : Point , yOffset : number , xOffset ?: number , retryCount ?: number ) : Promise < UIElement > ;
156
+ scrollTo ( direction : Direction , element : any , startPoint : Point , offsetPoint : Point , retryCount ?: number ) : Promise < UIElement > ;
159
157
/**
160
- * Swipe from point with offset and inertia according to duatio
158
+ * Swipe from point with offset and inertia according to duration
161
159
* @param y
162
160
* @param x
163
161
* @param yOffset
164
162
* @param inertia
165
163
* @param xOffset
166
164
*/
167
- swipe ( y : number , x : number , yOffset : number , inertia ?: number , xOffset ?: number ) : Promise < void > ;
165
+ swipe ( startPoint : {
166
+ x : number ;
167
+ y : number ;
168
+ } , endPoint : {
169
+ x : number ;
170
+ y : number ;
171
+ } , inertia ?: number ) : Promise < void > ;
168
172
/**
169
173
* Click a point by providing coordinates
170
174
* @param x
171
175
* @param y
172
176
*/
173
177
clickPoint ( xCoordinate : number , yCoordinate : number ) : Promise < void > ;
178
+ getOrientation ( ) : Promise < DeviceOrientation > ;
179
+ setOrientation ( orientation : DeviceOrientation ) : Promise < void > ;
174
180
source ( ) : Promise < any > ;
175
181
sessionId ( ) : Promise < any > ;
176
- compareElement ( element : UIElement , imageName : string , tolerance ?: number , timeOutSeconds ?: number , toleranceType ?: ImageOptions ) : Promise < boolean > ;
177
- compareRectangle ( rect : IRectangle , imageName : string , timeOutSeconds ?: number , tolerance ?: number , toleranceType ?: ImageOptions ) : Promise < boolean > ;
178
- compareScreen ( imageName : string , timeOutSeconds ?: number , tolerance ?: number , toleranceType ?: ImageOptions ) : Promise < boolean > ;
182
+ compareElement ( element : UIElement , imageName ? : string , tolerance ?: number , timeOutSeconds ?: number , toleranceType ?: ImageOptions ) : Promise < boolean > ;
183
+ compareRectangle ( rect : IRectangle , imageName ? : string , timeOutSeconds ?: number , tolerance ?: number , toleranceType ?: ImageOptions ) : Promise < boolean > ;
184
+ compareScreen ( imageName ? : string , timeOutSeconds ?: number , tolerance ?: number , toleranceType ?: ImageOptions ) : Promise < boolean > ;
179
185
/**
180
186
* @param videoName
181
187
* @param callback when to stop video recording. In order an element is found. Should return true to exit
@@ -187,11 +193,10 @@ export declare class AppiumDriver {
187
193
*/
188
194
startRecordingVideo ( videoName : any ) : any ;
189
195
stopRecordingVideo ( ) : Promise < any > ;
190
- private compare ;
191
- prepareImageToCompare ( filePath : string , rect : IRectangle ) : Promise < void > ;
192
196
takeScreenshot ( fileName : string ) : Promise < string > ;
197
+ saveScreenshot ( fileName : string ) : Promise < any > ;
193
198
testReporterLog ( log : any ) : any ;
194
- logScreenshot ( fileName : string ) : Promise < string > ;
199
+ logScreenshot ( fileName : string ) : Promise < any > ;
195
200
getlog ( logType : LogType ) : Promise < any > ;
196
201
logPageSource ( fileName : string ) : Promise < void > ;
197
202
logDeviceLog ( fileName : any , logType : LogType , filter ?: string ) : Promise < void > ;
@@ -202,21 +207,21 @@ export declare class AppiumDriver {
202
207
logTestArtifacts ( logName : string ) : Promise < void > ;
203
208
/**
204
209
* Send the currently active app to the background
205
- * @param time in minutes
210
+ * @param time in seconds
206
211
*/
207
- backgroundApp ( minutes : number ) : Promise < void > ;
212
+ backgroundApp ( seconds : number ) : Promise < void > ;
208
213
/**
209
214
* Hides device keyboard
210
215
*/
211
216
hideDeviceKeyboard ( ) : Promise < void > ;
212
217
isKeyboardShown ( ) : Promise < any > ;
213
218
resetApp ( ) : Promise < void > ;
219
+ restartApp ( ) : Promise < void > ;
214
220
init ( ) : Promise < void > ;
215
221
quit ( ) : Promise < void > ;
216
222
private static applyAdditionalSettings ;
217
223
private convertArrayToUIElements ;
218
224
private static configureLogging ;
219
- private getExpectedImagePath ;
220
225
/**
221
226
* Wait specific amount of time before continue execution
222
227
* @param milliseconds
@@ -254,4 +259,14 @@ export declare class AppiumDriver {
254
259
* @param imageThreshold The degree of match for current search, on the scale between 0 and 1. Default 0.4
255
260
*/
256
261
findElementByImage ( image : string , imageThreshold ?: number ) : Promise < UIElement > ;
262
+ /**
263
+ * Get screen actual view port
264
+ * Useful for image comparison
265
+ */
266
+ getScreenActualViewPort ( ) : IRectangle ;
267
+ /**
268
+ * Get screen view port
269
+ * This is convenient to use for some gestures on the screen
270
+ */
271
+ getScreenViewPort ( ) : IRectangle ;
257
272
}
0 commit comments