Skip to content

Commit 67064ed

Browse files
authored
Merge branch 'master' into fix_stuck_when_system_time_changes
2 parents 4e79777 + d465f35 commit 67064ed

File tree

5 files changed

+109
-32
lines changed

5 files changed

+109
-32
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## [10.1.0](https://github.com/appium/WebDriverAgent/compare/v10.0.1...v10.1.0) (2025-09-03)
2+
3+
### Features
4+
5+
* Add process and bundle identifiers to the application node in the XML source ([#1055](https://github.com/appium/WebDriverAgent/issues/1055)) ([088cff2](https://github.com/appium/WebDriverAgent/commit/088cff2b2bc19ddde698ec06f1db37c6989cf392))
6+
7+
## [10.0.1](https://github.com/appium/WebDriverAgent/compare/v10.0.0...v10.0.1) (2025-08-23)
8+
9+
### Miscellaneous Chores
10+
11+
* **deps-dev:** bump chai from 5.3.2 to 6.0.0 ([#1053](https://github.com/appium/WebDriverAgent/issues/1053)) ([9e9ec38](https://github.com/appium/WebDriverAgent/commit/9e9ec381bd6695e1c8b89f2a9c304b12385c0134))
12+
13+
## [10.0.0](https://github.com/appium/WebDriverAgent/compare/v9.15.3...v10.0.0) (2025-08-17)
14+
15+
### ⚠ BREAKING CHANGES
16+
17+
* Required Node.js version has been bumped to ^20.19.0 || ^22.12.0 || >=24.0.0
18+
* Required npm version has been bumped to >=10
19+
* Required base driver version has been bumped to >=10.0.0-rc.1
20+
21+
### Features
22+
23+
* Update server compatibility ([#1051](https://github.com/appium/WebDriverAgent/issues/1051)) ([f9ea1e5](https://github.com/appium/WebDriverAgent/commit/f9ea1e5e2f5306030387d5293f073b2a6fe658e7))
24+
125
## [9.15.3](https://github.com/appium/WebDriverAgent/compare/v9.15.2...v9.15.3) (2025-08-12)
226

327
### Miscellaneous Chores

WebDriverAgentLib/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>9.15.3</string>
18+
<string>10.1.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>9.15.3</string>
22+
<string>10.1.0</string>
2323
<key>NSPrincipalClass</key>
2424
<string/>
2525
</dict>

WebDriverAgentLib/Utilities/FBXPath.m

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717
#import "FBXMLGenerationOptions.h"
1818
#import "FBXCElementSnapshotWrapper+Helpers.h"
1919
#import "NSString+FBXMLSafeString.h"
20+
#import "XCUIApplication.h"
2021
#import "XCUIElement.h"
2122
#import "XCUIElement+FBCaching.h"
2223
#import "XCUIElement+FBUtilities.h"
2324
#import "XCUIElement+FBWebDriverAttributes.h"
2425
#import "XCTestPrivateSymbols.h"
2526
#import "FBElementHelpers.h"
27+
#import "FBXCAXClientProxy.h"
28+
#import "FBXCAccessibilityElement.h"
2629

2730

2831
@interface FBElementAttribute : NSObject
@@ -33,6 +36,7 @@ + (nonnull NSString *)name;
3336
+ (nullable NSString *)valueForElement:(id<FBElement>)element;
3437

3538
+ (int)recordWithWriter:(xmlTextWriterPtr)writer forElement:(id<FBElement>)element;
39+
+ (int)recordWithWriter:(xmlTextWriterPtr)writer forValue:(nullable NSString *)value;
3640

3741
+ (NSArray<Class> *)supportedAttributes;
3842

@@ -98,7 +102,13 @@ @interface FBInternalIndexAttribute : FBElementAttribute
98102

99103
@property (nonatomic, nonnull, readonly) NSString* indexValue;
100104

101-
+ (int)recordWithWriter:(xmlTextWriterPtr)writer forValue:(NSString *)value;
105+
@end
106+
107+
@interface FBApplicationBundleIdAttribute : FBElementAttribute
108+
109+
@end
110+
111+
@interface FBApplicationPidAttribute : FBElementAttribute
102112

103113
@end
104114

@@ -472,6 +482,27 @@ + (int)recordElementAttributes:(xmlTextWriterPtr)writer
472482
// index path is the special case
473483
return [FBInternalIndexAttribute recordWithWriter:writer forValue:indexPath];
474484
}
485+
if (element.elementType == XCUIElementTypeApplication) {
486+
// only record process identifier and bundle identifier for the application element
487+
int pid = [element.accessibilityElement processIdentifier];
488+
if (pid > 0) {
489+
int rc = [FBApplicationPidAttribute recordWithWriter:writer
490+
forValue:[NSString stringWithFormat:@"%d", pid]];
491+
if (rc < 0) {
492+
return rc;
493+
}
494+
XCUIApplication *app = [[FBXCAXClientProxy sharedClient]
495+
monitoredApplicationWithProcessIdentifier:pid];
496+
NSString *bundleID = [app bundleID];
497+
if (nil != bundleID) {
498+
rc = [FBApplicationBundleIdAttribute recordWithWriter:writer
499+
forValue:bundleID];
500+
if (rc < 0) {
501+
return rc;
502+
}
503+
}
504+
}
505+
}
475506
return 0;
476507
}
477508

@@ -585,6 +616,11 @@ + (NSString *)valueForElement:(id<FBElement>)element
585616
+ (int)recordWithWriter:(xmlTextWriterPtr)writer forElement:(id<FBElement>)element
586617
{
587618
NSString *value = [self valueForElement:element];
619+
return [self recordWithWriter:writer forValue:value];
620+
}
621+
622+
+ (int)recordWithWriter:(xmlTextWriterPtr)writer forValue:(nullable NSString *)value
623+
{
588624
if (nil == value) {
589625
// Skip the attribute if the value equals to nil
590626
return 0;
@@ -830,22 +866,25 @@ + (NSString *)name
830866
return kXMLIndexPathKey;
831867
}
832868

833-
+ (int)recordWithWriter:(xmlTextWriterPtr)writer forValue:(NSString *)value
869+
@end
870+
871+
@implementation FBApplicationBundleIdAttribute : FBElementAttribute
872+
873+
+ (NSString *)name
834874
{
835-
if (nil == value) {
836-
// Skip the attribute if the value equals to nil
837-
return 0;
838-
}
839-
int rc = xmlTextWriterWriteAttribute(writer,
840-
(xmlChar *)[[FBXPath safeXmlStringWithString:[self name]] UTF8String],
841-
(xmlChar *)[[FBXPath safeXmlStringWithString:value] UTF8String]);
842-
if (rc < 0) {
843-
[FBLogger logFmt:@"Failed to invoke libxml2>xmlTextWriterWriteAttribute(%@='%@'). Error code: %d", [self name], value, rc];
844-
}
845-
return rc;
875+
return @"bundleId";
846876
}
877+
847878
@end
848879

880+
@implementation FBApplicationPidAttribute : FBElementAttribute
881+
882+
+ (NSString *)name
883+
{
884+
return @"processId";
885+
}
886+
887+
@end
849888

850889
@implementation FBPlaceholderValueAttribute
851890

WebDriverAgentTests/IntegrationTests/FBXPathIntegrationTests.m

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
#import "FBMacros.h"
1414
#import "FBTestMacros.h"
1515
#import "FBXPath.h"
16+
#import "FBXCAccessibilityElement.h"
1617
#import "FBXCodeCompatibility.h"
1718
#import "FBXCElementSnapshotWrapper+Helpers.h"
1819
#import "FBXMLGenerationOptions.h"
20+
#import "XCUIApplication.h"
1921
#import "XCUIElement.h"
2022
#import "XCUIElement+FBFind.h"
2123
#import "XCUIElement+FBUtilities.h"
@@ -50,6 +52,19 @@ - (void)setUp
5052
return snapshot;
5153
}
5254

55+
- (void)testApplicationNodeXMLRepresentation
56+
{
57+
id<FBXCElementSnapshot> snapshot = [self.testedApplication fb_customSnapshot];
58+
snapshot.children = @[];
59+
FBXCElementSnapshotWrapper *wrappedSnapshot = [FBXCElementSnapshotWrapper ensureWrapped:snapshot];
60+
NSString *xmlStr = [FBXPath xmlStringWithRootElement:wrappedSnapshot
61+
options:nil];
62+
int pid = [snapshot.accessibilityElement processIdentifier];
63+
XCTAssertNotNil(xmlStr);
64+
NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" traits=\"%@\" processId=\"%d\" bundleId=\"%@\"/>\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.wdTraits, pid, [self.testedApplication bundleID]];
65+
XCTAssertEqualObjects(xmlStr, expectedXml);
66+
}
67+
5368
- (void)testSingleDescendantXMLRepresentation
5469
{
5570
id<FBXCElementSnapshot> snapshot = self.destinationSnapshot;

package.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "appium-webdriveragent",
3-
"version": "9.15.3",
3+
"version": "10.1.0",
44
"description": "Package bundling WebDriverAgent",
55
"main": "./build/index.js",
66
"types": "./build/index.d.ts",
@@ -22,8 +22,8 @@
2222
"sync-wda-version": "node ./scripts/update-wda-version.js --package-version=${npm_package_version} && git add WebDriverAgentLib/Info.plist"
2323
},
2424
"engines": {
25-
"node": ">=14",
26-
"npm": ">=8"
25+
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
26+
"npm": ">=10"
2727
},
2828
"prettier": {
2929
"bracketSpacing": false,
@@ -48,22 +48,21 @@
4848
},
4949
"homepage": "https://github.com/appium/WebDriverAgent#readme",
5050
"devDependencies": {
51-
"@appium/eslint-config-appium-ts": "^1.0.0",
52-
"@appium/test-support": "^3.0.0",
53-
"@appium/tsconfig": "^0.x",
54-
"@appium/types": "^0.x",
51+
"@appium/eslint-config-appium-ts": "^2.0.0-rc.1",
52+
"@appium/test-support": "^4.0.0-rc.1",
53+
"@appium/tsconfig": "^1.0.0-rc.1",
54+
"@appium/types": "^1.0.0-rc.1",
5555
"@semantic-release/changelog": "^6.0.1",
5656
"@semantic-release/git": "^10.0.1",
5757
"@types/bluebird": "^3.5.38",
5858
"@types/lodash": "^4.14.196",
5959
"@types/mocha": "^10.0.1",
6060
"@types/node": "^24.0.0",
61-
"@types/teen_process": "^2.0.1",
62-
"appium-xcode": "^5.0.0",
63-
"chai": "^5.1.1",
61+
"appium-xcode": "^6.0.0",
62+
"chai": "^6.0.0",
6463
"chai-as-promised": "^8.0.0",
6564
"conventional-changelog-conventionalcommits": "^9.0.0",
66-
"node-simctl": "^7.0.1",
65+
"node-simctl": "^8.0.0",
6766
"mocha": "^11.0.1",
6867
"prettier": "^3.0.0",
6968
"semantic-release": "^24.0.0",
@@ -73,18 +72,18 @@
7372
"typescript": "^5.4.2"
7473
},
7574
"dependencies": {
76-
"@appium/base-driver": "^9.0.0",
77-
"@appium/strongbox": "^0.x",
78-
"@appium/support": "^6.0.0",
79-
"appium-ios-device": "^2.9.0",
80-
"appium-ios-simulator": "^6.2.2",
75+
"@appium/base-driver": "^10.0.0-rc.1",
76+
"@appium/strongbox": "^1.0.0-rc.1",
77+
"@appium/support": "^7.0.0-rc.1",
78+
"appium-ios-device": "^3.0.0",
79+
"appium-ios-simulator": "^7.0.0",
8180
"async-lock": "^1.0.0",
8281
"asyncbox": "^3.0.0",
8382
"axios": "^1.4.0",
8483
"bluebird": "^3.5.5",
8584
"lodash": "^4.17.11",
8685
"source-map-support": "^0.x",
87-
"teen_process": "^2.2.0"
86+
"teen_process": "^3.0.0"
8887
},
8988
"files": [
9089
"index.ts",

0 commit comments

Comments
 (0)