@applitools/screenshoter 3.3.13 → 3.3.14

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/getTarget.js +25 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/screenshoter",
3
- "version": "3.3.13",
3
+ "version": "3.3.14",
4
4
  "description": "Applitools universal screenshoter for web and native applications",
5
5
  "keywords": [
6
6
  "applitools",
@@ -35,7 +35,7 @@
35
35
  "test": "yarn test:it && yarn test:e2e",
36
36
  "test:unit": "mocha ./test/unit/*.spec.js --no-timeouts",
37
37
  "test:it": "mocha ./test/it/*.spec.js --no-timeouts",
38
- "test:e2e": "mocha ./test/e2e/**/*.spec.js --no-timeouts --parallel --jobs ${MOCHA_JOBS:-1}",
38
+ "test:e2e": "yarn test:e2e:web && yarn && test:e2e:android && yarn test:e2e:ios",
39
39
  "test:e2e:web": "APPLITOOLS_SHOW_LOGS=true mocha ./test/e2e/web/*.spec.js --no-timeouts -r @applitools/test-utils/mocha-hooks/docker",
40
40
  "test:e2e:android": "APPLITOOLS_TEST_REMOTE=sauce mocha ./test/e2e/android*/*.spec.js --no-timeouts --parallel --jobs ${MOCHA_JOBS:-2}",
41
41
  "test:e2e:ios": "APPLITOOLS_TEST_REMOTE=sauce mocha ./test/e2e/ios*/*.spec.js --no-timeouts --parallel --jobs ${MOCHA_JOBS:-2}",
@@ -65,11 +65,11 @@
65
65
  "png-async": "0.9.4"
66
66
  },
67
67
  "devDependencies": {
68
- "@applitools/driver": "1.5.5",
68
+ "@applitools/bongo": "^2.0.0",
69
+ "@applitools/driver": "1.5.7",
69
70
  "@applitools/scripts": "1.1.0",
70
- "@applitools/sdk-release-kit": "1.0.4",
71
71
  "@applitools/spec-driver-webdriverio": "1.2.8",
72
- "@applitools/test-utils": "1.1.5",
72
+ "@applitools/test-utils": "1.3.0",
73
73
  "appium": "^1.22.2",
74
74
  "chromedriver": "^95.0.0",
75
75
  "eslint": "^7.9.0",
package/src/getTarget.js CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  const utils = require('@applitools/utils')
4
4
 
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
+
5
27
  async function getTarget({window, context, region, fully, scrollingMode}) {
6
28
  if (window) {
7
29
  // window/app
@@ -41,9 +63,11 @@ async function getTarget({window, context, region, fully, scrollingMode}) {
41
63
  }
42
64
  } else {
43
65
  const scrollingElement = await context.getScrollingElement()
66
+ const navBar = isNavigationBar(region)
67
+ const tabBar = isTabBar(region)
44
68
  return {
45
69
  context: elementContext,
46
- region: await element.getRegion(),
70
+ region: await element.getRegion(navBar || tabBar),
47
71
  scrollingElement,
48
72
  }
49
73
  }