From 9830bf4c070f5249e483b2146927f34fb3b5501e Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Sun, 8 Dec 2024 11:19:12 +0800 Subject: [PATCH] refactor: rename ios_driver to ios_wda_driver --- hrp/internal/version/VERSION | 2 +- hrp/pkg/uixt/android_adb_driver.go | 5 ++++- hrp/pkg/uixt/client.go | 2 +- hrp/pkg/uixt/{ios_driver.go => ios_wda_driver.go} | 0 4 files changed, 6 insertions(+), 3 deletions(-) rename hrp/pkg/uixt/{ios_driver.go => ios_wda_driver.go} (100%) diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index a0d39a7f..84b043ec 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v5.0.0+2412081117 +v5.0.0+2412081145 diff --git a/hrp/pkg/uixt/android_adb_driver.go b/hrp/pkg/uixt/android_adb_driver.go index 2074c10a..849cd3eb 100644 --- a/hrp/pkg/uixt/android_adb_driver.go +++ b/hrp/pkg/uixt/android_adb_driver.go @@ -68,12 +68,15 @@ func (ad *adbDriver) runShellCommand(cmd string, args ...string) (output string, if cmd == "screencap" { resp, err := ad.adbClient.ScreenCap() if err == nil { + driverResult.ResponseBody = "OMITTED" return string(resp), nil } return "", errors.Wrap(err, "adb screencap failed") } - return ad.adbClient.RunShellCommand(cmd, args...) + output, err = ad.adbClient.RunShellCommand(cmd, args...) + driverResult.ResponseBody = strings.TrimSpace(output) + return output, err } func (ad *adbDriver) NewSession(capabilities Capabilities) (sessionInfo SessionInfo, err error) { diff --git a/hrp/pkg/uixt/client.go b/hrp/pkg/uixt/client.go index 9af75c1c..f99bcd1f 100644 --- a/hrp/pkg/uixt/client.go +++ b/hrp/pkg/uixt/client.go @@ -80,7 +80,7 @@ type DriverResult struct { Success bool `json:"success"` ResponseStatus int `json:"response_status"` ResponseDuration int64 `json:"response_duration(ms)"` // ms - ResponseBody string `json:"response_body"` + ResponseBody string `json:"response_body,omitempty"` Error string `json:"error,omitempty"` } diff --git a/hrp/pkg/uixt/ios_driver.go b/hrp/pkg/uixt/ios_wda_driver.go similarity index 100% rename from hrp/pkg/uixt/ios_driver.go rename to hrp/pkg/uixt/ios_wda_driver.go