appium-webdriveragent 10.4.4 → 10.5.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [10.5.0](https://github.com/appium/WebDriverAgent/compare/v10.4.5...v10.5.0) (2025-12-18)
2
+
3
+ ### Features
4
+
5
+ * Add `enforceCustomSnapshots` setting ([#1087](https://github.com/appium/WebDriverAgent/issues/1087)) ([33d780a](https://github.com/appium/WebDriverAgent/commit/33d780a4b7b47f0587b25983d4e0eb3738975904))
6
+
7
+ ## [10.4.5](https://github.com/appium/WebDriverAgent/compare/v10.4.4...v10.4.5) (2025-12-13)
8
+
9
+ ### Miscellaneous Chores
10
+
11
+ * **deps:** remove source-map-support ([#1084](https://github.com/appium/WebDriverAgent/issues/1084)) ([a803089](https://github.com/appium/WebDriverAgent/commit/a8030894f38eed327c90e10c92ac0fbf0dab8239))
12
+
1
13
  ## [10.4.4](https://github.com/appium/WebDriverAgent/compare/v10.4.3...v10.4.4) (2025-12-13)
2
14
 
3
15
  ### Miscellaneous Chores
package/Scripts/build.sh CHANGED
@@ -21,9 +21,9 @@ function define_xc_macros() {
21
21
  esac
22
22
 
23
23
  case "${DEST:-}" in
24
- "iphone" ) XC_DESTINATION="name=`echo $IPHONE_MODEL | tr -d "'"`,OS=$IOS_VERSION";;
25
- "ipad" ) XC_DESTINATION="name=`echo $IPAD_MODEL | tr -d "'"`,OS=$IOS_VERSION";;
26
- "tv" ) XC_DESTINATION="name=`echo $TV_MODEL | tr -d "'"`,OS=$TV_VERSION";;
24
+ "iphone" ) XC_DESTINATION="platform=iOS Simulator,name=`echo $IPHONE_MODEL | tr -d "'"`,OS=$IOS_VERSION";;
25
+ "ipad" ) XC_DESTINATION="platform=iOS Simulator,name=`echo $IPAD_MODEL | tr -d "'"`,OS=$IOS_VERSION";;
26
+ "tv" ) XC_DESTINATION="platform=tvOS Simulator,name=`echo $TV_MODEL | tr -d "'"`,OS=$TV_VERSION";;
27
27
  "generic" ) XC_DESTINATION="generic/platform=iOS";;
28
28
  "tv_generic" ) XC_DESTINATION="generic/platform=tvOS" XC_MACROS="${XC_MACROS} ARCHS=arm64";; # tvOS only supports arm64
29
29
  esac
@@ -85,13 +85,33 @@ function xcbuild() {
85
85
  }
86
86
 
87
87
  function fastlane_test() {
88
- bundle install
89
-
90
- if [[ -n "$XC_DESTINATION" ]]; then
91
- SDK="$XC_SDK" DEST="$XC_DESTINATION" SCHEME="$1" bundle exec fastlane test
92
- else
93
- SDK="$XC_SDK" SCHEME="$1" bundle exec fastlane test
88
+ # Skip bundle install if already installed (CI already does this)
89
+ if ! bundle check &>/dev/null; then
90
+ bundle install
94
91
  fi
92
+
93
+ case "${DEST:-}" in
94
+ "iphone" )
95
+ FASTLANE_DEVICE="$(echo $IPHONE_MODEL | tr -d "'") ($IOS_VERSION)"
96
+ ;;
97
+ "ipad" )
98
+ FASTLANE_DEVICE="$(echo $IPAD_MODEL | tr -d "'") ($IOS_VERSION)"
99
+ ;;
100
+ "tv" )
101
+ FASTLANE_DEVICE="$(echo $TV_MODEL | tr -d "'") ($TV_VERSION)"
102
+ ;;
103
+ * )
104
+ echo "Error: Unknown DEST value '${DEST:-}'. DEST must be one of: iphone, ipad, tv"
105
+ exit 1
106
+ ;;
107
+ esac
108
+
109
+ echo "Fastlane environment variables:"
110
+ echo " DEVICE=$FASTLANE_DEVICE"
111
+ echo " SCHEME=$1"
112
+ echo " SDK=$XC_SDK"
113
+
114
+ SDK="$XC_SDK" DEVICE="$FASTLANE_DEVICE" SCHEME="$1" bundle exec fastlane test
95
115
  }
