appium-webdriveragent 9.0.6 → 9.1.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,9 @@
1
+ ## [9.1.0](https://github.com/appium/WebDriverAgent/compare/v9.0.6...v9.1.0) (2025-03-09)
2
+
3
+ ### Features
4
+
5
+ * add placeholderValue ([#987](https://github.com/appium/WebDriverAgent/issues/987)) ([8c3a1cb](https://github.com/appium/WebDriverAgent/commit/8c3a1cb30655ed8d1a77d25bbeca71ee48c2ec3e))
6
+
1
7
  ## [9.0.6](https://github.com/appium/WebDriverAgent/compare/v9.0.5...v9.0.6) (2025-02-28)
2
8
 
3
9
  ### Bug Fixes
@@ -115,6 +115,15 @@
115
115
  return FBTransferEmptyStringToNil(label);
116
116
  }
117
117
 
118
+ - (NSString *)wdPlaceholderValue
119
+ {
120
+ NSString *placehlderValue = self.placeholderValue;
121
+ if (nil != placehlderValue) {
122
+ return placehlderValue;
123
+ }
124
+ return FBTransferEmptyStringToNil(placehlderValue);
125
+ }
126
+
118
127
  - (NSString *)wdType
119
128
  {
120
129
  return [FBElementTypeTransformer stringWithElementType:self.elementType];
@@ -15,11 +15,11 @@
15
15
  <key>CFBundlePackageType</key>
16
16
  <string>FMWK</string>
17
17
  <key>CFBundleShortVersionString</key>
18
- <string>9.0.6</string>
18
+ <string>9.1.0</string>
19
19
  <key>CFBundleSignature</key>
20
20
  <string>????</string>
21
21
  <key>CFBundleVersion</key>
22
- <string>9.0.6</string>
22
+ <string>9.1.0</string>
23
23
  <key>NSPrincipalClass</key>
24
24
  <string/>
25
25
  </dict>
@@ -62,6 +62,9 @@ NS_ASSUME_NONNULL_BEGIN
62
62
  /*! Element's index relatively to its parent. Starts from zero */
63
63
  @property (nonatomic, readonly) NSUInteger wdIndex;
64
64
 
65
+ /*! Element's placeholder value */
66
+ @property (nonatomic, readonly, copy, nullable) NSString *wdPlaceholderValue;
67
+
65
68
  /**
66
69
  Returns value of given property specified in WebDriver Spec
67
70
  Check the FBElement protocol to get list of supported attributes.
@@ -100,6 +100,10 @@
100
100
 
101
101
  @end
102
102
 
103
+ @interface FBPlaceholderValueAttribute : FBElementAttribute
104
+
105
+ @end
106
+
103
107
  #if TARGET_OS_TV
104
108
 
105
109
  @interface FBFocusedAttribute : FBElementAttribute
@@ -491,6 +495,7 @@ static NSString *const FBAbstractMethodInvocationException = @"AbstractMethodInv
491
495
  FBHeightAttribute.class,
492
496
  FBIndexAttribute.class,
493
497
  FBHittableAttribute.class,
498
+ FBPlaceholderValueAttribute.class,
494
499
  ];
495
500
  }
496
501
 
@@ -713,3 +718,18 @@ static NSString *const FBAbstractMethodInvocationException = @"AbstractMethodInv
713
718
  return rc;
714
719
  }
715
720
  @end
721
+
722
+
723
+ @implementation FBPlaceholderValueAttribute
724
+
725
+ + (NSString *)name
726
+ {
727
+ return @"placeholderValue";
728
+ }
729
+
730
+ + (NSString *)valueForElement:(id<FBElement>)element
731
+ {
732
+ return element.wdPlaceholderValue;
733
+ }
734
+
735
+ @end
@@ -154,6 +154,7 @@
154
154
  XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeSwitch");
155
155
  XCTAssertNil(element.wdName);
156
156
  XCTAssertNil(element.wdLabel);
157
+ XCTAssertNil(element.wdPlaceholderValue);
157
158
  XCTAssertEqualObjects(element.wdValue, @"1");
158
159
  XCTAssertFalse(element.wdSelected);
159
160
  XCTAssertTrue(element.wdHittable);
@@ -57,7 +57,7 @@
57
57
  NSString *xmlStr = [FBXPath xmlStringWithRootElement:wrappedSnapshot
58
58
  options:nil];
59
59
  XCTAssertNotNil(xmlStr);
60
- NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdEnabled), FBBoolToString(wrappedSnapshot.wdVisible), FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdIndex];
60
+ NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" placeholderValue=\"%@\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdEnabled), FBBoolToString(wrappedSnapshot.wdVisible), FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdIndex, wrappedSnapshot.wdPlaceholderValue];
61
61
  XCTAssertEqualObjects(xmlStr, expectedXml);
62
62
  }
63
63
 
@@ -70,7 +70,7 @@
70
70
  NSString *xmlStr = [FBXPath xmlStringWithRootElement:wrappedSnapshot
71
71
  options:options];
72
72
  XCTAssertNotNil(xmlStr);
73
- NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@>\n <%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\"/>\n</%@>\n", scope, wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdEnabled), FBBoolToString(wrappedSnapshot.wdVisible), FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdIndex, scope];
73
+ NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@>\n <%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" placeholderValue=\"%@\"/>\n</%@>\n", scope, wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdEnabled), FBBoolToString(wrappedSnapshot.wdVisible), FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdIndex, wrappedSnapshot.wdPlaceholderValue, scope];
74
74
  XCTAssertEqualObjects(xmlStr, expectedXml);
75
75
  }
76
76
 
@@ -83,7 +83,7 @@
83
83
  NSString *xmlStr = [FBXPath xmlStringWithRootElement:wrappedSnapshot
84
84
  options:options];
85
85
  XCTAssertNotNil(xmlStr);
86
- NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue]];
86
+ NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" placeholderValue=\"%@\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdPlaceholderValue];
87
87
  XCTAssertEqualObjects(xmlStr, expectedXml);
88
88
  }
89
89
 
@@ -60,7 +60,7 @@
60
60
 
61
61
  - (NSString *)placeholderValue
62
62
  {
63
- return @"";
63
+ return @"testPlaceholderValue";
64
64
  }
65
65
 
66
66
  - (BOOL)isSelected
@@ -33,6 +33,7 @@
33
33
  @property (nonatomic, readwrite, getter=isWDAccessible) BOOL wdAccessible;
34
34
  @property (nonatomic, readwrite, getter = isWDFocused) BOOL wdFocused;
35
35
  @property (nonatomic, readwrite, getter = isWDHittable) BOOL wdHittable;
36
+ @property (nonatomic, copy, readwrite, nullable) NSString *wdPlaceholderValue;
36
37
  @property (copy, nonnull) NSArray *children;
37
38
  @property (nonatomic, readwrite, assign) XCUIElementType elementType;
38
39
  @property (nonatomic, readwrite, getter=isWDAccessibilityContainer) BOOL wdAccessibilityContainer;
@@ -23,6 +23,7 @@
23
23
  self.wdName = @"testName";
24
24
  self.wdLabel = @"testLabel";
25
25
  self.wdValue = @"magicValue";
26
+ self.wdPlaceholderValue = @"testPlaceholderValue";
26
27
  self.wdVisible = YES;
27
28
  self.wdAccessible = YES;
28
29
  self.wdEnabled = YES;
@@ -63,8 +63,8 @@
63
63
  NSString *resultXml = [self xmlStringWithElement:element
64
64
  xpathQuery:nil
65
65
  excludingAttributes:nil];
66
- NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" value=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" private_indexPath=\"top\"/>\n",
67
- element.wdType, element.wdType, element.wdValue, element.wdName, element.wdLabel, FBBoolToString(element.wdEnabled), FBBoolToString(element.wdVisible), FBBoolToString(element.wdAccessible), element.wdRect[@"x"], element.wdRect[@"y"], element.wdRect[@"width"], element.wdRect[@"height"], element.wdIndex];
66
+ NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" value=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" placeholderValue=\"%@\" private_indexPath=\"top\"/>\n",
67
+ element.wdType, element.wdType, element.wdValue, element.wdName, element.wdLabel, FBBoolToString(element.wdEnabled), FBBoolToString(element.wdVisible), FBBoolToString(element.wdAccessible), element.wdRect[@"x"], element.wdRect[@"y"], element.wdRect[@"width"], element.wdRect[@"height"], element.wdIndex, element.wdPlaceholderValue];
68
68
  XCTAssertTrue([resultXml isEqualToString: expectedXml]);
69
69
  }
70
70
 
@@ -75,8 +75,8 @@
75
75
  NSString *resultXml = [self xmlStringWithElement:element
76
76
  xpathQuery:nil
77
77
  excludingAttributes:@[@"type", @"visible", @"value", @"index"]];
78
- NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ name=\"%@\" label=\"%@\" enabled=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" private_indexPath=\"top\"/>\n",
79
- element.wdType, element.wdName, element.wdLabel, FBBoolToString(element.wdEnabled), FBBoolToString(element.wdAccessible), element.wdRect[@"x"], element.wdRect[@"y"], element.wdRect[@"width"], element.wdRect[@"height"]];
78
+ NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ name=\"%@\" label=\"%@\" enabled=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" placeholderValue=\"%@\" private_indexPath=\"top\"/>\n",
79
+ element.wdType, element.wdName, element.wdLabel, FBBoolToString(element.wdEnabled), FBBoolToString(element.wdAccessible), element.wdRect[@"x"], element.wdRect[@"y"], element.wdRect[@"width"], element.wdRect[@"height"], element.wdPlaceholderValue];
80
80
  XCTAssertEqualObjects(resultXml, expectedXml);
81
81
  }
82
82
 
@@ -89,8 +89,8 @@
89
89
  NSString *resultXml = [self xmlStringWithElement:element
90
90
  xpathQuery:[NSString stringWithFormat:@"//%@[@*]", element.wdType]
91
91
  excludingAttributes:@[@"visible"]];
92
- NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" value=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" hittable=\"%@\" private_indexPath=\"top\"/>\n",
93
- element.wdType, element.wdType, @"йоло&lt;&gt;&amp;&quot;", element.wdName, @"a&#10;b", FBBoolToString(element.wdEnabled), FBBoolToString(element.wdVisible), FBBoolToString(element.wdAccessible), element.wdRect[@"x"], element.wdRect[@"y"], element.wdRect[@"width"], element.wdRect[@"height"], element.wdIndex, FBBoolToString(element.wdHittable)];
92
+ NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" value=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" hittable=\"%@\" placeholderValue=\"%@\" private_indexPath=\"top\"/>\n",
93
+ element.wdType, element.wdType, @"йоло&lt;&gt;&amp;&quot;", element.wdName, @"a&#10;b", FBBoolToString(element.wdEnabled), FBBoolToString(element.wdVisible), FBBoolToString(element.wdAccessible), element.wdRect[@"x"], element.wdRect[@"y"], element.wdRect[@"width"], element.wdRect[@"height"], element.wdIndex, FBBoolToString(element.wdHittable), element.wdPlaceholderValue];
94
94
  XCTAssertEqualObjects(expectedXml, resultXml);
95
95
  }
96
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "9.0.6",
3
+ "version": "9.1.0",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",