Skip to content

Commit ec36504

Browse files
chore: resolve automation name
1 parent b25a2fa commit ec36504

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/ns-capabilities.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,12 @@ export class NsCapabilities implements INsCapabilities {
120120

121121
tryGetAndroidApiLevel() {
122122
try {
123-
return parseFloat(this.appiumCaps["platformVersion"]);
124-
} catch (error) {
125-
}
123+
if (this.appiumCaps["platformVersion"]) {
124+
const apiLevel = this.appiumCaps["platformVersion"].split(".").splice(0, 2).join('.');
125+
return parseFloat(apiLevel);
126+
}
127+
} catch (error) { }
128+
return undefined;
126129
}
127130

128131
private resolveApplication() {

0 commit comments

Comments
 (0)