refactor: clean up function signatures in DriverSession and WDADriver for improved readability

This commit is contained in:
lilong.129
2025-06-26 14:43:39 +08:00
parent 3e4858db44
commit 1b48763e57
3 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
v5.0.0-beta-2506261437 v5.0.0-beta-2506261443
+2 -4
View File
@@ -156,8 +156,7 @@ func (s *DriverSession) DELETE(urlStr string) (rawResp DriverRawResponse, err er
} }
func (s *DriverSession) RequestWithRetry(method string, urlStr string, rawBody []byte) ( func (s *DriverSession) RequestWithRetry(method string, urlStr string, rawBody []byte) (
rawResp DriverRawResponse, err error, rawResp DriverRawResponse, err error) {
) {
for count := 1; count <= s.maxRetry; count++ { for count := 1; count <= s.maxRetry; count++ {
rawResp, err = s.Request(method, urlStr, rawBody) rawResp, err = s.Request(method, urlStr, rawBody)
if err == nil { if err == nil {
@@ -180,8 +179,7 @@ func (s *DriverSession) RequestWithRetry(method string, urlStr string, rawBody [
} }
func (s *DriverSession) Request(method string, urlStr string, rawBody []byte) ( func (s *DriverSession) Request(method string, urlStr string, rawBody []byte) (
rawResp DriverRawResponse, err error, rawResp DriverRawResponse, err error) {
) {
// build final URL // build final URL
rawURL, err := s.buildURL(urlStr) rawURL, err := s.buildURL(urlStr)
if err != nil { if err != nil {
+1 -2
View File
@@ -179,7 +179,6 @@ func (wd *WDADriver) DeleteSession() (err error) {
wd.mjpegClient.CloseIdleConnections() wd.mjpegClient.CloseIdleConnections()
} }
// [[FBRoute DELETE:@""] respondWithTarget:self action:@selector(handleDeleteSession:)]
wd.Session.client.CloseIdleConnections() wd.Session.client.CloseIdleConnections()
return return
} }
@@ -625,7 +624,7 @@ func (wd *WDADriver) Drag(fromX, fromY, toX, toY float64, opts ...option.ActionO
"toY": builtin.RoundToOneDecimal(toY), "toY": builtin.RoundToOneDecimal(toY),
} }
option.MergeOptions(data, opts...) option.MergeOptions(data, opts...)
// wda 43 version // wda 50 version
_, err = wd.Session.POST(data, "/wings/interaction/drag") _, err = wd.Session.POST(data, "/wings/interaction/drag")
return err return err
} }