appium-webdriveragent 16.13.0 → 16.13.1
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
|
+
## [16.13.1](https://github.com/appium/WebDriverAgent/compare/v16.13.0...v16.13.1) (2026-09-30)
|
|
2
|
+
|
|
3
|
+
### Performance Improvements
|
|
4
|
+
|
|
5
|
+
* reuse sibling indices and geometry during XML serialization ([#1283](https://github.com/appium/WebDriverAgent/issues/1283)) ([f352660](https://github.com/appium/WebDriverAgent/commit/f352660deb52728c195a875b4172e38e1a1496b8))
|
|
6
|
+
|
|
1
7
|
## [16.13.0](https://github.com/appium/WebDriverAgent/compare/v16.12.11...v16.13.0) (2026-09-30)
|
|
2
8
|
|
|
3
9
|
### Features
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
<key>CFBundlePackageType</key>
|
|
16
16
|
<string>FMWK</string>
|
|
17
17
|
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>16.13.
|
|
18
|
+
<string>16.13.1</string>
|
|
19
19
|
<key>CFBundleSignature</key>
|
|
20
20
|
<string>????</string>
|
|
21
21
|
<key>CFBundleVersion</key>
|
|
22
|
-
<string>16.13.
|
|
22
|
+
<string>16.13.1</string>
|
|
23
23
|
<key>NSPrincipalClass</key>
|
|
24
24
|
<string/>
|
|
25
25
|
</dict>
|
|
@@ -504,6 +504,18 @@ static NSString *const topNodeIndexPath = @"top";
|
|
|
504
504
|
indexPath:(nullable NSString *)indexPath
|
|
505
505
|
includedAttributes:(nullable NSSet<Class> *)includedAttributes
|
|
506
506
|
{
|
|
507
|
+
return [self recordElementAttributes:writer forElement:element indexPath:indexPath
|
|
508
|
+
includedAttributes:includedAttributes siblingIndex:nil];
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
+ (int)recordElementAttributes:(xmlTextWriterPtr)writer
|
|
512
|
+
forElement:(id<FBXCElementSnapshot>)element
|
|
513
|
+
indexPath:(nullable NSString *)indexPath
|
|
514
|
+
includedAttributes:(nullable NSSet<Class> *)includedAttributes
|
|
515
|
+
siblingIndex:(nullable NSNumber *)siblingIndex
|
|
516
|
+
{
|
|
517
|
+
FBXCElementSnapshotWrapper *wrapped = [FBXCElementSnapshotWrapper ensureWrapped:element];
|
|
518
|
+
NSDictionary *rect = nil;
|
|
507
519
|
for (Class attributeCls in FBElementAttribute.supportedAttributes) {
|
|
508
520
|
// include all supported attributes by default unless enumerated explicitly
|
|
509
521
|
if (includedAttributes && ![includedAttributes containsObject:attributeCls]) {
|
|
@@ -519,8 +531,15 @@ static NSString *const topNodeIndexPath = @"top";
|
|
|
519
531
|
!FBDoesElementSupportMinMaxValue(element.elementType)) {
|
|
520
532
|
continue;
|
|
521
533
|
}
|
|
522
|
-
int rc
|
|
523
|
-
|
|
534
|
+
int rc;
|
|
535
|
+
if (attributeCls == FBIndexAttribute.class && nil != siblingIndex) {
|
|
536
|
+
rc = [attributeCls recordWithWriter:writer forValue:siblingIndex.stringValue];
|
|
537
|
+
} else if ([attributeCls isSubclassOfClass:FBDimensionAttribute.class]) {
|
|
538
|
+
rect = rect ?: wrapped.wdRect;
|
|
539
|
+
rc = [attributeCls recordWithWriter:writer forValue:[rect[[attributeCls name]] description]];
|
|
540
|
+
} else {
|
|
541
|
+
rc = [attributeCls recordWithWriter:writer forElement:wrapped];
|
|
542
|
+
}
|
|
524
543
|
if (rc < 0) {
|
|
525
544
|
return rc;
|
|
526
545
|
}
|
|
@@ -559,6 +578,17 @@ static NSString *const topNodeIndexPath = @"top";
|
|
|
559
578
|
elementStore:(nullable NSMutableDictionary *)elementStore
|
|
560
579
|
includedAttributes:(nullable NSSet<Class> *)includedAttributes
|
|
561
580
|
writer:(xmlTextWriterPtr)writer
|
|
581
|
+
{
|
|
582
|
+
return [self writeXmlWithRootElement:root indexPath:indexPath elementStore:elementStore
|
|
583
|
+
includedAttributes:includedAttributes writer:writer siblingIndex:nil];
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
+ (int)writeXmlWithRootElement:(id<FBXCElementSnapshot>)root
|
|
587
|
+
indexPath:(nullable NSString *)indexPath
|
|
588
|
+
elementStore:(nullable NSMutableDictionary *)elementStore
|
|
589
|
+
includedAttributes:(nullable NSSet<Class> *)includedAttributes
|
|
590
|
+
writer:(xmlTextWriterPtr)writer
|
|
591
|
+
siblingIndex:(nullable NSNumber *)siblingIndex
|
|
562
592
|
{
|
|
563
593
|
NSAssert((indexPath == nil && elementStore == nil) || (indexPath != nil && elementStore != nil), @"Either both or none of indexPath and elementStore arguments should be equal to nil", nil);
|
|
564
594
|
|
|
@@ -578,7 +608,8 @@ static NSString *const topNodeIndexPath = @"top";
|
|
|
578
608
|
rc = [self recordElementAttributes:writer
|
|
579
609
|
forElement:root
|
|
580
610
|
indexPath:indexPath
|
|
581
|
-
includedAttributes:includedAttributes
|
|
611
|
+
includedAttributes:includedAttributes
|
|
612
|
+
siblingIndex:siblingIndex];
|
|
582
613
|
if (rc < 0) {
|
|
583
614
|
return rc;
|
|
584
615
|
}
|
|
@@ -594,7 +625,8 @@ static NSString *const topNodeIndexPath = @"top";
|
|
|
594
625
|
indexPath:newIndexPath
|
|
595
626
|
elementStore:elementStore
|
|
596
627
|
includedAttributes:includedAttributes
|
|
597
|
-
writer:writer
|
|
628
|
+
writer:writer
|
|
629
|
+
siblingIndex:@(i)];
|
|
598
630
|
if (rc < 0) {
|
|
599
631
|
return rc;
|
|
600
632
|
}
|
|
@@ -16,11 +16,47 @@
|
|
|
16
16
|
#import "FBXCElementSnapshotWrapper+Helpers.h"
|
|
17
17
|
#import "XCTestPrivateSymbols.h"
|
|
18
18
|
|
|
19
|
+
@interface FBTraversalSnapshot : XCElementSnapshotDouble
|
|
20
|
+
@property (nonatomic, copy) NSArray *childSnapshots;
|
|
21
|
+
@property (nonatomic, weak) FBTraversalSnapshot *parentSnapshot;
|
|
22
|
+
@property (nonatomic) NSUInteger childrenReads;
|
|
23
|
+
@property (nonatomic) NSUInteger frameReads;
|
|
24
|
+
@end
|
|
25
|
+
@implementation FBTraversalSnapshot
|
|
26
|
+
- (NSArray *)children { self.childrenReads++; return self.childSnapshots ?: @[]; }
|
|
27
|
+
- (id)parent { return self.parentSnapshot; }
|
|
28
|
+
- (CGRect)frame { self.frameReads++; return CGRectMake(1, 2, 3, 4); }
|
|
29
|
+
@end
|
|
30
|
+
|
|
19
31
|
@interface FBXPathTests : XCTestCase
|
|
20
32
|
@end
|
|
21
33
|
|
|
22
34
|
@implementation FBXPathTests
|
|
23
35
|
|
|
36
|
+
- (void)testSerializationVisitsSiblingListAndFrameOnce
|
|
37
|
+
{
|
|
38
|
+
FBTraversalSnapshot *root = [FBTraversalSnapshot new];
|
|
39
|
+
NSMutableArray *children = [NSMutableArray array];
|
|
40
|
+
for (NSUInteger index = 0; index < 64; index++) {
|
|
41
|
+
FBTraversalSnapshot *child = [FBTraversalSnapshot new];
|
|
42
|
+
child.parentSnapshot = root;
|
|
43
|
+
[children addObject:child];
|
|
44
|
+
}
|
|
45
|
+
root.childSnapshots = children;
|
|
46
|
+
NSString *query = @"//*[@index >= 0 and @x=1 and @y=2 and @width=3 and @height=4]";
|
|
47
|
+
xmlDocPtr doc = [self documentForSnapshot:root query:query];
|
|
48
|
+
@try {
|
|
49
|
+
XCTAssertEqual(root.childrenReads, 1u);
|
|
50
|
+
XCTAssertEqual(root.frameReads, 1u);
|
|
51
|
+
for (FBTraversalSnapshot *child in children) {
|
|
52
|
+
XCTAssertEqual(child.frameReads, 1u);
|
|
53
|
+
}
|
|
54
|
+
XCTAssertEqualObjects([self xpathStringResultForQuery:@"count(//*[@index=63])" document:doc], @"1");
|
|
55
|
+
} @finally {
|
|
56
|
+
xmlFreeDoc(doc);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
24
60
|
- (NSString *)xmlStringWithElement:(id<FBXCElementSnapshot>)snapshot
|
|
25
61
|
xpathQuery:(nullable NSString *)query
|
|
26
62
|
excludingAttributes:(nullable NSArray<NSString *> *)excludedAttributes
|