appium-webdriveragent 5.8.6 → 5.8.7

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,10 @@
1
+ ## [5.8.7](https://github.com/appium/WebDriverAgent/compare/v5.8.6...v5.8.7) (2023-09-22)
2
+
3
+
4
+ ### Miscellaneous Chores
5
+
6
+ * tweak device in currentCapabilities ([#773](https://github.com/appium/WebDriverAgent/issues/773)) ([8481b02](https://github.com/appium/WebDriverAgent/commit/8481b02fc84de1147e1254ea7fd114f8735b0226))
7
+
1
8
  ## [5.8.6](https://github.com/appium/WebDriverAgent/compare/v5.8.5...v5.8.6) (2023-09-21)
2
9
 
3
10
 
@@ -257,7 +257,8 @@
257
257
  #endif
258
258
  @"ip" : [XCUIDevice sharedDevice].fb_wifiIPAddress ?: [NSNull null]
259
259
  },
260
- @"build" : buildInfo.copy
260
+ @"build" : buildInfo.copy,
261
+ @"device": [self.class deviceNameByUserInterfaceIdiom:[UIDevice currentDevice].userInterfaceIdiom]
261
262
  }
262
263
  );
263
264
  }
@@ -418,6 +419,23 @@
418
419
  };
419
420
  }
420
421
 
422
+ /*
423
+ Return the device kind as lower case
424
+ */
425
+ + (NSString *)deviceNameByUserInterfaceIdiom:(UIUserInterfaceIdiom) userInterfaceIdiom
426
+ {
427
+ if (userInterfaceIdiom == UIUserInterfaceIdiomPad) {
428
+ return @"ipad";
429
+ } else if (userInterfaceIdiom == UIUserInterfaceIdiomTV) {
430
+ return @"apple tv";
431
+ } else if (userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
432
+ return @"iphone";
433
+ }
434
+ // CarPlay, Mac, Vision UI or unknown are possible
435
+ return @"Unknown";
436
+
437
+ }
438
+
421
439
  + (NSDictionary *)currentCapabilities
422
440
  {
423
441
  FBApplication *application = [FBSession activeSession].activeApplication;
@@ -425,7 +443,7 @@
425
443
  [FBLogger logFmt:@"Current active application bundle id is %@", application.bundleID];
426
444
  return
427
445
  @{
428
- @"device": ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) ? @"ipad" : @"iphone",
446
+ @"device": [self.class deviceNameByUserInterfaceIdiom:[UIDevice currentDevice].userInterfaceIdiom],
429
447
  @"sdkVersion": [[UIDevice currentDevice] systemVersion],
430
448
  @"browserName": application.label ?: [NSNull null],
431
449
  @"CFBundleIdentifier": application.bundleID ?: [NSNull null],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "5.8.6",
3
+ "version": "5.8.7",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {