appium-webdriveragent 8.8.0 → 8.9.1
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 +16 -0
- package/PrivateHeaders/XCTest/XCUIApplicationProcess.h +4 -0
- package/WebDriverAgent.xcodeproj/project.pbxproj +0 -12
- package/WebDriverAgentLib/Categories/XCAXClient_iOS+FBSnapshotReqParams.m +1 -0
- package/WebDriverAgentLib/Categories/XCTIssue+FBPatcher.m +3 -0
- package/WebDriverAgentLib/Categories/XCUIApplicationProcess+FBQuiescence.h +5 -0
- package/WebDriverAgentLib/Categories/XCUIApplicationProcess+FBQuiescence.m +42 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBUID.m +1 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +2 -1
- package/WebDriverAgentLib/Commands/FBSessionCommands.m +5 -13
- package/WebDriverAgentLib/Info.plist +2 -2
- package/WebDriverAgentLib/Routing/FBExceptions.h +3 -0
- package/WebDriverAgentLib/Routing/FBExceptions.m +1 -0
- package/WebDriverAgentLib/Routing/FBRoute.m +3 -0
- package/WebDriverAgentLib/Routing/FBWebServer.m +0 -3
- package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.m +3 -0
- package/WebDriverAgentLib/Utilities/XCUIApplicationProcessDelay.m +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [8.9.1](https://github.com/appium/WebDriverAgent/compare/v8.9.0...v8.9.1) (2024-08-09)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* Update swizzling of waitForQuiescenceIncludingAnimationsIdle: API for Xcode16-beta5 ([#935](https://github.com/appium/WebDriverAgent/issues/935)) ([2ccc436](https://github.com/appium/WebDriverAgent/commit/2ccc436991ca880a1dfdec688dc8167008fe382d))
|
|
6
|
+
|
|
7
|
+
## [8.9.0](https://github.com/appium/WebDriverAgent/compare/v8.8.0...v8.9.0) (2024-08-07)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add idleTimeoutMs param to the openUrl call ([#933](https://github.com/appium/WebDriverAgent/issues/933)) ([5e98841](https://github.com/appium/WebDriverAgent/commit/5e98841f56eda6454d67d813b921bfcf98f1ff78))
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* Revert the logic to open the default URL in Safari via deeplink ([#932](https://github.com/appium/WebDriverAgent/issues/932)) ([7c51145](https://github.com/appium/WebDriverAgent/commit/7c5114518509c9a399845283eca7708248fb838f))
|
|
16
|
+
|
|
1
17
|
## [8.8.0](https://github.com/appium/WebDriverAgent/compare/v8.7.12...v8.8.0) (2024-08-06)
|
|
2
18
|
|
|
3
19
|
### Features
|
|
@@ -65,7 +65,11 @@
|
|
|
65
65
|
- (void)terminate;
|
|
66
66
|
- (void)waitForViewControllerViewDidDisappearWithTimeout:(double)arg1;
|
|
67
67
|
- (void)waitForAutomationSession;
|
|
68
|
+
// Before Xcode16-beta5
|
|
68
69
|
- (void)waitForQuiescenceIncludingAnimationsIdle:(BOOL)arg1;
|
|
70
|
+
// Since Xcode16-beta5
|
|
71
|
+
- (void)waitForQuiescenceIncludingAnimationsIdle:(BOOL)arg1 isPreEvent:(BOOL)arg2;
|
|
72
|
+
|
|
69
73
|
|
|
70
74
|
- (id)shortDescription;
|
|
71
75
|
- (id)_queue_description;
|
|
@@ -421,10 +421,6 @@
|
|
|
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 */; };
|
|
428
424
|
718F49C8230844330045FE8B /* FBProtocolHelpersTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 718F49C7230844330045FE8B /* FBProtocolHelpersTests.m */; };
|
|
429
425
|
718F49C923087ACF0045FE8B /* FBProtocolHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B155DD23080CA600646AFB /* FBProtocolHelpers.h */; };
|
|
430
426
|
718F49CA23087AD30045FE8B /* FBProtocolHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B155DE23080CA600646AFB /* FBProtocolHelpers.m */; };
|
|
@@ -1031,8 +1027,6 @@
|
|
|
1031
1027
|
718226C72587443600661B83 /* GCDAsyncSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GCDAsyncSocket.h; path = WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.h; sourceTree = SOURCE_ROOT; };
|
|
1032
1028
|
718226C82587443600661B83 /* GCDAsyncSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GCDAsyncSocket.m; path = WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m; sourceTree = SOURCE_ROOT; };
|
|
1033
1029
|
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>"; };
|
|
1036
1030
|
718F49C7230844330045FE8B /* FBProtocolHelpersTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBProtocolHelpersTests.m; sourceTree = "<group>"; };
|
|
1037
1031
|
71930C4020662E1F00D3AFEC /* FBPasteboard.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBPasteboard.h; sourceTree = "<group>"; };
|
|
1038
1032
|
71930C4120662E1F00D3AFEC /* FBPasteboard.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBPasteboard.m; sourceTree = "<group>"; };
|
|
@@ -1954,8 +1948,6 @@
|
|
|
1954
1948
|
7140974A1FAE1B51008FB2C5 /* FBW3CActionsSynthesizer.m */,
|
|
1955
1949
|
713AE573243A53BE0000D657 /* FBW3CActionsHelpers.h */,
|
|
1956
1950
|
713AE574243A53BE0000D657 /* FBW3CActionsHelpers.m */,
|
|
1957
|
-
718D2C102C60BAE3000788F2 /* FBWebServerParams.h */,
|
|
1958
|
-
718D2C112C60BAE3000788F2 /* FBWebServerParams.m */,
|
|
1959
1951
|
7157B28F221DADD2001C348C /* FBXCAXClientProxy.h */,
|
|
1960
1952
|
7157B290221DADD2001C348C /* FBXCAXClientProxy.m */,
|
|
1961
1953
|
EE5A24401F136C8D0078B1D9 /* FBXCodeCompatibility.h */,
|
|
@@ -2471,7 +2463,6 @@
|
|
|
2471
2463
|
641EE6D62240C5CA00173FCB /* FBLogger.h in Headers */,
|
|
2472
2464
|
71BB58F72B96531900CB9BFE /* FBScreenRecordingContainer.h in Headers */,
|
|
2473
2465
|
641EE6D72240C5CA00173FCB /* XCTestObserver.h in Headers */,
|
|
2474
|
-
718D2C142C60BAE3000788F2 /* FBWebServerParams.h in Headers */,
|
|
2475
2466
|
641EE6D82240C5CA00173FCB /* XCUIElement.h in Headers */,
|
|
2476
2467
|
641EE6D92240C5CA00173FCB /* XCKeyboardInputSolver.h in Headers */,
|
|
2477
2468
|
718226CB2587443700661B83 /* GCDAsyncUdpSocket.h in Headers */,
|
|
@@ -2727,7 +2718,6 @@
|
|
|
2727
2718
|
EE35AD311E3B77D600A02D78 /* XCKeyboardLayout.h in Headers */,
|
|
2728
2719
|
716C9DFA27315D21005AD475 /* FBReflectionUtils.h in Headers */,
|
|
2729
2720
|
E444DCB624913C220060D7EB /* RouteRequest.h in Headers */,
|
|
2730
|
-
718D2C132C60BAE3000788F2 /* FBWebServerParams.h in Headers */,
|
|
2731
2721
|
71F5BE23252E576C00EE9EBA /* XCUIElement+FBSwiping.h in Headers */,
|
|
2732
2722
|
718226CC2587443700661B83 /* GCDAsyncSocket.h in Headers */,
|
|
2733
2723
|
EE35AD3B1E3B77D600A02D78 /* XCTAsyncActivity-Protocol.h in Headers */,
|
|
@@ -3103,7 +3093,6 @@
|
|
|
3103
3093
|
641EE5D72240C5CA00173FCB /* FBScreenshotCommands.m in Sources */,
|
|
3104
3094
|
71F3E7D725417FF400E0C22B /* FBSettings.m in Sources */,
|
|
3105
3095
|
641EE5D92240C5CA00173FCB /* XCUIElement+FBPickerWheel.m in Sources */,
|
|
3106
|
-
718D2C152C60BAE3000788F2 /* FBWebServerParams.m in Sources */,
|
|
3107
3096
|
641EE5DA2240C5CA00173FCB /* XCUIApplicationProcessDelay.m in Sources */,
|
|
3108
3097
|
641EE5DB2240C5CA00173FCB /* FBXPath.m in Sources */,
|
|
3109
3098
|
71C8E55425399A6B008572C1 /* XCUIApplication+FBQuiescence.m in Sources */,
|
|
@@ -3293,7 +3282,6 @@
|
|
|
3293
3282
|
AD76723E1D6B7CC000610457 /* XCUIElement+FBTyping.m in Sources */,
|
|
3294
3283
|
EE158AAF1CBD456F00A3E3F0 /* XCUIElement+FBAccessibility.m in Sources */,
|
|
3295
3284
|
714E14BA29805CAE00375DD7 /* XCAXClient_iOS+FBSnapshotReqParams.m in Sources */,
|
|
3296
|
-
718D2C122C60BAE3000788F2 /* FBWebServerParams.m in Sources */,
|
|
3297
3285
|
7150348821A6DAD600A0F4BA /* FBImageUtils.m in Sources */,
|
|
3298
3286
|
E444DCAB24913C220060D7EB /* HTTPResponseProxy.m in Sources */,
|
|
3299
3287
|
E444DC6D249131890060D7EB /* HTTPErrorResponse.m in Sources */,
|
|
@@ -20,6 +20,8 @@ static _Bool swizzledShouldInterruptTest(id self, SEL _cmd)
|
|
|
20
20
|
|
|
21
21
|
#pragma clang diagnostic push
|
|
22
22
|
#pragma clang diagnostic ignored "-Wobjc-load-method"
|
|
23
|
+
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
|
|
24
|
+
|
|
23
25
|
+ (void)load
|
|
24
26
|
{
|
|
25
27
|
SEL originalShouldInterruptTest = NSSelectorFromString(@"shouldInterruptTest");
|
|
@@ -28,6 +30,7 @@ static _Bool swizzledShouldInterruptTest(id self, SEL _cmd)
|
|
|
28
30
|
if (nil == originalShouldInterruptTestMethod) return;
|
|
29
31
|
method_setImplementation(originalShouldInterruptTestMethod, (IMP)swizzledShouldInterruptTest);
|
|
30
32
|
}
|
|
33
|
+
|
|
31
34
|
#pragma clang diagnostic pop
|
|
32
35
|
|
|
33
36
|
@end
|
|
@@ -18,6 +18,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
18
18
|
/*! Defines wtether the process should perform quiescence checks. YES by default */
|
|
19
19
|
@property (nonatomic) NSNumber* fb_shouldWaitForQuiescence;
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
@param waitForAnimations Set it to YES if XCTest should also wait for application animations to complete
|
|
23
|
+
*/
|
|
24
|
+
- (void)fb_waitForQuiescenceIncludingAnimationsIdle:(bool)waitForAnimations;
|
|
25
|
+
|
|
21
26
|
@end
|
|
22
27
|
|
|
23
28
|
NS_ASSUME_NONNULL_END
|
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
#import <objc/runtime.h>
|
|
13
13
|
|
|
14
14
|
#import "FBConfiguration.h"
|
|
15
|
+
#import "FBExceptions.h"
|
|
15
16
|
#import "FBLogger.h"
|
|
16
17
|
#import "FBSettings.h"
|
|
17
18
|
|
|
18
19
|
static void (*original_waitForQuiescenceIncludingAnimationsIdle)(id, SEL, BOOL);
|
|
20
|
+
static void (*original_waitForQuiescenceIncludingAnimationsIdlePreEvent)(id, SEL, BOOL, BOOL);
|
|
19
21
|
|
|
20
22
|
static void swizzledWaitForQuiescenceIncludingAnimationsIdle(id self, SEL _cmd, BOOL includingAnimations)
|
|
21
23
|
{
|
|
@@ -38,17 +40,43 @@ static void swizzledWaitForQuiescenceIncludingAnimationsIdle(id self, SEL _cmd,
|
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
|
|
43
|
+
static void swizzledWaitForQuiescenceIncludingAnimationsIdlePreEvent(id self, SEL _cmd, BOOL includingAnimations, BOOL isPreEvent)
|
|
44
|
+
{
|
|
45
|
+
NSString *bundleId = [self bundleID];
|
|
46
|
+
if (![[self fb_shouldWaitForQuiescence] boolValue] || FBConfiguration.waitForIdleTimeout < DBL_EPSILON) {
|
|
47
|
+
[FBLogger logFmt:@"Quiescence checks are disabled for %@ application. Making it to believe it is idling",
|
|
48
|
+
bundleId];
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
NSTimeInterval desiredTimeout = FBConfiguration.waitForIdleTimeout;
|
|
53
|
+
NSTimeInterval previousTimeout = _XCTApplicationStateTimeout();
|
|
54
|
+
_XCTSetApplicationStateTimeout(desiredTimeout);
|
|
55
|
+
[FBLogger logFmt:@"Waiting up to %@s until %@ is in idle state (%@ animations)",
|
|
56
|
+
@(desiredTimeout), bundleId, includingAnimations ? @"including" : @"excluding"];
|
|
57
|
+
@try {
|
|
58
|
+
original_waitForQuiescenceIncludingAnimationsIdlePreEvent(self, _cmd, includingAnimations, isPreEvent);
|
|
59
|
+
} @finally {
|
|
60
|
+
_XCTSetApplicationStateTimeout(previousTimeout);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
41
64
|
@implementation XCUIApplicationProcess (FBQuiescence)
|
|
42
65
|
|
|
43
66
|
#pragma clang diagnostic push
|
|
44
67
|
#pragma clang diagnostic ignored "-Wobjc-load-method"
|
|
68
|
+
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
|
|
45
69
|
|
|
46
70
|
+ (void)load
|
|
47
71
|
{
|
|
48
72
|
Method waitForQuiescenceIncludingAnimationsIdleMethod = class_getInstanceMethod(self.class, @selector(waitForQuiescenceIncludingAnimationsIdle:));
|
|
73
|
+
Method waitForQuiescenceIncludingAnimationsIdlePreEventMethod = class_getInstanceMethod(self.class, @selector(waitForQuiescenceIncludingAnimationsIdle:isPreEvent:));
|
|
49
74
|
if (nil != waitForQuiescenceIncludingAnimationsIdleMethod) {
|
|
50
75
|
IMP swizzledImp = (IMP)swizzledWaitForQuiescenceIncludingAnimationsIdle;
|
|
51
76
|
original_waitForQuiescenceIncludingAnimationsIdle = (void (*)(id, SEL, BOOL)) method_setImplementation(waitForQuiescenceIncludingAnimationsIdleMethod, swizzledImp);
|
|
77
|
+
} else if (nil != waitForQuiescenceIncludingAnimationsIdlePreEventMethod) {
|
|
78
|
+
IMP swizzledImp = (IMP)swizzledWaitForQuiescenceIncludingAnimationsIdlePreEvent;
|
|
79
|
+
original_waitForQuiescenceIncludingAnimationsIdlePreEvent = (void (*)(id, SEL, BOOL, BOOL)) method_setImplementation(waitForQuiescenceIncludingAnimationsIdlePreEventMethod, swizzledImp);
|
|
52
80
|
} else {
|
|
53
81
|
[FBLogger log:@"Could not find method -[XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle:]"];
|
|
54
82
|
}
|
|
@@ -74,4 +102,18 @@ static char XCUIAPPLICATIONPROCESS_SHOULD_WAIT_FOR_QUIESCENCE;
|
|
|
74
102
|
objc_setAssociatedObject(self, &XCUIAPPLICATIONPROCESS_SHOULD_WAIT_FOR_QUIESCENCE, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
75
103
|
}
|
|
76
104
|
|
|
105
|
+
- (void)fb_waitForQuiescenceIncludingAnimationsIdle:(bool)waitForAnimations
|
|
106
|
+
{
|
|
107
|
+
if ([self respondsToSelector:@selector(waitForQuiescenceIncludingAnimationsIdle:)]) {
|
|
108
|
+
[self waitForQuiescenceIncludingAnimationsIdle:waitForAnimations];
|
|
109
|
+
} else if ([self respondsToSelector:@selector(waitForQuiescenceIncludingAnimationsIdle:isPreEvent:)]) {
|
|
110
|
+
[self waitForQuiescenceIncludingAnimationsIdle:waitForAnimations isPreEvent:NO];
|
|
111
|
+
} else {
|
|
112
|
+
@throw [NSException exceptionWithName:FBIncompatibleWdaException
|
|
113
|
+
reason:@"The current WebDriverAgent build is not compatible to your device OS version"
|
|
114
|
+
userInfo:@{}];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
77
119
|
@end
|
|
@@ -42,6 +42,7 @@ static void swizzled_validatePredicateWithExpressionsAllowed(id self, SEL _cmd,
|
|
|
42
42
|
|
|
43
43
|
#pragma clang diagnostic push
|
|
44
44
|
#pragma clang diagnostic ignored "-Wobjc-load-method"
|
|
45
|
+
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
|
|
45
46
|
+ (void)load
|
|
46
47
|
{
|
|
47
48
|
Class XCElementSnapshotCls = objc_lookUpClass("XCElementSnapshot");
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
#import "XCTElementSetTransformer-Protocol.h"
|
|
32
32
|
#import "XCTestPrivateSymbols.h"
|
|
33
33
|
#import "XCTRunnerDaemonSession.h"
|
|
34
|
+
#import "XCUIApplicationProcess+FBQuiescence.h"
|
|
34
35
|
#import "XCUIElement+FBCaching.h"
|
|
35
36
|
#import "XCUIElement+FBWebDriverAttributes.h"
|
|
36
37
|
#import "XCUIElementQuery.h"
|
|
@@ -190,7 +191,7 @@
|
|
|
190
191
|
self.application.fb_shouldWaitForQuiescence = YES;
|
|
191
192
|
}
|
|
192
193
|
[[[self.application applicationImpl] currentProcess]
|
|
193
|
-
|
|
194
|
+
fb_waitForQuiescenceIncludingAnimationsIdle:YES];
|
|
194
195
|
if (previousQuiescence != self.application.fb_shouldWaitForQuiescence) {
|
|
195
196
|
self.application.fb_shouldWaitForQuiescence = previousQuiescence;
|
|
196
197
|
}
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
#import "FBRuntimeUtils.h"
|
|
21
21
|
#import "FBActiveAppDetectionPoint.h"
|
|
22
22
|
#import "FBXCodeCompatibility.h"
|
|
23
|
-
#import "FBWebServerParams.h"
|
|
24
23
|
#import "XCUIApplication+FBHelpers.h"
|
|
25
24
|
#import "XCUIApplication+FBQuiescence.h"
|
|
26
25
|
#import "XCUIDevice.h"
|
|
@@ -67,6 +66,7 @@
|
|
|
67
66
|
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:@"URL is required" traceback:nil]);
|
|
68
67
|
}
|
|
69
68
|
NSString* bundleId = request.arguments[@"bundleId"];
|
|
69
|
+
NSNumber* idleTimeoutMs = request.arguments[@"idleTimeoutMs"];
|
|
70
70
|
NSError *error;
|
|
71
71
|
if (nil == bundleId) {
|
|
72
72
|
if (![XCUIDevice.sharedDevice fb_openUrl:urlString error:&error]) {
|
|
@@ -76,6 +76,10 @@
|
|
|
76
76
|
if (![XCUIDevice.sharedDevice fb_openUrl:urlString withApplication:bundleId error:&error]) {
|
|
77
77
|
return FBResponseWithUnknownError(error);
|
|
78
78
|
}
|
|
79
|
+
if (idleTimeoutMs.doubleValue > 0) {
|
|
80
|
+
XCUIApplication *app = [[XCUIApplication alloc] initWithBundleIdentifier:bundleId];
|
|
81
|
+
[app fb_waitUntilStableWithTimeout:FBMillisToSeconds(idleTimeoutMs.doubleValue)];
|
|
82
|
+
}
|
|
79
83
|
}
|
|
80
84
|
return FBResponseWithOK();
|
|
81
85
|
}
|
|
@@ -177,18 +181,6 @@
|
|
|
177
181
|
_XCTSetApplicationStateTimeout(defaultTimeout);
|
|
178
182
|
}
|
|
179
183
|
}
|
|
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
|
-
}
|
|
192
184
|
}
|
|
193
185
|
if (!app.running) {
|
|
194
186
|
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.
|
|
18
|
+
<string>8.9.1</string>
|
|
19
19
|
<key>CFBundleSignature</key>
|
|
20
20
|
<string>????</string>
|
|
21
21
|
<key>CFBundleVersion</key>
|
|
22
|
-
<string>8.
|
|
22
|
+
<string>8.9.1</string>
|
|
23
23
|
<key>NSPrincipalClass</key>
|
|
24
24
|
<string/>
|
|
25
25
|
</dict>
|
|
@@ -55,4 +55,7 @@ extern NSString *const FBApplicationCrashedException;
|
|
|
55
55
|
/*! Exception used to notify about the application is not installed */
|
|
56
56
|
extern NSString *const FBApplicationMissingException;
|
|
57
57
|
|
|
58
|
+
/*! Exception used to notify about WDA incompatibility with the current platform version */
|
|
59
|
+
extern NSString *const FBIncompatibleWdaException;
|
|
60
|
+
|
|
58
61
|
NS_ASSUME_NONNULL_END
|
|
@@ -22,3 +22,4 @@ NSString *const FBXPathQueryEvaluationException = @"FBXPathQueryEvaluationExcept
|
|
|
22
22
|
NSString *const FBClassChainQueryParseException = @"FBClassChainQueryParseException";
|
|
23
23
|
NSString *const FBApplicationCrashedException = @"FBApplicationCrashedException";
|
|
24
24
|
NSString *const FBApplicationMissingException = @"FBApplicationMissingException";
|
|
25
|
+
NSString *const FBIncompatibleWdaException = @"FBIncompatibleWdaException";
|
|
@@ -39,7 +39,10 @@ static NSString *const FBRouteSessionPrefix = @"/session/:sessionID";
|
|
|
39
39
|
- (void)mountRequest:(FBRouteRequest *)request intoResponse:(RouteResponse *)response
|
|
40
40
|
{
|
|
41
41
|
[self decorateRequest:request];
|
|
42
|
+
#pragma clang diagnostic push
|
|
43
|
+
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
|
|
42
44
|
id<FBResponsePayload> (*requestMsgSend)(id, SEL, FBRouteRequest *) = ((id<FBResponsePayload>(*)(id, SEL, FBRouteRequest *))objc_msgSend);
|
|
45
|
+
#pragma clang diagnostic pop
|
|
43
46
|
id<FBResponsePayload> payload = requestMsgSend(self.target, self.action, request);
|
|
44
47
|
[payload dispatchWithResponse:response];
|
|
45
48
|
}
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
#import "FBUnknownCommands.h"
|
|
24
24
|
#import "FBConfiguration.h"
|
|
25
25
|
#import "FBLogger.h"
|
|
26
|
-
#import "FBWebServerParams.h"
|
|
27
26
|
|
|
28
27
|
#import "XCUIDevice+FBHelpers.h"
|
|
29
28
|
|
|
@@ -103,8 +102,6 @@ static NSString *const FBServerURLEndMarker = @"<-ServerURLHere";
|
|
|
103
102
|
|
|
104
103
|
serverStarted = [self attemptToStartServer:self.server onPort:port withError:&error];
|
|
105
104
|
if (serverStarted) {
|
|
106
|
-
FBWebServerParams* wsParams = FBWebServerParams.sharedInstance;
|
|
107
|
-
wsParams.port = @(self.server.port);
|
|
108
105
|
break;
|
|
109
106
|
}
|
|
110
107
|
|
|
@@ -73,9 +73,12 @@ static void swizzledLaunchApp(id self, SEL _cmd, NSString *path, NSString *bundl
|
|
|
73
73
|
[FBLogger log:@"Could not find method -[XCTRunnerDaemonSession launchApplicationWithPath:]"];
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
+
#pragma clang diagnostic push
|
|
77
|
+
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
|
|
76
78
|
// Workaround for https://github.com/appium/WebDriverAgent/issues/702
|
|
77
79
|
originalLaunchAppMethod = (void(*)(id, SEL, NSString*, NSString*, NSArray*, NSDictionary*, void (^)(_Bool, NSError *))) method_getImplementation(original);
|
|
78
80
|
method_setImplementation(original, (IMP)swizzledLaunchApp);
|
|
81
|
+
#pragma clang diagnostic pop
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
+ (id<XCTestManager_ManagerInterface>)testRunnerProxy
|
|
@@ -61,7 +61,10 @@ static NSLock * lock = nil;
|
|
|
61
61
|
[FBLogger log:@"Could not find method -[XCUIApplicationProcess setEventLoopHasIdled:]"];
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
+
#pragma clang diagnostic push
|
|
65
|
+
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
|
|
64
66
|
orig_set_event_loop_has_idled = (void(*)(id, SEL, BOOL)) method_getImplementation(original);
|
|
67
|
+
#pragma clang diagnostic pop
|
|
65
68
|
Method replace = class_getClassMethod([XCUIApplicationProcessDelay class], @selector(setEventLoopHasIdled:));
|
|
66
69
|
method_setImplementation(original, method_getImplementation(replace));
|
|
67
70
|
isSwizzled = YES;
|