Skip to content

Commit

Permalink
Merge pull request #58 from appium/master
Browse files Browse the repository at this point in the history
Fork Sync: Update from parent repository
  • Loading branch information
github-actions[bot] authored Feb 12, 2024
2 parents 821bdf8 + 17b94de commit 95bfcb9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [6.1.1](https://github.com/appium/WebDriverAgent/compare/v6.1.0...v6.1.1) (2024-02-11)


### Miscellaneous Chores

* Make sure the app under test is restarted if opened from a deep link ([#846](https://github.com/appium/WebDriverAgent/issues/846)) ([88b0a5b](https://github.com/appium/WebDriverAgent/commit/88b0a5b0f8aefa05a7dc28d17faf62c229e0706f))

## [6.1.0](https://github.com/appium/WebDriverAgent/compare/v6.0.0...v6.1.0) (2024-02-10)


Expand Down
24 changes: 12 additions & 12 deletions WebDriverAgentLib/Commands/FBSessionCommands.m
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ + (NSArray *)routes
NSString *bundleID = capabilities[FB_CAP_BUNDLE_ID];
NSString *initialUrl = capabilities[FB_CAP_INITIAL_URL];
XCUIApplication *app = nil;
BOOL didOpenInitialUrl = NO;
if (bundleID != nil) {
app = [[XCUIApplication alloc] initWithBundleIdentifier:bundleID];
BOOL forceAppLaunch = YES;
Expand All @@ -153,31 +152,32 @@ + (NSArray *)routes
app.launchArguments = (NSArray<NSString *> *)capabilities[FB_CAP_ARGUMENTS] ?: @[];
app.launchEnvironment = (NSDictionary <NSString *, NSString *> *)capabilities[FB_CAP_ENVIRNOMENT] ?: @{};
if (nil != initialUrl) {
if (app.running) {
[app terminate];
}
NSError *openError;
didOpenInitialUrl = [XCUIDevice.sharedDevice fb_openUrl:initialUrl
withApplication:bundleID
error:&openError];
if (!didOpenInitialUrl) {
NSString *errorMsg = [NSString stringWithFormat:@"Cannot open the URL %@ in %@ application. Original error: %@",
if (![XCUIDevice.sharedDevice fb_openUrl:initialUrl
withApplication:bundleID
error:&openError]) {
NSString *errorMsg = [NSString stringWithFormat:@"Cannot open the URL %@ wuth the %@ application. Original error: %@",
initialUrl, bundleID, openError.description];
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:errorMsg traceback:nil]);
}
} else {
[app launch];
}
if (![app running]) {
if (!app.running) {
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];
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:errorMsg
traceback:nil]);
}
} else if (appState == XCUIApplicationStateRunningBackground && !forceAppLaunch) {
if (nil != initialUrl) {
NSError *openError;
didOpenInitialUrl = [XCUIDevice.sharedDevice fb_openUrl:initialUrl
withApplication:bundleID
error:&openError];
if (!didOpenInitialUrl) {
NSString *errorMsg = [NSString stringWithFormat:@"Cannot open the URL %@ in %@ application. Original error: %@",
if (![XCUIDevice.sharedDevice fb_openUrl:initialUrl
withApplication:bundleID
error:&openError]) {
NSString *errorMsg = [NSString stringWithFormat:@"Cannot open the URL %@ with the %@ application. Original error: %@",
initialUrl, bundleID, openError.description];
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:errorMsg traceback:nil]);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "appium-webdriveragent",
"version": "6.1.0",
"version": "6.1.1",
"description": "Package bundling WebDriverAgent",
"main": "./build/index.js",
"scripts": {
Expand Down

0 comments on commit 95bfcb9

Please sign in to comment.