appium-webdriveragent 8.6.0 → 8.7.0

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
+ ## [8.7.0](https://github.com/appium/WebDriverAgent/compare/v8.6.0...v8.7.0) (2024-06-01)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add a setting to respect system alerts while detecting active apps ([#907](https://github.com/appium/WebDriverAgent/issues/907)) ([5c82d66](https://github.com/appium/WebDriverAgent/commit/5c82d66890b1a74f9b6f698c87590b2154a6c1bd))
7
+
1
8
  ## [8.6.0](https://github.com/appium/WebDriverAgent/compare/v8.5.7...v8.6.0) (2024-05-17)
2
9
 
3
10
 
@@ -345,6 +345,7 @@
345
345
  FB_SETTING_DISMISS_ALERT_BUTTON_SELECTOR: FBConfiguration.dismissAlertButtonSelector,
346
346
  FB_SETTING_DEFAULT_ALERT_ACTION: request.session.defaultAlertAction ?: @"",
347
347
  FB_SETTING_MAX_TYPING_FREQUENCY: @([FBConfiguration maxTypingFrequency]),
348
+ FB_SETTING_RESPECT_SYSTEM_ALERTS: @([FBConfiguration shouldRespectSystemAlerts]),
348
349
  #if !TARGET_OS_TV
349
350
  FB_SETTING_SCREENSHOT_ORIENTATION: [FBConfiguration humanReadableScreenshotOrientation],
350
351
  #endif
@@ -385,6 +386,9 @@
385
386
  if (nil != [settings objectForKey:FB_SETTING_KEYBOARD_PREDICTION]) {
386
387
  [FBConfiguration setKeyboardPrediction:[[settings objectForKey:FB_SETTING_KEYBOARD_PREDICTION] boolValue]];
387
388
  }
389
+ if (nil != [settings objectForKey:FB_SETTING_RESPECT_SYSTEM_ALERTS]) {
390
+ [FBConfiguration setShouldRespectSystemAlerts:[[settings objectForKey:FB_SETTING_RESPECT_SYSTEM_ALERTS] boolValue]];
391
+ }
388
392
  // SNAPSHOT_TIMEOUT setting is deprecated. Please use CUSTOM_SNAPSHOT_TIMEOUT instead
389
393
  if (nil != [settings objectForKey:FB_SETTING_SNAPSHOT_TIMEOUT]) {
390
394
  [FBConfiguration setCustomSnapshotTimeout:[[settings objectForKey:FB_SETTING_SNAPSHOT_TIMEOUT] doubleValue]];
@@ -15,11 +15,11 @@
15
15
  <key>CFBundlePackageType</key>
16
16
  <string>FMWK</string>
17
17
  <key>CFBundleShortVersionString</key>
18
- <string>8.6.0</string>
18
+ <string>8.7.0</string>
19
19
  <key>CFBundleSignature</key>
20
20
  <string>????</string>
21
21
  <key>CFBundleVersion</key>
22
- <string>8.6.0</string>
22
+ <string>8.7.0</string>
23
23
  <key>NSPrincipalClass</key>
24
24
  <string/>
25
25
  </dict>
@@ -176,6 +176,10 @@ static FBSession *_activeSession = nil;
176
176
  if (nil != self.testedApplication) {
177
177
  XCUIApplicationState testedAppState = self.testedApplication.state;
178
178
  if (testedAppState >= XCUIApplicationStateRunningForeground) {
179
+ if ([FBConfiguration shouldRespectSystemAlerts]
180
+ && [XCUIApplication.fb_systemApplication descendantsMatchingType:XCUIElementTypeAlert].count > 0) {
181
+ return XCUIApplication.fb_systemApplication;
182
+ }
179
183
  return (XCUIApplication *)self.testedApplication;
180
184
  }
181
185
  if (self.isTestedApplicationExpectedToRun && testedAppState <= XCUIApplicationStateNotRunning) {
@@ -66,6 +66,10 @@ extern NSString *const FBSnapshotMaxDepthKey;
66
66
  + (void)setShouldUseSingletonTestManager:(BOOL)value;
67
67
  + (BOOL)shouldUseSingletonTestManager;
68
68
 
69
+ /* Enforces WDA to verify the presense of system alerts while checking for an active app */
70
+ + (void)setShouldRespectSystemAlerts:(BOOL)value;
71
+ + (BOOL)shouldRespectSystemAlerts;
72
+
69
73
  /**
70
74
  * Extract switch value from arguments
71
75
  *
@@ -31,6 +31,7 @@ static NSString *const axSettingsClassName = @"AXSettings";
31
31
 
32
32
  static BOOL FBShouldUseTestManagerForVisibilityDetection = NO;
33
33
  static BOOL FBShouldUseSingletonTestManager = YES;
34
+ static BOOL FBShouldRespectSystemAlerts = NO;
34
35
 
35
36
  static NSUInteger FBMjpegScalingFactor = 100;
36
37
  static BOOL FBMjpegShouldFixOrientation = NO;
@@ -373,6 +374,16 @@ static UIInterfaceOrientation FBScreenshotOrientation;
373
374
  return [FBGetCustomParameterForElementSnapshot(FBSnapshotMaxDepthKey) intValue];
374
375
  }
375
376
 
377
+ + (void)setShouldRespectSystemAlerts:(BOOL)value
378
+ {
379
+ FBShouldRespectSystemAlerts = value;
380
+ }
381
+
382
+ + (BOOL)shouldRespectSystemAlerts
383
+ {
384
+ return FBShouldRespectSystemAlerts;
385
+ }
386
+
376
387
  + (void)setUseFirstMatch:(BOOL)enabled
377
388
  {
378
389
  FBShouldUseFirstMatch = enabled;
@@ -39,6 +39,7 @@ extern NSString* const FB_SETTING_SCREENSHOT_ORIENTATION;
39
39
  extern NSString* const FB_SETTING_WAIT_FOR_IDLE_TIMEOUT;
40
40
  extern NSString* const FB_SETTING_ANIMATION_COOL_OFF_TIMEOUT;
41
41
  extern NSString* const FB_SETTING_MAX_TYPING_FREQUENCY;
42
+ extern NSString* const FB_SETTING_RESPECT_SYSTEM_ALERTS;
42
43
 
43
44
 
44
45
  NS_ASSUME_NONNULL_END
@@ -34,3 +34,4 @@ NSString* const FB_SETTING_SCREENSHOT_ORIENTATION = @"screenshotOrientation";
34
34
  NSString* const FB_SETTING_WAIT_FOR_IDLE_TIMEOUT = @"waitForIdleTimeout";
35
35
  NSString* const FB_SETTING_ANIMATION_COOL_OFF_TIMEOUT = @"animationCoolOffTimeout";
36
36
  NSString* const FB_SETTING_MAX_TYPING_FREQUENCY = @"maxTypingFrequency";
37
+ NSString* const FB_SETTING_RESPECT_SYSTEM_ALERTS = @"respectSystemAlerts";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "8.6.0",
3
+ "version": "8.7.0",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",