mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-13 08:29:45 +08:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user