Skip to content

Commit

Permalink
Fix stuck XCUITest runner when a popup is shown on the screen (#510)
Browse files Browse the repository at this point in the history
* only include the description from the userInfo dictionary

sometimes those errors contain a screenshot and that creates unreadable logs

* Add missing launch option

with this option the XCUITest runner is coming into foreground even when there is a popup on the screen when at the time when the runner gets launched
  • Loading branch information
dmissmann authored Nov 11, 2024
1 parent 4cd5d9f commit 1caa612
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion ios/nskeyedarchiver/objectivec_classes.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,11 @@ func NewNSError(object map[string]interface{}, objects []interface{}) interface{
}

func (err NSError) Error() string {
return fmt.Sprintf("Error code: %d, Domain: %s, User info: %v", err.ErrorCode, err.Domain, err.UserInfo)
var description any = "no description available"
if d, ok := err.UserInfo["NSLocalizedDescription"]; ok {
description = d
}
return fmt.Sprintf("%v (Error code: %d, Domain: %s)", description, err.ErrorCode, err.Domain)
}

// Apples Reference Date is Jan 1st 2001 00:00
Expand Down
5 changes: 3 additions & 2 deletions ios/testmanagerd/xcuitestrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,9 @@ func startTestRunner17(appserviceConn *appservice.Connection, bundleID string, s
}

opts := map[string]interface{}{
"ActivateSuspended": uint64(1),
"StartSuspendedKey": uint64(0),
"ActivateSuspended": uint64(1),
"StartSuspendedKey": uint64(0),
"__ActivateSuspended": uint64(1),
}

appLaunch, err := appserviceConn.LaunchAppWithStdIo(
Expand Down

0 comments on commit 1caa612

Please sign in to comment.