fix: unittext

This commit is contained in:
xucong.053
2022-10-11 15:55:20 +08:00
parent 2815d67331
commit a697623ae2
5 changed files with 14 additions and 6 deletions

View File

@@ -88,13 +88,20 @@ func WithIndex(index int) ActionOption {
}
}
// WithDirection inputs direction (up, down, left, right, []float64{sx, sy, ex, ey})
func WithDirection(direction interface{}) ActionOption {
// WithDirection inputs direction (up, down, left, right)
func WithDirection(direction string) ActionOption {
return func(o *MobileAction) {
o.Direction = direction
}
}
// WithCustomDirection inputs sx, sy, ex, ey
func WithCustomDirection(sx, sy, ex, ey float64) ActionOption {
return func(o *MobileAction) {
o.Direction = []float64{sx, sy, ex, ey}
}
}
func WithText(text string) ActionOption {
return func(o *MobileAction) {
o.Text = text
@@ -438,7 +445,7 @@ func (dExt *DriverExt) DoAction(action MobileAction) error {
if action.Direction != nil {
return dExt.SwipeUntil(action.Direction, findText, foundTextAction, action.MaxRetryTimes)
}
// swipe until live room found
// swipe until found
return dExt.SwipeUntil("up", findText, foundTextAction, action.MaxRetryTimes)
case AppTerminate:
if bundleId, ok := action.Params.(string); ok {