@@ -29,8 +29,8 @@ export interface IImageCompareOptions {
2929 toleranceType ?: ImageOptions ;
3030
3131 /**
32- * Wait miliseconds before capture creating image
33- * Default value is 2000
32+ * Wait milliseconds before capture creating image
33+ * Default value is 5000
3434 */
3535 waitBeforeCreatingInitialImageCapture ?: number ;
3636
@@ -53,23 +53,23 @@ export interface IImageCompareOptions {
5353
5454 /**
5555 * 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.
5757 * If false, the image size will be reduced and saved by the dimensions of cropRectangle.
5858 */
5959 keepOriginalImageSize ?: boolean ;
6060
6161
6262 /**
6363 * 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
6565 * So far appium calculates it even more and some part of safe areas are missed
6666 */
6767 keepAppiumViewportRect ?: boolean ;
6868
6969 /**
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.
7373 */
7474 isDeviceSpecific ?: boolean ;
7575
@@ -98,7 +98,9 @@ export class ImageHelper {
9898 } ;
9999
100100 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+ }
102104 if ( ! this . _defaultOptions . cropRectangle
103105 || ! isNumber ( this . _defaultOptions . cropRectangle . y ) ) {
104106 this . _defaultOptions . cropRectangle = this . _defaultOptions . cropRectangle || { } ;
0 commit comments