File tree 2 files changed +3
-5
lines changed
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -174,9 +174,7 @@ export class DeviceManager implements IDeviceManager {
174
174
apiLevel : platformVersion || args . appiumCaps . platformVersion ,
175
175
config : { "density" : args . appiumCaps . density , "offsetPixels" : args . appiumCaps . offsetPixels }
176
176
}
177
-
178
- delete args . appiumCaps . density ;
179
- delete args . appiumCaps . offsetPixels ;
177
+
180
178
DeviceManager . cleanUnsetProperties ( device ) ;
181
179
182
180
return device ;
Original file line number Diff line number Diff line change @@ -102,9 +102,9 @@ export class ImageHelper {
102
102
ImageHelper . fullClone ( this . _args . device . viewportRect , this . _defaultOptions . cropRectangle )
103
103
}
104
104
if ( ! this . _defaultOptions . cropRectangle
105
- || ! isNumber ( this . _defaultOptions . cropRectangle . y ) ) {
105
+ || ! isNumber ( this . _defaultOptions . cropRectangle . y ) || this . _args . appiumCaps . offsetPixels > 0 ) {
106
106
this . _defaultOptions . cropRectangle = this . _defaultOptions . cropRectangle || { } ;
107
- this . _defaultOptions . cropRectangle . y = this . _args . device . config . offsetPixels || 0 ;
107
+ this . _defaultOptions . cropRectangle . y = this . _args . appiumCaps . offsetPixels || this . _args . device . config . offsetPixels || 0 ;
108
108
this . _defaultOptions . cropRectangle . x = 0 ;
109
109
if ( this . _args . device . deviceScreenSize && this . _args . device . deviceScreenSize . width && this . _args . device . deviceScreenSize . height ) {
110
110
this . _defaultOptions . cropRectangle . height = this . _args . device . deviceScreenSize . height - this . _defaultOptions . cropRectangle . y ;
You can’t perform that action at this time.
0 commit comments