appium-webdriveragent 9.6.2 → 9.7.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
+ ## [9.7.0](https://github.com/appium/WebDriverAgent/compare/v9.6.3...v9.7.0) (2025-05-20)
2
+
3
+ ### Features
4
+
5
+ * add placeholderValue to page source tree ([#1016](https://github.com/appium/WebDriverAgent/issues/1016)) ([509c207](https://github.com/appium/WebDriverAgent/commit/509c207b1366dd8582ba273edcdf77bfb30f53c9))
6
+
7
+ ## [9.6.3](https://github.com/appium/WebDriverAgent/compare/v9.6.2...v9.6.3) (2025-05-18)
8
+
9
+ ### Miscellaneous Chores
10
+
11
+ * Move the FBDoesElementSupportInnerText helper to a separate utility file ([#1018](https://github.com/appium/WebDriverAgent/issues/1018)) ([f17b07d](https://github.com/appium/WebDriverAgent/commit/f17b07d03abb6c2100405fda04326b7c35bfb48b))
12
+
1
13
  ## [9.6.2](https://github.com/appium/WebDriverAgent/compare/v9.6.1...v9.6.2) (2025-05-01)
2
14
 
3
15
  ### Bug Fixes
@@ -374,6 +374,10 @@
374
374
  7155D704211DCEF400166C20 /* FBMjpegServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7155D702211DCEF400166C20 /* FBMjpegServer.m */; };
375
375
  7157B291221DADD2001C348C /* FBXCAXClientProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 7157B28F221DADD2001C348C /* FBXCAXClientProxy.h */; };
376
376
  7157B292221DADD2001C348C /* FBXCAXClientProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7157B290221DADD2001C348C /* FBXCAXClientProxy.m */; };
377
+ 715A84CF2DD92AD3007134CC /* FBElementHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 715A84CE2DD92AD3007134CC /* FBElementHelpers.m */; };
378
+ 715A84D02DD92AD3007134CC /* FBElementHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 715A84CD2DD92AD3007134CC /* FBElementHelpers.h */; };
379
+ 715A84D12DD92AD3007134CC /* FBElementHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 715A84CE2DD92AD3007134CC /* FBElementHelpers.m */; };
380
+ 715A84D22DD92AD3007134CC /* FBElementHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 715A84CD2DD92AD3007134CC /* FBElementHelpers.h */; };
377
381
  715AFAC11FFA29180053896D /* FBScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 715AFABF1FFA29180053896D /* FBScreen.h */; };
378
382
  715AFAC21FFA29180053896D /* FBScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 715AFAC01FFA29180053896D /* FBScreen.m */; };
379
383
  715AFAC41FFA2AAF0053896D /* FBScreenTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 715AFAC31FFA2AAF0053896D /* FBScreenTests.m */; };
@@ -1006,6 +1010,8 @@
1006
1010
  7155D702211DCEF400166C20 /* FBMjpegServer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBMjpegServer.m; sourceTree = "<group>"; };
1007
1011
  7157B28F221DADD2001C348C /* FBXCAXClientProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBXCAXClientProxy.h; sourceTree = "<group>"; };
1008
1012
  7157B290221DADD2001C348C /* FBXCAXClientProxy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBXCAXClientProxy.m; sourceTree = "<group>"; };
1013
+ 715A84CD2DD92AD3007134CC /* FBElementHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBElementHelpers.h; sourceTree = "<group>"; };
1014
+ 715A84CE2DD92AD3007134CC /* FBElementHelpers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBElementHelpers.m; sourceTree = "<group>"; };
1009
1015
  715AFABF1FFA29180053896D /* FBScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBScreen.h; sourceTree = "<group>"; };
1010
1016
  715AFAC01FFA29180053896D /* FBScreen.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBScreen.m; sourceTree = "<group>"; };
1011
1017
  715AFAC31FFA2AAF0053896D /* FBScreenTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBScreenTests.m; sourceTree = "<group>"; };
@@ -1912,6 +1918,8 @@
1912
1918
  EE9B76A21CF7A43900275851 /* FBConfiguration.m */,
1913
1919
  EE7E27181D06C69F001BEC7B /* FBDebugLogDelegateDecorator.h */,
