feat: describe screenshot file name with params

This commit is contained in:
lilong.129
2024-11-13 21:51:43 +08:00
parent 6d514589a0
commit 2a84335910
4 changed files with 30 additions and 12 deletions
+3
View File
@@ -34,6 +34,9 @@ func (dExt *DriverExt) TapXY(x, y float64, options ...ActionOption) error {
func (dExt *DriverExt) TapByOCR(ocrText string, options ...ActionOption) error {
actionOptions := NewActionOptions(options...)
if actionOptions.ScreenShotFileName == "" {
options = append(options, WithScreenShotFileName(fmt.Sprintf("tap_by_ocr_%s", ocrText)))
}
point, err := dExt.FindScreenText(ocrText, options...)
if err != nil {