Merge pull request #1691 from httprunner/fix/buyuxiang/swipeToTapTexts-with-regex

return the first one matched exactly when index not specified
This commit is contained in:
debugtalk
2023-09-04 22:31:44 +08:00
committed by GitHub

View File

@@ -134,6 +134,11 @@ func (t OCRTexts) FindText(text string, options ...ActionOption) (result OCRText
}
results = append(results, ocrText)
// return the first one matched exactly when index not specified
if ocrText.Text == text && actionOptions.Index == 0 {
return ocrText, nil
}
}
if len(results) == 0 {