1914
1920
  EE7E27191D06C69F001BEC7B /* FBDebugLogDelegateDecorator.m */,
1921
+ 715A84CD2DD92AD3007134CC /* FBElementHelpers.h */,
1922
+ 715A84CE2DD92AD3007134CC /* FBElementHelpers.m */,
1915
1923
  EE9AB78F1CAEDF0C008C271F /* FBElementTypeTransformer.h */,
1916
1924
  EE9AB7901CAEDF0C008C271F /* FBElementTypeTransformer.m */,
1917
1925
  EE3A18601CDE618F00DE4205 /* FBErrorBuilder.h */,
@@ -2354,6 +2362,7 @@
2354
2362
  641EE6732240C5CA00173FCB /* FBDebugCommands.h in Headers */,
2355
2363
  641EE6742240C5CA00173FCB /* XCTestSuite.h in Headers */,
2356
2364
  641EE6752240C5CA00173FCB /* XCUICoordinate.h in Headers */,
2365
+ 715A84D22DD92AD3007134CC /* FBElementHelpers.h in Headers */,
2357
2366
  641EE6762240C5CA00173FCB /* XCTNSPredicateExpectation.h in Headers */,
2358
2367
  641EE6772240C5CA00173FCB /* XCTestObservationCenter.h in Headers */,
2359
2368
  641EE6782240C5CA00173FCB /* XCTNSNotificationExpectation.h in Headers */,
@@ -2605,6 +2614,7 @@
2605
2614
  EE35AD781E3B77D600A02D78 /* XCUIRecorderUtilities.h in Headers */,
2606
2615
  EE35AD421E3B77D600A02D78 /* XCTestCaseRun.h in Headers */,
2607
2616
  EE35AD441E3B77D600A02D78 /* XCTestConfiguration.h in Headers */,
2617
+ 715A84D02DD92AD3007134CC /* FBElementHelpers.h in Headers */,
2608
2618
  EE35AD0B1E3B77D600A02D78 /* _XCTDarwinNotificationExpectationImplementation.h in Headers */,
2609
2619
  718226CA2587443700661B83 /* GCDAsyncUdpSocket.h in Headers */,
2610
2620
  EE35AD491E3B77D600A02D78 /* XCTestExpectation.h in Headers */,
@@ -3171,6 +3181,7 @@
3171
3181
  641EE60F2240C5CA00173FCB /* XCUIElement+FBAccessibility.m in Sources */,
3172
3182
  641EE6102240C5CA00173FCB /* FBImageUtils.m in Sources */,
3173
3183
  71AE3CF82D38EE8E0039FC36 /* XCUIElement+FBVisibleFrame.m in Sources */,
3184
+ 715A84D12DD92AD3007134CC /* FBElementHelpers.m in Sources */,
3174
3185
  641EE6112240C5CA00173FCB /* FBSession.m in Sources */,
3175
3186
  641EE6122240C5CA00173FCB /* FBFindElementCommands.m in Sources */,
3176
3187
  71A5C67629A4F39600421C37 /* XCTIssue+FBPatcher.m in Sources */,
@@ -3314,6 +3325,7 @@
3314
3325
  EE158AB31CBD456F00A3E3F0 /* XCUIElement+FBScrolling.m in Sources */,
3315
3326
  718226CE2587443700661B83 /* GCDAsyncSocket.m in Sources */,
3316
3327
  EE158AC91CBD456F00A3E3F0 /* FBSessionCommands.m in Sources */,
3328
+ 715A84CF2DD92AD3007134CC /* FBElementHelpers.m in Sources */,
3317
3329
  EE9B76A71CF7A43900275851 /* FBConfiguration.m in Sources */,
3318
3330
  E444DC9C249131D40060D7EB /* HTTPServer.m in Sources */,
3319
3331
  71414ED82670A1EE003A8C5D /* LRUCache.m in Sources */,
@@ -37,6 +37,7 @@
37
37
  #import "XCUIElement+FBUtilities.h"
38
38
  #import "XCUIElement+FBWebDriverAttributes.h"
39
39
  #import "XCUIElementQuery.h"
40
+ #import "FBElementHelpers.h"
40
41
 
