Skip to content

Commit

Permalink
fix: Tune retrieval of package launch info
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Dec 27, 2024
1 parent 7f72dca commit 63b89a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lib/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,13 @@ class AndroidUiautomator2Driver
...caps,
...sessionInfo,
};
// Adding AUT package name in the capabilities if package name not exist in caps
if (!capsWithSessionInfo.appPackage && appInfo) {
capsWithSessionInfo.appPackage = appInfo.appPackage;
// Adding AUT info in the capabilities if it does not exist in caps
if (appInfo) {
for (const capName of ['appPackage', 'appActivity']) {
if (!capsWithSessionInfo[capName] && appInfo[capName]) {
capsWithSessionInfo[capName] = appInfo[capName];
}
}
}

await this.performSessionExecution(capsWithSessionInfo);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"dependencies": {
"appium-adb": "^12.7.3",
"appium-android-driver": "^9.14.7",
"appium-android-driver": "^9.14.9",
"appium-uiautomator2-server": "^7.0.24",
"asyncbox": "^3.0.0",
"axios": "^1.6.5",
Expand Down

0 comments on commit 63b89a3

Please sign in to comment.