Skip to content

Commit 04e5bb6

Browse files
authored
Merge pull request #11 from VKCOM/malzhanov/migrate-to-esm
Migrate to ESM
2 parents a677de4 + 32a7d33 commit 04e5bb6

File tree

315 files changed

+24405
-25196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+24405
-25196
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/res/build/**
22
/res/app/components/stf/screen/fast-image-render/pixi.js
3+
WebDriverAgent

.eslintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"node": true
55
},
66
"parserOptions": {
7-
"ecmaVersion": 2020
7+
"ecmaVersion": 2020,
8+
"sourceType": "module"
89
},
910
"rules": {
1011
// Possible errors
@@ -103,7 +104,6 @@
103104
"key-spacing": [2, {"beforeColon": false, "afterColon": true, "mode": "strict"}], // optionally set `[2, {"beforeColon": false, "afterColon": true, "mode": "strict", "align": "colon"}]`
104105
"lines-around-comment": 2, // optionally set `[2, {"beforeBlockComment": true, "beforeLineComment": true, "allowBlockStart": true}]`
105106
"linebreak-style": 0, // optionally set `[1, "unix"]`
106-
"max-len": [2, 150, 2, {"ignoreComments": true, "ignoreUrls": true}], // NOTE: Our limit is 80 however ESLint does not have an ignoreStrings so lets have more buffer
107107
"max-nested-callbacks": [1, 5],
108108
"new-cap": 2, // optionally set `[2, {"capIsNewExceptions": ["Person"]}]`
109109
"new-parens": 2,

WebDriverAgent/CHANGELOG.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,79 @@
1+
## [8.9.2](https://github.com/appium/WebDriverAgent/compare/v8.9.1...v8.9.2) (2024-09-13)
2+
3+
### Miscellaneous Chores
4+
5+
* **deps-dev:** bump sinon from 18.0.1 to 19.0.1 ([#938](https://github.com/appium/WebDriverAgent/issues/938)) ([3ef0093](https://github.com/appium/WebDriverAgent/commit/3ef009317801dca47efe34bd048d3cab2e644ee2))
6+
7+
## [8.9.1](https://github.com/appium/WebDriverAgent/compare/v8.9.0...v8.9.1) (2024-08-09)
8+
9+
### Bug Fixes
10+
11+
* Update swizzling of waitForQuiescenceIncludingAnimationsIdle: API for Xcode16-beta5 ([#935](https://github.com/appium/WebDriverAgent/issues/935)) ([2ccc436](https://github.com/appium/WebDriverAgent/commit/2ccc436991ca880a1dfdec688dc8167008fe382d))
12+
13+
## [8.9.0](https://github.com/appium/WebDriverAgent/compare/v8.8.0...v8.9.0) (2024-08-07)
14+
15+
### Features
16+
17+
* Add idleTimeoutMs param to the openUrl call ([#933](https://github.com/appium/WebDriverAgent/issues/933)) ([5e98841](https://github.com/appium/WebDriverAgent/commit/5e98841f56eda6454d67d813b921bfcf98f1ff78))
18+
19+
### Bug Fixes
20+
21+
* 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))
22+
23+
## [8.8.0](https://github.com/appium/WebDriverAgent/compare/v8.7.12...v8.8.0) (2024-08-06)
24+
25+
### Features
26+
27+
* 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))
28+
29+
## [8.7.12](https://github.com/appium/WebDriverAgent/compare/v8.7.11...v8.7.12) (2024-08-02)
30+
31+
### Miscellaneous Chores
32+
33+
* Replace fancy-log dependency with appium logger ([#928](https://github.com/appium/WebDriverAgent/issues/928)) ([5d2ec24](https://github.com/appium/WebDriverAgent/commit/5d2ec249488655451e2d46384e560fee7e08e840))
34+
35+
## [8.7.11](https://github.com/appium/WebDriverAgent/compare/v8.7.10...v8.7.11) (2024-07-29)
36+
37+
### Bug Fixes
38+
39+
* Respond to /health with a proper HTML ([#925](https://github.com/appium/WebDriverAgent/issues/925)) ([42c519f](https://github.com/appium/WebDriverAgent/commit/42c519f9df7beec81175fd38af388975d6f6b800))
40+
41+
## [8.7.10](https://github.com/appium/WebDriverAgent/compare/v8.7.9...v8.7.10) (2024-07-29)
42+
43+
### Miscellaneous Chores
44+
45+
* **deps-dev:** bump @types/node from 20.14.13 to 22.0.0 ([#926](https://github.com/appium/WebDriverAgent/issues/926)) ([1699023](https://github.com/appium/WebDriverAgent/commit/1699023086a243c3d86ddae4da8342c6beda3f48))
46+
47+
## [8.7.9](https://github.com/appium/WebDriverAgent/compare/v8.7.8...v8.7.9) (2024-07-21)
48+
49+
### Miscellaneous Chores
50+
51+
* keep error handling for the future possible usage ([#921](https://github.com/appium/WebDriverAgent/issues/921)) ([2f90739](https://github.com/appium/WebDriverAgent/commit/2f90739340d70073b48c703b36b9a313d3618972))
52+
53+
## [8.7.8](https://github.com/appium/WebDriverAgent/compare/v8.7.7...v8.7.8) (2024-07-18)
54+
55+
### Bug Fixes
56+
57+
* do nothing for an empty array in w3c actions ([#919](https://github.com/appium/WebDriverAgent/issues/919)) ([9e70ec1](https://github.com/appium/WebDriverAgent/commit/9e70ec1dbec1d1844278a58297a5b956ebaeb7fc))
58+
59+
## [8.7.7](https://github.com/appium/WebDriverAgent/compare/v8.7.6...v8.7.7) (2024-07-18)
60+
61+
### Bug Fixes
62+
63+
* Pass-through modifier keys ([#918](https://github.com/appium/WebDriverAgent/issues/918)) ([29d0e5c](https://github.com/appium/WebDriverAgent/commit/29d0e5cb2a19809e1babb06e5adaa49b43c754a5))
64+
65+
## [8.7.6](https://github.com/appium/WebDriverAgent/compare/v8.7.5...v8.7.6) (2024-07-02)
66+
67+
### Miscellaneous Chores
68+
69+
* Simplify xcodebuild lines monitoring ([#916](https://github.com/appium/WebDriverAgent/issues/916)) ([87678f2](https://github.com/appium/WebDriverAgent/commit/87678f260c98b3a3bc3d37017e9ef39098ccb3c4))
70+
71+
## [8.7.5](https://github.com/appium/WebDriverAgent/compare/v8.7.4...v8.7.5) (2024-06-26)
72+
73+
### Bug Fixes
74+
75+
* Respect wdaRemotePort capability for real devices ([#915](https://github.com/appium/WebDriverAgent/issues/915)) ([03ea143](https://github.com/appium/WebDriverAgent/commit/03ea1439a9cc5b6495be60707bc474e3ae9bdb06))
76+
177
## [8.7.4](https://github.com/appium/WebDriverAgent/compare/v8.7.3...v8.7.4) (2024-06-20)
278

379
### Miscellaneous Chores

WebDriverAgent/PrivateHeaders/XCTest/XCUIApplicationProcess.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@
6565
- (void)terminate;
6666
- (void)waitForViewControllerViewDidDisappearWithTimeout:(double)arg1;
6767
- (void)waitForAutomationSession;
68+
// Before Xcode16-beta5
6869
- (void)waitForQuiescenceIncludingAnimationsIdle:(BOOL)arg1;
70+
// Since Xcode16-beta5
71+
- (void)waitForQuiescenceIncludingAnimationsIdle:(BOOL)arg1 isPreEvent:(BOOL)arg2;
72+
6973

7074
- (id)shortDescription;
7175
- (id)_queue_description;

WebDriverAgent/Scripts/update-wda-version.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
const {plist} = require('@appium/support');
1+
const {plist, logger} = require('@appium/support');
22
const path = require('node:path');
33
const semver = require('semver');
4-
const log = require('fancy-log');
4+
5+
const log = logger.getLogger('Versioner');
56

67
/**
78
* @param {string} argName

WebDriverAgent/WebDriverAgent.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4200,6 +4200,7 @@
42004200
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
42014201
CLANG_ANALYZER_NONNULL = YES;
42024202
DEBUG_INFORMATION_FORMAT = dwarf;
4203+
DEVELOPMENT_TEAM = 48LP2W34XH;
42034204
INFOPLIST_FILE = WebDriverAgentTests/IntegrationApp/Info.plist;
42044205
LD_RUNPATH_SEARCH_PATHS = (
42054206
"$(inherited)",
@@ -4216,6 +4217,7 @@
42164217
buildSettings = {
42174218
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
42184219
CLANG_ANALYZER_NONNULL = YES;
4220+
DEVELOPMENT_TEAM = 48LP2W34XH;
42194221
INFOPLIST_FILE = WebDriverAgentTests/IntegrationApp/Info.plist;
42204222
LD_RUNPATH_SEARCH_PATHS = (
42214223
"$(inherited)",
@@ -4270,9 +4272,8 @@
42704272
baseConfigurationReference = EEE5CABF1C80361500CBBDD9 /* IOSSettings.xcconfig */;
42714273
buildSettings = {
42724274
CLANG_STATIC_ANALYZER_MODE = deep;
4273-
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
42744275
DEBUG_INFORMATION_FORMAT = dwarf;
4275-
DEVELOPMENT_TEAM = UY67AXLS69;
4276+
DEVELOPMENT_TEAM = 48LP2W34XH;
42764277
ENABLE_TESTING_SEARCH_PATHS = YES;
42774278
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
42784279
INFOPLIST_FILE = WebDriverAgentRunner/Info.plist;
@@ -4325,8 +4326,7 @@
43254326
baseConfigurationReference = EEE5CABF1C80361500CBBDD9 /* IOSSettings.xcconfig */;
43264327
buildSettings = {
43274328
CLANG_STATIC_ANALYZER_MODE = deep;
4328-
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
4329-
DEVELOPMENT_TEAM = UY67AXLS69;
4329+
DEVELOPMENT_TEAM = 48LP2W34XH;
43304330
ENABLE_TESTING_SEARCH_PATHS = YES;
43314331
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
43324332
INFOPLIST_FILE = WebDriverAgentRunner/Info.plist;

WebDriverAgent/WebDriverAgentLib/Categories/XCAXClient_iOS+FBSnapshotReqParams.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ @implementation XCAXClient_iOS (FBSnapshotReqParams)
6565

6666
#pragma clang diagnostic push
6767
#pragma clang diagnostic ignored "-Wobjc-load-method"
68+
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
6869

6970
+ (void)load
7071
{

WebDriverAgent/WebDriverAgentLib/Categories/XCTIssue+FBPatcher.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ @implementation XCTIssue (AMPatcher)
2020

2121
#pragma clang diagnostic push
2222
#pragma clang diagnostic ignored "-Wobjc-load-method"
23+
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
24+
2325
+ (void)load
2426
{
2527
SEL originalShouldInterruptTest = NSSelectorFromString(@"shouldInterruptTest");
@@ -28,6 +30,7 @@ + (void)load
2830
if (nil == originalShouldInterruptTestMethod) return;
2931
method_setImplementation(originalShouldInterruptTestMethod, (IMP)swizzledShouldInterruptTest);
3032
}
33+
3134
#pragma clang diagnostic pop
3235

3336
@end

WebDriverAgent/WebDriverAgentLib/Categories/XCUIApplicationProcess+FBQuiescence.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ NS_ASSUME_NONNULL_BEGIN
1818
/*! Defines wtether the process should perform quiescence checks. YES by default */
1919
@property (nonatomic) NSNumber* fb_shouldWaitForQuiescence;
2020

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+
2126
@end
2227

2328
NS_ASSUME_NONNULL_END

WebDriverAgent/WebDriverAgentLib/Categories/XCUIApplicationProcess+FBQuiescence.m

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
#import <objc/runtime.h>
1313

1414
#import "FBConfiguration.h"
15+
#import "FBExceptions.h"
1516
#import "FBLogger.h"
1617
#import "FBSettings.h"
1718

1819
static void (*original_waitForQuiescenceIncludingAnimationsIdle)(id, SEL, BOOL);
20+
static void (*original_waitForQuiescenceIncludingAnimationsIdlePreEvent)(id, SEL, BOOL, BOOL);
1921

2022
static void swizzledWaitForQuiescenceIncludingAnimationsIdle(id self, SEL _cmd, BOOL includingAnimations)
2123
{
@@ -38,17 +40,43 @@ static void swizzledWaitForQuiescenceIncludingAnimationsIdle(id self, SEL _cmd,
3840
}
3941
}
4042

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+
4164
@implementation XCUIApplicationProcess (FBQuiescence)
4265

4366
#pragma clang diagnostic push
4467
#pragma clang diagnostic ignored "-Wobjc-load-method"
68+
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
4569

4670
+ (void)load
4771
{
4872
Method waitForQuiescenceIncludingAnimationsIdleMethod = class_getInstanceMethod(self.class, @selector(waitForQuiescenceIncludingAnimationsIdle:));
73+
Method waitForQuiescenceIncludingAnimationsIdlePreEventMethod = class_getInstanceMethod(self.class, @selector(waitForQuiescenceIncludingAnimationsIdle:isPreEvent:));
4974
if (nil != waitForQuiescenceIncludingAnimationsIdleMethod) {
5075
IMP swizzledImp = (IMP)swizzledWaitForQuiescenceIncludingAnimationsIdle;
5176
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);
5280
} else {
5381
[FBLogger log:@"Could not find method -[XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle:]"];
5482
}
@@ -74,4 +102,18 @@ - (void)setFb_shouldWaitForQuiescence:(NSNumber *)value
74102
objc_setAssociatedObject(self, &XCUIAPPLICATIONPROCESS_SHOULD_WAIT_FOR_QUIESCENCE, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
75103
}
76104

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+
77119
@end

WebDriverAgent/WebDriverAgentLib/Categories/XCUIElement+FBUID.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ static void swizzled_validatePredicateWithExpressionsAllowed(id self, SEL _cmd,
4242

4343
#pragma clang diagnostic push
4444
#pragma clang diagnostic ignored "-Wobjc-load-method"
45+
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
4546
+ (void)load
4647
{
4748
Class XCElementSnapshotCls = objc_lookUpClass("XCElementSnapshot");

WebDriverAgent/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#import "XCTElementSetTransformer-Protocol.h"
3232
#import "XCTestPrivateSymbols.h"
3333
#import "XCTRunnerDaemonSession.h"
34+
#import "XCUIApplicationProcess+FBQuiescence.h"
3435
#import "XCUIElement+FBCaching.h"
3536
#import "XCUIElement+FBWebDriverAttributes.h"
3637
#import "XCUIElementQuery.h"
@@ -190,7 +191,7 @@ - (void)fb_waitUntilStableWithTimeout:(NSTimeInterval)timeout
190191
self.application.fb_shouldWaitForQuiescence = YES;
191192
}
192193
[[[self.application applicationImpl] currentProcess]
193-
waitForQuiescenceIncludingAnimationsIdle:YES];
194+
fb_waitForQuiescenceIncludingAnimationsIdle:YES];
194195
if (previousQuiescence != self.application.fb_shouldWaitForQuiescence) {
195196
self.application.fb_shouldWaitForQuiescence = previousQuiescence;
196197
}

WebDriverAgent/WebDriverAgentLib/Commands/FBSessionCommands.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ + (NSArray *)routes
6666
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:@"URL is required" traceback:nil]);
6767
}
6868
NSString* bundleId = request.arguments[@"bundleId"];
69+
NSNumber* idleTimeoutMs = request.arguments[@"idleTimeoutMs"];
6970
NSError *error;
7071
if (nil == bundleId) {
7172
if (![XCUIDevice.sharedDevice fb_openUrl:urlString error:&error]) {
@@ -75,6 +76,10 @@ + (NSArray *)routes
7576
if (![XCUIDevice.sharedDevice fb_openUrl:urlString withApplication:bundleId error:&error]) {
7677
return FBResponseWithUnknownError(error);
7778
}
79+
if (idleTimeoutMs.doubleValue > 0) {
80+
XCUIApplication *app = [[XCUIApplication alloc] initWithBundleIdentifier:bundleId];
81+
[app fb_waitUntilStableWithTimeout:FBMillisToSeconds(idleTimeoutMs.doubleValue)];
82+
}
7883
}
7984
return FBResponseWithOK();
8085
}

