feat: save video stat to summary

This commit is contained in:
lilong.129
2023-04-30 00:13:18 +08:00
parent 6b764c5649
commit a69db8500c
3 changed files with 8 additions and 1 deletions

View File

@@ -50,6 +50,8 @@ type cacheStepData struct {
ScreenShots []string
// cache step screenshot ocr results, key is image path, value is dumped OCRTexts
OcrResults map[string]string
// cache feed/live video stat
VideoStat *VideoStat
}
type DriverExt struct {

View File

@@ -130,13 +130,17 @@ func (l *LiveCrawler) exitLiveRoom() error {
}
func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
currVideoStat := &VideoStat{}
defer func() {
dExt.cacheStepData.VideoStat = currVideoStat
}()
// launch app
if err = dExt.Driver.AppLaunch(configs.AppPackageName); err != nil {
return err
}
time.Sleep(5 * time.Second)
currVideoStat := &VideoStat{}
liveCrawler := LiveCrawler{
driver: dExt,
configs: configs,

View File

@@ -619,6 +619,7 @@ func runStepMobileUI(s *SessionRunner, step *TStep) (stepResult *StepResult, err
cacheData := uiDriver.GetStepCacheData()
attachments["screenshots"] = cacheData.ScreenShots
attachments["ocr_results"] = cacheData.OcrResults
attachments["video_stat"] = cacheData.VideoStat
stepResult.Attachments = attachments
}()