refactor: TakeScreenShot saves all screenshots

This commit is contained in:
lilong.129
2023-04-16 22:11:35 +08:00
parent 2644c24fae
commit 0a59ced824
9 changed files with 50 additions and 72 deletions

View File

@@ -150,11 +150,7 @@ func NewWorldCupLive(device uixt.Device, matchName, bundleID string, duration, i
func (wc *WorldCupLive) getCurrentLiveTime(utcTime time.Time) error {
utcTimeStr := utcTime.Format("15:04:05")
fileName := filepath.Join(
wc.resultDir, "screenshot", utcTimeStr)
ocrTexts, err := wc.driver.GetTextsByOCR(
uixt.WithScreenShot(fileName),
)
ocrTexts, err := wc.driver.GetTextsByOCR()
if err != nil {
log.Error().Err(err).Msg("get ocr texts failed")
return err