41
42
  static NSString* const FBUnknownBundleId = @"unknown";
42
43
 
@@ -45,6 +46,7 @@ static NSString* const FBExclusionAttributeEnabled = @"enabled";
45
46
  static NSString* const FBExclusionAttributeVisible = @"visible";
46
47
  static NSString* const FBExclusionAttributeAccessible = @"accessible";
47
48
  static NSString* const FBExclusionAttributeFocused = @"focused";
49
+ static NSString* const FBExclusionAttributePlaceholderValue = @"placeholderValue";
48
50
 
49
51
 
50
52
  _Nullable id extractIssueProperty(id issue, NSString *propertyName) {
@@ -201,28 +203,15 @@ NSDictionary<NSString *, NSString *> *customExclusionAttributesMap(void) {
201
203
  info[@"label"] = FBValueOrNull(wrappedSnapshot.wdLabel);
202
204
  info[@"rect"] = wrappedSnapshot.wdRect;
203
205
 
204
- NSDictionary<NSString *, NSString * (^)(void)> *attributeBlocks = @{
205
- FBExclusionAttributeFrame: ^{
206
- return NSStringFromCGRect(wrappedSnapshot.wdFrame);
207
- },
208
- FBExclusionAttributeEnabled: ^{
209
- return [@([wrappedSnapshot isWDEnabled]) stringValue];
210
- },
211
- FBExclusionAttributeVisible: ^{
212
- return [@([wrappedSnapshot isWDVisible]) stringValue];
213
- },
214
- FBExclusionAttributeAccessible: ^{
215
- return [@([wrappedSnapshot isWDAccessible]) stringValue];
216
- },
217
- FBExclusionAttributeFocused: ^{
218
- return [@([wrappedSnapshot isWDFocused]) stringValue];
219
- }
220
- };
206
+ NSDictionary<NSString *, NSString *(^)(void)> *attributeBlocks = [self fb_attributeBlockMapForWrappedSnapshot:wrappedSnapshot];
207
+
208
+ NSSet *nonPrefixedKeys = [NSSet setWithObjects:FBExclusionAttributeFrame,
209
+ FBExclusionAttributePlaceholderValue, nil];
221
210
 
222
211
  for (NSString *key in attributeBlocks) {
223
212
  if (excludedAttributes == nil || ![excludedAttributes containsObject:key]) {
224
213
  NSString *value = ((NSString * (^)(void))attributeBlocks[key])();
225
- if ([key isEqualToString:FBExclusionAttributeFrame]) {
214
+ if ([nonPrefixedKeys containsObject:key]) {
226
215
  info[key] = value;
227
216
  } else {
228
217
  info[[NSString stringWithFormat:@"is%@", [key capitalizedString]]] = value;
@@ -248,6 +237,43 @@ NSDictionary<NSString *, NSString *> *customExclusionAttributesMap(void) {
248
237
  return info;
249
238
  }
250
239
 
240
+ // Helper used by `dictionaryForElement:` to assemble attribute value blocks,
241
+ // including both common attributes and conditionally included ones like placeholderValue.
242
+ + (NSDictionary<NSString *, NSString *(^)(void)> *)fb_attributeBlockMapForWrappedSnapshot:(FBXCElementSnapshotWrapper *)wrappedSnapshot
243
+
244
+ {
245
+ // Base attributes common to every element
246
+ NSMutableDictionary<NSString *, NSString *(^)(void)> *blocks =
247
+ [@{
248
+ FBExclusionAttributeFrame: ^{
249
+ return NSStringFromCGRect(wrappedSnapshot.wdFrame);
250
+ },
251
+ FBExclusionAttributeEnabled: ^{
252
+ return [@([wrappedSnapshot isWDEnabled]) stringValue];
253
+ },
254
+ FBExclusionAttributeVisible: ^{
255
+ return [@([wrappedSnapshot isWDVisible]) stringValue];
256
+ },
257
+ FBExclusionAttributeAccessible: ^{
258
+ return [@([wrappedSnapshot isWDAccessible]) stringValue];
259
+ },
260
+ FBExclusionAttributeFocused: ^{
261
+ return [@([wrappedSnapshot isWDFocused]) stringValue];
262
+ }
263
+ } mutableCopy];
264
+
265
+ XCUIElementType elementType = wrappedSnapshot.elementType;
266
+
267
+ // Text-input placeholder (only for elements that support inner text)
268
+ if (FBDoesElementSupportInnerText(elementType)) {
269
+ blocks[FBExclusionAttributePlaceholderValue] = ^{
270
+ return (NSString *)FBValueOrNull(wrappedSnapshot.wdPlaceholderValue);
271
+ };
272
+ }
273
+
274
+ return [blocks copy];
275
+ }
276
+
251
277
  + (NSDictionary *)accessibilityInfoForElement:(id<FBXCElementSnapshot>)snapshot
252
278
  {
253
279
  FBXCElementSnapshotWrapper *wrappedSnapshot = [FBXCElementSnapshotWrapper ensureWrapped:snapshot];
@@ -10,6 +10,7 @@
10
10
  #import "XCUIElement+FBWebDriverAttributes.h"
11
11
 
12
12
  #import "FBElementTypeTransformer.h"
13
+ #import "FBElementHelpers.h"
13
14
  #import "FBLogger.h"
14
15
  #import "FBMacros.h"
15
16
  #import "FBXCElementSnapshotWrapper.h"
@@ -70,15 +71,6 @@
70
71
  return [self valueForKey:[FBElementUtils wdAttributeNameForAttributeName:name]];
71
72
  }
72
73
 
73
- - (BOOL)fb_supportsInnerText
74
- {
75
- XCUIElementType elementType = self.elementType;
76
- return elementType == XCUIElementTypeTextView
77
- || elementType == XCUIElementTypeTextField
78
- || elementType == XCUIElementTypeSearchField
79
- || elementType == XCUIElementTypeSecureTextField;
80
- }
81
-
82
74
  - (NSString *)wdValue
83
75
  {
84
76
  id value = self.value;
@@ -91,7 +83,7 @@
91
83
  value = FBFirstNonEmptyValue(value, isSelected);
92
84
  } else if (elementType == XCUIElementTypeSwitch) {
93
85
  value = @([value boolValue]);
94
- } else if (self.fb_supportsInnerText) {
86
+ } else if (FBDoesElementSupportInnerText(elementType)) {
95
87
  NSString *placeholderValue = self.placeholderValue;
96
88
  value = FBFirstNonEmptyValue(value, placeholderValue);
97
89
  }
@@ -128,7 +120,7 @@
128
120
 
129
121
  - (NSString *)wdPlaceholderValue
130
122
  {
131
- return self.fb_supportsInnerText
123
+ return FBDoesElementSupportInnerText(self.elementType)
132
124
  ? self.placeholderValue
133
125
  : FBTransferEmptyStringToNil(self.placeholderValue);
134
126
  }
@@ -15,11 +15,11 @@
15
15
  <key>CFBundlePackageType</key>
16
16
  <string>FMWK</string>
17
17
  <key>CFBundleShortVersionString</key>
18
- <string>9.6.2</string>
18
+ <string>9.7.0</string>
19
19
  <key>CFBundleSignature</key>
20
20
  <string>????</string>
21
21
  <key>CFBundleVersion</key>
22
- <string>9.6.2</string>
22
+ <string>9.7.0</string>
23
23
  <key>NSPrincipalClass</key>
24
24
  <string/>
25
25
  </dict>
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ */
9
+
10
+ #import <XCTest/XCTest.h>
11
+
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ /**
15
+ Checks if the element is a text field
16
+
17
+ @param elementType XCTest element type
18
+ @return YES if the elemnt is a text field
19
+ */
20
+ BOOL FBDoesElementSupportInnerText(XCUIElementType elementType);
21
+
22
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ */
9
+
10
+ #import "FBElementHelpers.h"
11
+
12
+ BOOL FBDoesElementSupportInnerText(XCUIElementType elementType) {
13
+ return elementType == XCUIElementTypeTextView
14
+ || elementType == XCUIElementTypeTextField
15
+ || elementType == XCUIElementTypeSearchField
16
+ || elementType == XCUIElementTypeSecureTextField;
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "9.6.2",
3
+ "version": "9.7.0",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",