appium-webdriveragent 8.7.12 → 8.8.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,9 @@
1
+ ## [8.8.0](https://github.com/appium/WebDriverAgent/compare/v8.7.12...v8.8.0) (2024-08-06)
2
+
3
+ ### Features
4
+
5
+ * Open the default URL in Safari upon session startup ([#929](https://github.com/appium/WebDriverAgent/issues/929)) ([97cf91d](https://github.com/appium/WebDriverAgent/commit/97cf91de34dc53e5f75f91829dc43224101c1b45))
6
+
1
7
  ## [8.7.12](https://github.com/appium/WebDriverAgent/compare/v8.7.11...v8.7.12) (2024-08-02)
2
8
 
3
9
  ### Miscellaneous Chores
@@ -421,6 +421,10 @@
421
421
  7182276E258744C900661B83 /* HTTPErrorResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = E444DC59249131880060D7EB /* HTTPErrorResponse.h */; };
422
422
  71822777258744CE00661B83 /* DDNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = E444DC7D249131B00060D7EB /* DDNumber.h */; };
423
423
  71822780258744D000661B83 /* DDRange.h in Headers */ = {isa = PBXBuildFile; fileRef = E444DC7B249131B00060D7EB /* DDRange.h */; };
424
+ 718D2C122C60BAE3000788F2 /* FBWebServerParams.m in Sources */ = {isa = PBXBuildFile; fileRef = 718D2C112C60BAE3000788F2 /* FBWebServerParams.m */; };
425
+ 718D2C132C60BAE3000788F2 /* FBWebServerParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 718D2C102C60BAE3000788F2 /* FBWebServerParams.h */; };
426
+ 718D2C142C60BAE3000788F2 /* FBWebServerParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 718D2C102C60BAE3000788F2 /* FBWebServerParams.h */; };
427
+ 718D2C152C60BAE3000788F2 /* FBWebServerParams.m in Sources */ = {isa = PBXBuildFile; fileRef = 718D2C112C60BAE3000788F2 /* FBWebServerParams.m */; };
424
428
  718F49C8230844330045FE8B /* FBProtocolHelpersTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 718F49C7230844330045FE8B /* FBProtocolHelpersTests.m */; };
425
429
  718F49C923087ACF0045FE8B /* FBProtocolHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B155DD23080CA600646AFB /* FBProtocolHelpers.h */; };
426
430
  718F49CA23087AD30045FE8B /* FBProtocolHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B155DE23080CA600646AFB /* FBProtocolHelpers.m */; };
@@ -1027,6 +1031,8 @@
1027
1031
  718226C72587443600661B83 /* GCDAsyncSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GCDAsyncSocket.h; path = WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.h; sourceTree = SOURCE_ROOT; };
1028
1032
  718226C82587443600661B83 /* GCDAsyncSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GCDAsyncSocket.m; path = WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m; sourceTree = SOURCE_ROOT; };
1029
1033
  718226C92587443600661B83 /* GCDAsyncUdpSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GCDAsyncUdpSocket.m; path = WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncUdpSocket.m; sourceTree = SOURCE_ROOT; };
1034
+ 718D2C102C60BAE3000788F2 /* FBWebServerParams.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBWebServerParams.h; sourceTree = "<group>"; };
1035
+ 718D2C112C60BAE3000788F2 /* FBWebServerParams.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBWebServerParams.m; sourceTree = "<group>"; };
1030
1036
  718F49C7230844330045FE8B /* FBProtocolHelpersTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBProtocolHelpersTests.m; sourceTree = "<group>"; };
1031
1037
  71930C4020662E1F00D3AFEC /* FBPasteboard.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBPasteboard.h; sourceTree = "<group>"; };
1032
1038
  71930C4120662E1F00D3AFEC /* FBPasteboard.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBPasteboard.m; sourceTree = "<group>"; };
@@ -1948,6 +1954,8 @@
1948
1954
  7140974A1FAE1B51008FB2C5 /* FBW3CActionsSynthesizer.m */,
1949
1955
  713AE573243A53BE0000D657 /* FBW3CActionsHelpers.h */,
1950
1956
  713AE574243A53BE0000D657 /* FBW3CActionsHelpers.m */,
1957
+ 718D2C102C60BAE3000788F2 /* FBWebServerParams.h */,
1958
+ 718D2C112C60BAE3000788F2 /* FBWebServerParams.m */,
1951
1959
  7157B28F221DADD2001C348C /* FBXCAXClientProxy.h */,
1952
1960
  7157B290221DADD2001C348C /* FBXCAXClientProxy.m */,
1953
1961
  EE5A24401F136C8D0078B1D9 /* FBXCodeCompatibility.h */,
