change: remove duplicate code

This commit is contained in:
lilong.129
2024-09-01 17:05:38 +08:00
parent 50e21ce390
commit f1e4caeef8
2 changed files with 9 additions and 17 deletions

View File

@@ -104,23 +104,6 @@ func (dExt *DriverExt) GetStepCacheData() map[string]interface{} {
return cacheData
}
// isPathExists returns true if path exists, whether path is file or dir
func isPathExists(path string) bool {
if _, err := os.Stat(path); os.IsNotExist(err) {
return false
}
return true
}
func (dExt *DriverExt) FindUIRectInUIKit(search string, options ...ActionOption) (point PointF, err error) {
// click on text, using OCR
if !isPathExists(search) {
return dExt.FindScreenText(search, options...)
}
err = errors.New("ocr text not found")
return
}
func (dExt *DriverExt) AssertOCR(text, assert string) bool {
var err error
switch assert {