fix: web ui test

This commit is contained in:
徐聪
2025-05-07 20:12:06 +08:00
parent 37fd2e900d
commit 6cce5e3c5b
14 changed files with 347 additions and 60 deletions
+12
View File
@@ -56,3 +56,15 @@ func (dExt *XTDriver) TapByCV(opts ...option.ActionOption) error {
return dExt.TapAbsXY(point.X, point.Y, opts...)
}
func (dExt *XTDriver) RightClickByOCR(ocrText string, opts ...option.ActionOption) error {
actionOptions := option.NewActionOptions(opts...)
point, err := dExt.FindScreenText(ocrText, opts...)
if err != nil {
if actionOptions.IgnoreNotFoundError {
return nil
}
return err
}
return dExt.IDriver.(*BrowserDriver).RightClick(point.Center().X, point.Center().Y)
}