@@ -2463,6 +2471,7 @@
2463
2471
  641EE6D62240C5CA00173FCB /* FBLogger.h in Headers */,
2464
2472
  71BB58F72B96531900CB9BFE /* FBScreenRecordingContainer.h in Headers */,
2465
2473
  641EE6D72240C5CA00173FCB /* XCTestObserver.h in Headers */,
2474
+ 718D2C142C60BAE3000788F2 /* FBWebServerParams.h in Headers */,
2466
2475
  641EE6D82240C5CA00173FCB /* XCUIElement.h in Headers */,
2467
2476
  641EE6D92240C5CA00173FCB /* XCKeyboardInputSolver.h in Headers */,
2468
2477
  718226CB2587443700661B83 /* GCDAsyncUdpSocket.h in Headers */,
@@ -2718,6 +2727,7 @@
2718
2727
  EE35AD311E3B77D600A02D78 /* XCKeyboardLayout.h in Headers */,
2719
2728
  716C9DFA27315D21005AD475 /* FBReflectionUtils.h in Headers */,
2720
2729
  E444DCB624913C220060D7EB /* RouteRequest.h in Headers */,
2730
+ 718D2C132C60BAE3000788F2 /* FBWebServerParams.h in Headers */,
2721
2731
  71F5BE23252E576C00EE9EBA /* XCUIElement+FBSwiping.h in Headers */,
2722
2732
  718226CC2587443700661B83 /* GCDAsyncSocket.h in Headers */,
2723
2733
  EE35AD3B1E3B77D600A02D78 /* XCTAsyncActivity-Protocol.h in Headers */,
@@ -3093,6 +3103,7 @@
3093
3103
  641EE5D72240C5CA00173FCB /* FBScreenshotCommands.m in Sources */,
3094
3104
  71F3E7D725417FF400E0C22B /* FBSettings.m in Sources */,
3095
3105
  641EE5D92240C5CA00173FCB /* XCUIElement+FBPickerWheel.m in Sources */,
3106
+ 718D2C152C60BAE3000788F2 /* FBWebServerParams.m in Sources */,
3096
3107
  641EE5DA2240C5CA00173FCB /* XCUIApplicationProcessDelay.m in Sources */,
3097
3108
  641EE5DB2240C5CA00173FCB /* FBXPath.m in Sources */,
3098
3109
  71C8E55425399A6B008572C1 /* XCUIApplication+FBQuiescence.m in Sources */,
@@ -3282,6 +3293,7 @@
3282
3293
  AD76723E1D6B7CC000610457 /* XCUIElement+FBTyping.m in Sources */,
3283
3294
  EE158AAF1CBD456F00A3E3F0 /* XCUIElement+FBAccessibility.m in Sources */,
3284
3295
  714E14BA29805CAE00375DD7 /* XCAXClient_iOS+FBSnapshotReqParams.m in Sources */,
3296
+ 718D2C122C60BAE3000788F2 /* FBWebServerParams.m in Sources */,
3285
3297
  7150348821A6DAD600A0F4BA /* FBImageUtils.m in Sources */,
3286
3298
  E444DCAB24913C220060D7EB /* HTTPResponseProxy.m in Sources */,
3287
3299
  E444DC6D249131890060D7EB /* HTTPErrorResponse.m in Sources */,
@@ -20,6 +20,7 @@
20
20
  #import "FBRuntimeUtils.h"
21
21
  #import "FBActiveAppDetectionPoint.h"
22
22
  #import "FBXCodeCompatibility.h"
23
+ #import "FBWebServerParams.h"
23
24
  #import "XCUIApplication+FBHelpers.h"
24
25
  #import "XCUIApplication+FBQuiescence.h"
25
26
  #import "XCUIDevice.h"
@@ -176,6 +177,18 @@
176
177
  _XCTSetApplicationStateTimeout(defaultTimeout);
177
178
  }
178
179
  }
180
+ if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"17.0") && [bundleID isEqualToString:FB_SAFARI_BUNDLE_ID]) {
181
+ // Opening the default URL in Safari instead of an empty page helps
182
+ // the remote debugger to avoid issues while looking for active web views
183
+ FBWebServerParams *wsParams = FBWebServerParams.sharedInstance;
184
+ NSString *healthEndpoint = [NSString stringWithFormat:@"http://127.0.0.1:%@/health", wsParams.port];
185
+ id<FBResponsePayload> errorResponse = [self openDeepLink:healthEndpoint
186
+ withApplication:bundleID
187
+ timeout:capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC]];
188
+ if (nil != errorResponse) {
189
+ NSLog(@"Was not able to open the default URL %@ in Safari", healthEndpoint);
190
+ }
191
+ }
179
192
  }
