@applitools/screenshoter 3.4.1 → 3.4.4

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.4.1",
3
+ "version": "3.4.4",
4
4
  "description": "Applitools universal screenshoter for web and native applications",
5
5
  "keywords": [
6
6
  "applitools",
@@ -25,6 +25,9 @@
25
25
  "name": "Applitools Team",
26
26
  "email": "team@applitools.com"
27
27
  },
28
+ "aliases": [
29
+ "screenshoter"
30
+ ],
28
31
  "exports": {
29
32
  ".": {
30
33
  "default": "./index.js"
@@ -67,18 +70,18 @@
67
70
  }
68
71
  },
69
72
  "dependencies": {
70
- "@applitools/logger": "1.1.10",
71
- "@applitools/snippets": "2.2.3",
72
- "@applitools/utils": "1.3.6",
73
- "jpeg-js": "0.4.3",
73
+ "@applitools/logger": "1.1.13",
74
+ "@applitools/snippets": "2.4.3",
75
+ "@applitools/utils": "1.3.9",
76
+ "jpeg-js": "0.4.4",
74
77
  "png-async": "0.9.4"
75
78
  },
76
79
  "devDependencies": {
77
- "@applitools/bongo": "^2.1.4",
78
- "@applitools/driver": "^1.9.2",
80
+ "@applitools/bongo": "^2.1.5",
81
+ "@applitools/driver": "^1.9.6",
79
82
  "@applitools/scripts": "1.1.0",
80
- "@applitools/spec-driver-webdriverio": "1.2.10",
81
- "@applitools/test-utils": "1.3.2",
83
+ "@applitools/spec-driver-webdriverio": "1.2.13",
84
+ "@applitools/test-utils": "1.3.3",
82
85
  "appium": "^1.22.3",
83
86
  "chromedriver": "^101.0.0",
84
87
  "eslint": "^8.16.0",
@@ -53,7 +53,7 @@ async function takeStitchedScreenshot({
53
53
  : scrollerRegion
54
54
  logger.log('Target region calculated: ', targetRegion)
55
55
 
56
- const cropRegion = await driver.getRegionInViewport(context, targetRegion)
56
+ const cropRegion = utils.geometry.round(await driver.getRegionInViewport(context, targetRegion))
57
57
  logger.log('Crop region calculated: ', cropRegion)
58
58
  if (utils.geometry.isEmpty(cropRegion)) throw new Error('Screenshot region is out of viewport')
59
59
 
@@ -77,7 +77,7 @@ async function takeStitchedScreenshot({
77
77
  region.width += expectedRemainingOffset.x
78
78
  logger.verbose('region after compensation', region)
79
79
  }
80
- region = utils.geometry.round(region)
80
+ region = utils.geometry.floor(region)
81
81
 
82
82
  const [initialRegion, ...partRegions] = utils.geometry.divide(region, image.size, overlap)
83
83
  logger.verbose('Part regions', partRegions)
@@ -96,7 +96,11 @@ async function takeStitchedScreenshot({
96
96
  const partName = `${partRegion.x}_${partRegion.y}_${partRegion.width}x${partRegion.height}`
97
97
  logger.verbose(`Processing part ${partName}`)
98
98
 
99
- const compensateOffset = {x: 0, y: initialRegion.y !== partRegion.y ? overlap.top : 0}
99
+ // compensate scroller region being shifted and top overlap
100
+ const compensateOffset = {
101
+ x: scrollerRegionShift.x + 0,
102
+ y: scrollerRegionShift.y + (initialRegion.y !== partRegion.y ? overlap.top : 0),
103
+ }
100
104
  const requiredOffset = utils.geometry.offsetNegative(utils.geometry.location(partRegion), compensateOffset)
101
105
 
102
106
  logger.verbose('Move to', requiredOffset)