96
116
 
97
117
  define_xc_macros
@@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
26
26
  - Memory-friedly
27
27
  - `children` property is set to `nil` if not taken from XCUIApplication
28
28
  - `value` property is cut off to max 512 bytes
29
+ - Sometimes `frame` properties may be off.
29
30
 
30
31
  @return The recent snapshot of the element
31
32
  @throws FBStaleElementException if the element is not present in DOM and thus no snapshot could be made
@@ -55,7 +56,9 @@ NS_ASSUME_NONNULL_BEGIN
55
56
  The maximum snapshot tree depth is set by `FBConfiguration.snapshotMaxDepth`
56
57
 
57
58
  Snapshot specifics:
58
- - Less performant in comparison to the standard one
59
+ - Less performant in comparison to the custom one. Internally, it calls same APIs
60
+ that fb_customSnapshot does, although this one has some additional logic to ensure
61
+ the snapshot is valid. It also may make retries, which slows the call down significantly.
59
62
  - The `hittable` property calculation is aligned with the native calculation logic
60
63
 
61
64
  @return The recent snapshot of the element
@@ -8,6 +8,7 @@
8
8
 
9
9
  #import "XCUIElement+FBWebDriverAttributes.h"
10
10
 
11
+ #import "FBConfiguration.h"
11
12
  #import "FBElementTypeTransformer.h"
12
13
  #import "FBElementHelpers.h"
13
14
  #import "FBLogger.h"
@@ -34,6 +35,10 @@
34
35
  if ([name isEqualToString:FBStringify(XCUIElement, isWDHittable)]) {
35
36
  return [self fb_nativeSnapshot];
36
37
  }
38
+ // https://github.com/appium/WebDriverAgent/issues/1085
39
+ if (FBConfiguration.enforceCustomSnapshots) {
40
+ return [self fb_customSnapshot];
41
+ }
37
42
  // https://github.com/appium/appium-xcuitest-driver/issues/2552
38
43
  BOOL isValueRequest = [name isEqualToString:FBStringify(XCUIElement, wdValue)];
39
44
  if ([self isKindOfClass:XCUIApplication.class] && !isValueRequest) {
@@ -177,7 +182,7 @@
177
182
  characteristics of the element such as Button, Link, Image, etc.
178
183
  You can find the list of possible traits in the Apple documentation:
179
184
  https://developer.apple.com/documentation/uikit/uiaccessibilitytraits?language=objc
180
-
185
+
181
186
  @return A comma-separated string of accessibility traits, or an empty string if no traits are set
182
187
  */
183
188
  - (NSString *)wdTraits
@@ -355,6 +355,7 @@
355
355
  FB_SETTING_INCLUDE_HITTABLE_IN_PAGE_SOURCE: @([FBConfiguration includeHittableInPageSource]),
356
356
  FB_SETTING_INCLUDE_NATIVE_FRAME_IN_PAGE_SOURCE: @([FBConfiguration includeNativeFrameInPageSource]),
357
357
  FB_SETTING_INCLUDE_MIN_MAX_VALUE_IN_PAGE_SOURCE: @([FBConfiguration includeMinMaxValueInPageSource]),
358
+ FB_SETTING_ENFORCE_CUSTOM_SNAPSHOTS: @([FBConfiguration enforceCustomSnapshots]),
358
359
  FB_SETTING_LIMIT_XPATH_CONTEXT_SCOPE: @([FBConfiguration limitXpathContextScope]),
359
360
  #if !TARGET_OS_TV
360
361
  FB_SETTING_SCREENSHOT_ORIENTATION: [FBConfiguration humanReadableScreenshotOrientation],
@@ -466,6 +467,9 @@
466
467
  if (nil != [settings objectForKey:FB_SETTING_INCLUDE_MIN_MAX_VALUE_IN_PAGE_SOURCE]) {
467
468
  [FBConfiguration setIncludeMinMaxValueInPageSource:[[settings objectForKey:FB_SETTING_INCLUDE_MIN_MAX_VALUE_IN_PAGE_SOURCE] boolValue]];
468
469
  }
470
+ if (nil != [settings objectForKey:FB_SETTING_ENFORCE_CUSTOM_SNAPSHOTS]) {
471
+ [FBConfiguration setEnforceCustomSnapshots:[[settings objectForKey:FB_SETTING_ENFORCE_CUSTOM_SNAPSHOTS] boolValue]];
472
+ }
469
473
  if (nil != [settings objectForKey:FB_SETTING_LIMIT_XPATH_CONTEXT_SCOPE]) {
470
474
  [FBConfiguration setLimitXpathContextScope:[[settings objectForKey:FB_SETTING_LIMIT_XPATH_CONTEXT_SCOPE] boolValue]];
471
475
  }
@@ -542,7 +546,7 @@
542
546
  }
