@@ -29,8 +29,8 @@ export interface IImageCompareOptions {
29
29
toleranceType ?: ImageOptions ;
30
30
31
31
/**
32
- * Wait miliseconds before capture creating image
33
- * Default value is 2000
32
+ * Wait milliseconds before capture creating image
33
+ * Default value is 5000
34
34
*/
35
35
waitBeforeCreatingInitialImageCapture ?: number ;
36
36
@@ -53,23 +53,23 @@ export interface IImageCompareOptions {
53
53
54
54
/**
55
55
* Default value is set to true which means that nativescript-dev-appium will save the image
56
- * in original size and compare only the part which cropRectangle specifies.
56
+ * in original size and compare only the part which cropRectangle specifies.
57
57
* If false, the image size will be reduced and saved by the dimensions of cropRectangle.
58
58
*/
59
59
keepOriginalImageSize ?: boolean ;
60
60
61
61
62
62
/**
63
63
* Default value is set to false. nativescript-dev-appium will recalculate view port for iOS
64
- * so that the top/y will start from the end of status bar
64
+ * so that the top/y will start from the end of the status bar
65
65
* So far appium calculates it even more and some part of safe areas are missed
66
66
*/
67
67
keepAppiumViewportRect ?: boolean ;
68
68
69
69
/**
70
- * Defines if an image is device specific or only by platform.
71
- * Default value is true and the image will be saved in device specific directory.
72
- * If value is set to false, image will be saved under ios or android folder.
70
+ * Defines if an image is device- specific or only by the platform.
71
+ * Default value is true and the image will be saved in device- specific directory.
72
+ * If the value is set to false, the image will be saved under ios or android folder.
73
73
*/
74
74
isDeviceSpecific ?: boolean ;
75
75
@@ -98,7 +98,9 @@ export class ImageHelper {
98
98
} ;
99
99
100
100
constructor ( private _args : INsCapabilities , private _driver : AppiumDriver ) {
101
- this . _defaultOptions . cropRectangle = ( this . _args . appiumCaps && this . _args . appiumCaps . viewportRect ) || this . _args . device . viewportRect ;
101
+ if ( this . _args . device . viewportRect ) {
102
+ ImageHelper . fullClone ( this . _args . device . viewportRect , this . _defaultOptions . cropRectangle )
103
+ }
102
104
if ( ! this . _defaultOptions . cropRectangle
103
105
|| ! isNumber ( this . _defaultOptions . cropRectangle . y ) ) {
104
106
this . _defaultOptions . cropRectangle = this . _defaultOptions . cropRectangle || { } ;
0 commit comments