@applitools/screenshoter 3.3.15 → 3.3.18

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.15",
3
+ "version": "3.3.18",
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.3.0",
65
65
  "png-async": "0.9.4"
66
66
  },
67
67
  "devDependencies": {
68
- "@applitools/bongo": "^2.0.1",
69
- "@applitools/driver": "1.6.1",
68
+ "@applitools/bongo": "^2.0.3",
69
+ "@applitools/driver": "1.8.2",
70
70
  "@applitools/scripts": "1.1.0",
71
- "@applitools/spec-driver-webdriverio": "1.2.8",
72
- "@applitools/test-utils": "1.3.0",
71
+ "@applitools/spec-driver-webdriverio": "1.2.9",
72
+ "@applitools/test-utils": "1.3.2",
73
73
  "appium": "^1.22.2",
74
74
  "chromedriver": "^95.0.0",
75
75
  "eslint": "^7.9.0",
package/src/getTarget.js CHANGED
@@ -1,29 +1,5 @@
1
- 'use strict'
2
-
3
1
  const utils = require('@applitools/utils')
4
2
 
5
- function isNavigationBar(region) {
6
- if (
7
- (region.value && region.value.includes(`type == "XCUIElementTypeNavigationBar"`)) ||
8
- (region.selector && region.selector.includes(`type == "XCUIElementTypeNavigationBar"`))
9
- ) {
10
- return true
11
- } else {
12
- return false
13
- }
14
- }
15
-
16
- function isTabBar(region) {
17
- if (
18
- (region.value && region.value.includes('type == "XCUIElementTypeTabBar"')) ||
19
- (region.selector && region.selector.includes(`type == "XCUIElementTypeTabBar"`))
20
- ) {
21
- return true
22
- } else {
23
- return false
24
- }
25
- }
26
-
27
3
  async function getTarget({window, context, region, fully, scrollingMode}) {
28
4
  if (window) {
29
5
  // window/app
@@ -63,11 +39,9 @@ async function getTarget({window, context, region, fully, scrollingMode}) {
63
39
  }
64
40
  } else {
65
41
  const scrollingElement = await context.getScrollingElement()
66
- const navBar = isNavigationBar(region)
67
- const tabBar = isTabBar(region)
68
42
  return {
69
43
  context: elementContext,
70
- region: await element.getRegion(navBar || tabBar),
44
+ region: await element.getRegion(),
71
45
  scrollingElement,
72
46
  }
73
47
  }
@@ -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)