543
547
  // CarPlay, Mac, Vision UI or unknown are possible
544
548
  return @"Unknown";
545
-
549
+
546
550
  }
547
551
 
548
552
  + (NSDictionary *)currentCapabilities
@@ -15,11 +15,11 @@
15
15
  <key>CFBundlePackageType</key>
16
16
  <string>FMWK</string>
17
17
  <key>CFBundleShortVersionString</key>
18
- <string>10.4.4</string>
18
+ <string>10.5.0</string>
19
19
  <key>CFBundleSignature</key>
20
20
  <string>????</string>
21
21
  <key>CFBundleVersion</key>
22
- <string>10.4.4</string>
22
+ <string>10.5.0</string>
23
23
  <key>NSPrincipalClass</key>
24
24
  <string/>
25
25
  </dict>
@@ -376,6 +376,17 @@ typedef NS_ENUM(NSInteger, FBConfigurationKeyboardPreference) {
376
376
  + (void)setIncludeMinMaxValueInPageSource:(BOOL)enabled;
377
377
  + (BOOL)includeMinMaxValueInPageSource;
378
378
 
379
+ /**
380
+ * Whether to enforce the use of custom snapshots instead of standard snapshots.
381
+ * When enabled, fb_customSnapshot is always invoked instead of fb_standardSnapshot
382
+ * for XPath tree building and element attributes fetching.
383
+ * Disabled by default.
384
+ *
385
+ * @param enabled Either YES or NO
386
+ */
387
+ + (void)setEnforceCustomSnapshots:(BOOL)enabled;
388
+ + (BOOL)enforceCustomSnapshots;
389
+
379
390
  @end
380
391
 
381
392
  NS_ASSUME_NONNULL_END
@@ -63,6 +63,7 @@ static UIInterfaceOrientation FBScreenshotOrientation;
63
63
  static BOOL FBShouldIncludeHittableInPageSource = NO;
64
64
  static BOOL FBShouldIncludeNativeFrameInPageSource = NO;
65
65
  static BOOL FBShouldIncludeMinMaxValueInPageSource = NO;
66
+ static BOOL FBShouldEnforceCustomSnapshots = NO;
66
67
 
67
68
  @implementation FBConfiguration
68
69
 
@@ -153,7 +154,7 @@ static BOOL FBShouldIncludeMinMaxValueInPageSource = NO;
153
154
  if (self.mjpegServerPortFromArguments != NSNotFound) {
154
155
  return self.mjpegServerPortFromArguments;
155
156
  }
156
-
157
+
157
158
  if (NSProcessInfo.processInfo.environment[@"MJPEG_SERVER_PORT"] &&
158
159
  [NSProcessInfo.processInfo.environment[@"MJPEG_SERVER_PORT"] length] > 0) {
159
160
  return [NSProcessInfo.processInfo.environment[@"MJPEG_SERVER_PORT"] integerValue];
@@ -235,7 +236,7 @@ static BOOL FBShouldIncludeMinMaxValueInPageSource = NO;
235
236
  if (nil == FBMaxTypingFrequency) {
236
237
  return [self defaultTypingFrequency];
237
238
  }
238
- return FBMaxTypingFrequency.integerValue <= 0
239
+ return FBMaxTypingFrequency.integerValue <= 0
239
240
  ? [self defaultTypingFrequency]
240
241
  : FBMaxTypingFrequency.integerValue;
241
242
  }
@@ -686,4 +687,14 @@ static BOOL FBShouldIncludeMinMaxValueInPageSource = NO;
686
687
  return FBShouldIncludeMinMaxValueInPageSource;
687
688
  }