WebDriverAgent/WebDriverAgentLib/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>8.7.4</string>
18+
<string>8.9.2</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>8.7.4</string>
22+
<string>8.9.2</string>
2323
<key>NSPrincipalClass</key>
2424
<string/>
2525
</dict>

WebDriverAgent/WebDriverAgentLib/Routing/FBExceptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,7 @@ extern NSString *const FBApplicationCrashedException;
5555
/*! Exception used to notify about the application is not installed */
5656
extern NSString *const FBApplicationMissingException;
5757

58+
/*! Exception used to notify about WDA incompatibility with the current platform version */
59+
extern NSString *const FBIncompatibleWdaException;
60+
5861
NS_ASSUME_NONNULL_END

WebDriverAgent/WebDriverAgentLib/Routing/FBExceptions.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222
NSString *const FBClassChainQueryParseException = @"FBClassChainQueryParseException";
2323
NSString *const FBApplicationCrashedException = @"FBApplicationCrashedException";
2424
NSString *const FBApplicationMissingException = @"FBApplicationMissingException";
25+
NSString *const FBIncompatibleWdaException = @"FBIncompatibleWdaException";

WebDriverAgent/WebDriverAgentLib/Routing/FBRoute.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ @implementation FBRoute_TargetAction
3939
- (void)mountRequest:(FBRouteRequest *)request intoResponse:(RouteResponse *)response
4040
{
4141
[self decorateRequest:request];
42+
#pragma clang diagnostic push
43+
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
4244
id<FBResponsePayload> (*requestMsgSend)(id, SEL, FBRouteRequest *) = ((id<FBResponsePayload>(*)(id, SEL, FBRouteRequest *))objc_msgSend);
45+
#pragma clang diagnostic pop
4346
id<FBResponsePayload> payload = requestMsgSend(self.target, self.action, request);
4447
[payload dispatchWithResponse:response];
4548
}

