Merge pull request #1677 from httprunner/add-expert-test

- introduce expert test for both integration and regression
- add TapByUITypes method in step_mobile_ui.go
This commit is contained in:
debugtalk
2023-08-25 16:59:37 +08:00
committed by GitHub
7 changed files with 1286 additions and 19 deletions
+13 -2
View File
@@ -102,7 +102,7 @@ func (s *StepMobile) Tap(params string, options ...uixt.ActionOption) *StepMobil
return &StepMobile{step: s.step}
}
// Tap taps on the target element by OCR recognition
// TapByOCR taps on the target element by OCR recognition
func (s *StepMobile) TapByOCR(ocrText string, options ...uixt.ActionOption) *StepMobile {
action := uixt.MobileAction{
Method: uixt.ACTION_TapByOCR,
@@ -114,7 +114,7 @@ func (s *StepMobile) TapByOCR(ocrText string, options ...uixt.ActionOption) *Ste
return &StepMobile{step: s.step}
}
// Tap taps on the target element by CV recognition
// TapByCV taps on the target element by CV recognition
func (s *StepMobile) TapByCV(imagePath string, options ...uixt.ActionOption) *StepMobile {
action := uixt.MobileAction{
Method: uixt.ACTION_TapByCV,
@@ -126,6 +126,17 @@ func (s *StepMobile) TapByCV(imagePath string, options ...uixt.ActionOption) *St
return &StepMobile{step: s.step}
}
// TapByUITypes taps on the target element specified by uiTypes, the higher the uiTypes, the higher the priority
func (s *StepMobile) TapByUITypes(options ...uixt.ActionOption) *StepMobile {
action := uixt.MobileAction{
Method: uixt.ACTION_TapByCV,
Options: uixt.NewActionOptions(options...),
}
s.mobileStep().Actions = append(s.mobileStep().Actions, action)
return &StepMobile{step: s.step}
}
// DoubleTapXY double taps the point {X,Y}, X & Y is percentage of coordinates
func (s *StepMobile) DoubleTapXY(x, y float64, options ...uixt.ActionOption) *StepMobile {
s.mobileStep().Actions = append(s.mobileStep().Actions, uixt.MobileAction{