fix: screenshot wait for swipe done

This commit is contained in:
debugtalk
2022-09-26 17:41:09 +08:00
parent 1ecea74214
commit 1de68a1847
3 changed files with 12 additions and 6 deletions
+3
View File
@@ -2,6 +2,7 @@ package uixt
import (
"fmt"
"time"
"github.com/rs/zerolog/log"
)
@@ -81,6 +82,8 @@ func (dExt *DriverExt) SwipeUntil(direction string, condition FindCondition, act
if err := dExt.SwipeTo(direction); err != nil {
log.Error().Err(err).Msgf("swipe %s failed", direction)
}
// wait for swipe done
time.Sleep(500 * time.Millisecond)
}
return fmt.Errorf("swipe %s %d times, match condition failed", direction, maxTimes)
}