180
193
  if (!app.running) {
181
194
  NSString *errorMsg = [NSString stringWithFormat:@"Cannot launch %@ application. Make sure the correct bundle identifier has been provided in capabilities and check the device log for possible crash report occurrences", bundleID];
@@ -15,11 +15,11 @@
15
15
  <key>CFBundlePackageType</key>
16
16
  <string>FMWK</string>
17
17
  <key>CFBundleShortVersionString</key>
18
- <string>8.7.12</string>
18
+ <string>8.8.0</string>
19
19
  <key>CFBundleSignature</key>
20
20
  <string>????</string>
21
21
  <key>CFBundleVersion</key>
22
- <string>8.7.12</string>
22
+ <string>8.8.0</string>
23
23
  <key>NSPrincipalClass</key>
24
24
  <string/>
25
25
  </dict>
@@ -14,6 +14,9 @@
14
14
 
15
15
  NS_ASSUME_NONNULL_BEGIN
16
16
 
17
+ /** Bundle identifier of Mobile Safari browser */
18
+ extern NSString* const FB_SAFARI_BUNDLE_ID;
19
+
17
20
  /**
18
21
  Class that represents testing session
19
22
  */
@@ -33,6 +33,8 @@
33
33
  */
34
34
  NSString *const FBDefaultApplicationAuto = @"auto";
35
35
 
36
+ NSString *const FB_SAFARI_BUNDLE_ID = @"com.apple.mobilesafari";
37
+
36
38
  @interface FBSession ()
37
39
  @property (nullable, nonatomic) XCUIApplication *testedApplication;
38
40
  @property (nonatomic) BOOL isTestedApplicationExpectedToRun;
@@ -23,6 +23,7 @@
23
23
  #import "FBUnknownCommands.h"
24
24
  #import "FBConfiguration.h"
25
25
  #import "FBLogger.h"
26
+ #import "FBWebServerParams.h"
26
27
 
27
28
  #import "XCUIDevice+FBHelpers.h"
28
29
 
@@ -102,6 +103,8 @@ static NSString *const FBServerURLEndMarker = @"<-ServerURLHere";
102
103
 
103
104
  serverStarted = [self attemptToStartServer:self.server onPort:port withError:&error];
104
105
  if (serverStarted) {
106
+ FBWebServerParams* wsParams = FBWebServerParams.sharedInstance;
107
+ wsParams.port = @(self.server.port);
105
108
  break;
106
109
  }
107
110
 
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ */
9
+
10
+ #import <Foundation/Foundation.h>
11
+
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ @interface FBWebServerParams : NSObject
15
+
16
+ /** The local port number WDA server is running on */
17
+ @property (nonatomic, nullable) NSNumber *port;
18
+
19
+ + (id)sharedInstance;
20
+
21
+ @end
22
+
23
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ */
9
+
10
+ #import "FBWebServerParams.h"
11
+
12
+ @implementation FBWebServerParams
13
+
14
+ + (instancetype)sharedInstance
15
+ {
16
+ static FBWebServerParams *instance;
17
+ static dispatch_once_t onceToken;
18
+ dispatch_once(&onceToken, ^{
19
+ instance = [[self alloc] init];
20
+ });
21
+ return instance;
22
+ }
23
+
24
+ @end
@@ -25,15 +25,13 @@
25
25
  @end
26
26
 
27
27
 
28
- static NSString *const SAFARI_BUNDLE_ID = @"com.apple.mobilesafari";
29
-
30
28
  @implementation FBSafariAlertIntegrationTests
31
29
 
32
30
  - (void)setUp
33
31
  {
34
32
  [super setUp];
35
33
  self.session = [FBSession initWithApplication:XCUIApplication.fb_activeApplication];
36
- [self.session launchApplicationWithBundleId:SAFARI_BUNDLE_ID
34
+ [self.session launchApplicationWithBundleId:FB_SAFARI_BUNDLE_ID
37
35
  shouldWaitForQuiescence:nil
38
36
  arguments:nil
39
37
  environment:nil];
@@ -42,7 +40,7 @@ static NSString *const SAFARI_BUNDLE_ID = @"com.apple.mobilesafari";
42
40
 
43
41
  - (void)tearDown
44
42
  {
45
- [self.session terminateApplicationWithBundleId:SAFARI_BUNDLE_ID];
43
+ [self.session terminateApplicationWithBundleId:FB_SAFARI_BUNDLE_ID];
46
44
  }
47
45
 
48
46
  - (void)disabled_testCanHandleSafariInputPrompt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "8.7.12",
3
+ "version": "8.8.0",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",