@@ -10,21 +10,18 @@ import { Point } from "./point";
1010import { ImageHelper } from "./image-helper" ;
1111import { ImageOptions } from "./image-options" ;
1212import { LogType } from "./log-types" ;
13+ import { DeviceOrientation } from "./enums/device-orientation" ;
1314export declare class AppiumDriver {
1415 private _driver ;
1516 private _wd ;
1617 private _webio ;
1718 private _driverConfig ;
1819 private _args ;
19- private static pngFileExt ;
20- private static partialUrl ;
2120 private _defaultWaitTime ;
2221 private _elementHelper ;
2322 private _imageHelper ;
2423 private _isAlive ;
2524 private _locators ;
26- private _logPath ;
27- private _storageByDeviceName ;
2825 private _storageByPlatform ;
2926 private constructor ( ) ;
3027 readonly imageHelper : ImageHelper ;
@@ -61,6 +58,7 @@ export declare class AppiumDriver {
6158 click ( args : any ) : Promise < any > ;
6259 navBack ( ) : Promise < any > ;
6360 static createAppiumDriver ( args : INsCapabilities ) : Promise < AppiumDriver > ;
61+ updateSettings ( settings : any ) : Promise < void > ;
6462 /**
6563 *
6664 * @param xPath
@@ -155,27 +153,35 @@ export declare class AppiumDriver {
155153 * @param xOffset
156154 * @param retryCount
157155 */
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 > ;
159157 /**
160- * Swipe from point with offset and inertia according to duatio
158+ * Swipe from point with offset and inertia according to duration
161159 * @param y
162160 * @param x
163161 * @param yOffset
164162 * @param inertia
165163 * @param xOffset
166164 */
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 > ;
168172 /**
169173 * Click a point by providing coordinates
170174 * @param x
171175 * @param y
172176 */
173177 clickPoint ( xCoordinate : number , yCoordinate : number ) : Promise < void > ;
178+ getOrientation ( ) : Promise < DeviceOrientation > ;
179+ setOrientation ( orientation : DeviceOrientation ) : Promise < void > ;
174180 source ( ) : Promise < any > ;
175181 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 > ;
179185 /**
180186 * @param videoName
181187 * @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 {
187193 */
188194 startRecordingVideo ( videoName : any ) : any ;
189195 stopRecordingVideo ( ) : Promise < any > ;
190- private compare ;
191- prepareImageToCompare ( filePath : string , rect : IRectangle ) : Promise < void > ;
192196 takeScreenshot ( fileName : string ) : Promise < string > ;
197+ saveScreenshot ( fileName : string ) : Promise < any > ;
193198 testReporterLog ( log : any ) : any ;
194- logScreenshot ( fileName : string ) : Promise < string > ;
199+ logScreenshot ( fileName : string ) : Promise < any > ;
195200 getlog ( logType : LogType ) : Promise < any > ;
196201 logPageSource ( fileName : string ) : Promise < void > ;
197202 logDeviceLog ( fileName : any , logType : LogType , filter ?: string ) : Promise < void > ;
@@ -202,21 +207,21 @@ export declare class AppiumDriver {
202207 logTestArtifacts ( logName : string ) : Promise < void > ;
203208 /**
204209 * Send the currently active app to the background
205- * @param time in minutes
210+ * @param time in seconds
206211 */
207- backgroundApp ( minutes : number ) : Promise < void > ;
212+ backgroundApp ( seconds : number ) : Promise < void > ;
208213 /**
209214 * Hides device keyboard
210215 */
211216 hideDeviceKeyboard ( ) : Promise < void > ;
212217 isKeyboardShown ( ) : Promise < any > ;
213218 resetApp ( ) : Promise < void > ;
219+ restartApp ( ) : Promise < void > ;
214220 init ( ) : Promise < void > ;
215221 quit ( ) : Promise < void > ;
216222 private static applyAdditionalSettings ;
217223 private convertArrayToUIElements ;
218224 private static configureLogging ;
219- private getExpectedImagePath ;
220225 /**
221226 * Wait specific amount of time before continue execution
222227 * @param milliseconds
@@ -254,4 +259,14 @@ export declare class AppiumDriver {
254259 * @param imageThreshold The degree of match for current search, on the scale between 0 and 1. Default 0.4
255260 */
256261 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 ;
257272}
0 commit comments