WebDriverAgent/WebDriverAgentLib/Routing/FBSession.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
NS_ASSUME_NONNULL_BEGIN
1616

17+
/** Bundle identifier of Mobile Safari browser */
18+
extern NSString* const FB_SAFARI_BUNDLE_ID;
19+
1720
/**
1821
Class that represents testing session
1922
*/

WebDriverAgent/WebDriverAgentLib/Routing/FBSession.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
*/
3434
NSString *const FBDefaultApplicationAuto = @"auto";
3535

36+
NSString *const FB_SAFARI_BUNDLE_ID = @"com.apple.mobilesafari";
37+
3638
@interface FBSession ()
3739
@property (nullable, nonatomic) XCUIApplication *testedApplication;
3840
@property (nonatomic) BOOL isTestedApplicationExpectedToRun;

WebDriverAgent/WebDriverAgentLib/Routing/FBWebServer.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ - (void)handleException:(NSException *)exception forResponse:(RouteResponse *)re
217217
- (void)registerServerKeyRouteHandlers
218218
{
219219
[self.server get:@"/health" withBlock:^(RouteRequest *request, RouteResponse *response) {
220-
[response respondWithString:@"I-AM-ALIVE"];
220+
[response respondWithString:@"<!DOCTYPE html><html><title>Health Check</title><body><p>I-AM-ALIVE</p></body></html>"];
221221
}];
222222

223223
NSString *calibrationPage = @"<html>"

0 commit comments

Comments
 (0)