Merge branch 'session_refactor' into 'master'

fix: wda启动app超时120s, swipe_to_tap_app未返回滑动错误错误码

See merge request iesqa/httprunner!133
This commit is contained in:
李隆
2025-07-24 07:22:12 +00:00
5 changed files with 10 additions and 4 deletions

View File

@@ -1 +1 @@
v5.0.0-250723
v5.0.0-250724

View File

@@ -79,7 +79,7 @@ func (s *vedemCVService) ReadFromBuffer(imageBuf *bytes.Buffer, opts ...option.A
if err != nil {
logger = log.Error().Err(err)
} else {
logger = log.Info()
logger = log.Debug()
if imageResult.URL != "" {
logger = logger.Str("url", imageResult.URL)
}

View File

@@ -112,6 +112,7 @@ func (dExt *XTDriver) GetScreenResult(opts ...option.ActionOption) (screenResult
return nil, err
}
if imageResult != nil {
log.Info().Str("serial", dExt.GetDevice().UUID()).Str("url", imageResult.URL).Msg("ReadFromBuffer from ImageService")
screenResult.Texts = imageResult.OCRResult.ToOCRTexts()
screenResult.UploadedURL = imageResult.URL
screenResult.Icons = imageResult.UIResult

View File

@@ -162,7 +162,11 @@ func (dExt *XTDriver) SwipeToTapApp(appName string, opts ...option.ActionOption)
// swipe to first screen
for i := 0; i < 5; i++ {
dExt.Swipe(0.5, 0.5, 0.9, 0.5, optionsWithoutIdentifier...)
err := dExt.Swipe(0.5, 0.5, 0.9, 0.5, optionsWithoutIdentifier...)
if err != nil {
log.Error().Err(err).Msgf("swipe to tap app %s failed", appName)
return errors.Wrapf(err, "swipe to tap app %s failed", appName)
}
time.Sleep(1 * time.Second)
}

View File

@@ -433,7 +433,8 @@ func (wd *WDADriver) AppLaunch(bundleId string) (err error) {
data["environment"] = map[string]interface{}{
"SHOW_EXPLORER": "NO",
}
_, err = wd.Session.POST(data, "/wings/apps/launch")
// 超时两分钟
_, err = wd.Session.POST(data, "/wings/apps/launch", option.WithTimeout(120))
if err != nil {
return errors.Wrap(err, "wda app launch failed")
}