mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-06 08:19:45 +08:00
update: android actions
This commit is contained in:
@@ -112,6 +112,32 @@ func (s *StepAndroid) StopRecording() *StepAndroid {
|
|||||||
return &StepAndroid{step: s.step}
|
return &StepAndroid{step: s.step}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TapXY taps the point {X,Y}, X & Y is percentage of coordinates
|
||||||
|
func (s *StepAndroid) TapXY(x, y float64, options ...uixt.ActionOption) *StepAndroid {
|
||||||
|
action := uixt.MobileAction{
|
||||||
|
Method: uixt.ACTION_TapXY,
|
||||||
|
Params: []float64{x, y},
|
||||||
|
}
|
||||||
|
for _, option := range options {
|
||||||
|
option(&action)
|
||||||
|
}
|
||||||
|
s.step.Android.Actions = append(s.step.Android.Actions, action)
|
||||||
|
return &StepAndroid{step: s.step}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TapAbsXY taps the point {X,Y}, X & Y is absolute coordinates
|
||||||
|
func (s *StepAndroid) TapAbsXY(x, y float64, options ...uixt.ActionOption) *StepAndroid {
|
||||||
|
action := uixt.MobileAction{
|
||||||
|
Method: uixt.ACTION_TapAbsXY,
|
||||||
|
Params: []float64{x, y},
|
||||||
|
}
|
||||||
|
for _, option := range options {
|
||||||
|
option(&action)
|
||||||
|
}
|
||||||
|
s.step.Android.Actions = append(s.step.Android.Actions, action)
|
||||||
|
return &StepAndroid{step: s.step}
|
||||||
|
}
|
||||||
|
|
||||||
func (s *StepAndroid) Tap(params interface{}) *StepAndroid {
|
func (s *StepAndroid) Tap(params interface{}) *StepAndroid {
|
||||||
s.step.Android.Actions = append(s.step.Android.Actions, uixt.MobileAction{
|
s.step.Android.Actions = append(s.step.Android.Actions, uixt.MobileAction{
|
||||||
Method: uixt.ACTION_Tap,
|
Method: uixt.ACTION_Tap,
|
||||||
|
|||||||
Reference in New Issue
Block a user