@applitools/screenshoter 3.3.14 → 3.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/screenshoter",
3
- "version": "3.3.14",
3
+ "version": "3.3.17",
4
4
  "description": "Applitools universal screenshoter for web and native applications",
5
5
  "keywords": [
6
6
  "applitools",
@@ -60,16 +60,16 @@
60
60
  }
61
61
  },
62
62
  "dependencies": {
63
- "@applitools/snippets": "2.2.2",
64
- "@applitools/utils": "1.2.13",
63
+ "@applitools/snippets": "2.2.3",
64
+ "@applitools/utils": "1.2.14",
65
65
  "png-async": "0.9.4"
66
66
  },
67
67
  "devDependencies": {
68
- "@applitools/bongo": "^2.0.0",
69
- "@applitools/driver": "1.5.7",
68
+ "@applitools/bongo": "^2.0.3",
69
+ "@applitools/driver": "1.7.1",
70
70
  "@applitools/scripts": "1.1.0",
71
71
  "@applitools/spec-driver-webdriverio": "1.2.8",
72
- "@applitools/test-utils": "1.3.0",
72
+ "@applitools/test-utils": "1.3.1",
73
73
  "appium": "^1.22.2",
74
74
  "chromedriver": "^95.0.0",
75
75
  "eslint": "^7.9.0",
@@ -65,6 +65,17 @@ async function takeStitchedScreenshot({
65
65
  if (region) region = utils.geometry.intersect(region, contentRegion)
66
66
  else region = contentRegion
67
67
 
68
+ if (targetRegion.x !== region.x && targetRegion.width !== region.width) {
69
+ logger.verbose('Compensating for region width differences...')
70
+ logger.verbose(
71
+ 'region before compensation and the values to be used (a.k.a. expectedRemainingOffset)',
72
+ region,
73
+ expectedRemainingOffset,
74
+ )
75
+ region.x += expectedRemainingOffset.x
76
+ region.width += expectedRemainingOffset.x
77
+ logger.verbose('region after compensation', region)
78
+ }
68
79
  region = utils.geometry.round(region)
69
80
 
70
81
  const [initialRegion, ...partRegions] = utils.geometry.divide(region, image.size, overlap)
@@ -163,7 +163,18 @@ function makeTakeNativeScreenshot({driver, stabilization = {}, debug, logger}) {
163
163
  const viewportSize = await driver.getViewportSize()
164
164
  const cropRegion = withStatusBar
165
165
  ? {x: 0, y: 0, width: viewportSize.width, height: viewportSize.height + driver.statusBarHeight}
166
- : {top: driver.statusBarHeight, bottom: driver.navigationBarHeight, left: 0, right: 0}
166
+ : {
167
+ top: driver.statusBarHeight,
168
+ bottom: driver.orientation === 'landscape' ? 0 : driver.navigationBarHeight,
169
+ left:
170
+ driver.isAndroid && driver.orientation === 'landscape' && driver.platformVersion > 7
171
+ ? driver.navigationBarHeight
172
+ : 0,
173
+ right:
174
+ driver.isAndroid && driver.orientation === 'landscape' && driver.platformVersion < 8
175
+ ? driver.navigationBarHeight
176
+ : 0,
177
+ }
167
178
  image.crop(cropRegion)
168
179
  }
169
180