688
689
 
690
+ + (void)setEnforceCustomSnapshots:(BOOL)enabled
691
+ {
692
+ FBShouldEnforceCustomSnapshots = enabled;
693
+ }
694
+
695
+ + (BOOL)enforceCustomSnapshots
696
+ {
697
+ return FBShouldEnforceCustomSnapshots;
698
+ }
699
+
689
700
  @end
@@ -42,5 +42,6 @@ extern NSString* const FB_SETTING_AUTO_CLICK_ALERT_SELECTOR;
42
42
  extern NSString *const FB_SETTING_INCLUDE_HITTABLE_IN_PAGE_SOURCE;
43
43
  extern NSString *const FB_SETTING_INCLUDE_NATIVE_FRAME_IN_PAGE_SOURCE;
44
44
  extern NSString *const FB_SETTING_INCLUDE_MIN_MAX_VALUE_IN_PAGE_SOURCE;
45
+ extern NSString *const FB_SETTING_ENFORCE_CUSTOM_SNAPSHOTS;
45
46
 
46
47
  NS_ASSUME_NONNULL_END
@@ -38,3 +38,4 @@ NSString* const FB_SETTING_AUTO_CLICK_ALERT_SELECTOR = @"autoClickAlertSelector"
38
38
  NSString* const FB_SETTING_INCLUDE_HITTABLE_IN_PAGE_SOURCE = @"includeHittableInPageSource";
39
39
  NSString* const FB_SETTING_INCLUDE_NATIVE_FRAME_IN_PAGE_SOURCE = @"includeNativeFrameInPageSource";
40
40
  NSString* const FB_SETTING_INCLUDE_MIN_MAX_VALUE_IN_PAGE_SOURCE = @"includeMinMaxValueInPageSource";
41
+ NSString* const FB_SETTING_ENFORCE_CUSTOM_SNAPSHOTS = @"enforceCustomSnapshots";
@@ -567,10 +567,12 @@ static NSString *const topNodeIndexPath = @"top";
567
567
  return (id<FBXCElementSnapshot>)root;
568
568
  }
569
569
 
570
+ // https://github.com/appium/appium-xcuitest-driver/pull/2565
570
571
  if (useNative) {
571
572
  return [(XCUIElement *)root fb_nativeSnapshot];
572
573
  }
573
- return [root isKindOfClass:XCUIApplication.class]
574
+ // https://github.com/appium/WebDriverAgent/issues/1085
575
+ return [root isKindOfClass:XCUIApplication.class] && !FBConfiguration.enforceCustomSnapshots
574
576
  ? [(XCUIElement *)root fb_standardSnapshot]
575
577
  : [(XCUIElement *)root fb_customSnapshot];
576
578
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "10.4.4",
3
+ "version": "10.5.0",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -81,7 +81,6 @@
81
81
  "axios": "^1.4.0",
82
82
  "bluebird": "^3.5.5",
83
83
  "lodash": "^4.17.11",
84
- "source-map-support": "^0.x",
85
84
  "teen_process": "^3.0.0"
86
85
  },
87
86
  "files": [