feat: tap the first one matches text from given texts by ocr

This commit is contained in:
xucong.053
2022-10-11 14:53:21 +08:00
parent 0ff5fb762f
commit cd0ab6dfdb
12 changed files with 485 additions and 29 deletions

View File

@@ -244,6 +244,18 @@ func (s *StepIOS) SwipeToTapText(text string, options ...uixt.ActionOption) *Ste
return &StepIOS{step: s.step}
}
func (s *StepIOS) SwipeToTapFromTexts(texts []string, options ...uixt.ActionOption) *StepIOS {
action := uixt.MobileAction{
Method: uixt.ACTION_SwipeToTapText,
Params: texts,
}
for _, option := range options {
option(&action)
}
s.step.IOS.Actions = append(s.step.IOS.Actions, action)
return &StepIOS{step: s.step}
}
func (s *StepIOS) Input(text string, options ...uixt.ActionOption) *StepIOS {
action := uixt.MobileAction{
Method: uixt.ACTION_Input,