Documentation ¶
Overview ¶
Package touch provides the uiauto actions to control the touchscreen.
Index ¶
- func NewTouchscreenAndConverter(ctx context.Context, tconn *chrome.TestConn) (*input.TouchscreenEventWriter, *input.TouchCoordConverter, error)
- type Context
- func (tc *Context) Close() error
- func (tc *Context) Hold(duration time.Duration) uiauto.Action
- func (tc *Context) LongPress(finder *nodewith.Finder) uiauto.Action
- func (tc *Context) Swipe(loc coords.Point, gestures ...uiauto.Action) uiauto.Action
- func (tc *Context) SwipeTo(p coords.Point, duration time.Duration) uiauto.Action
- func (tc *Context) SwipeToNode(f *nodewith.Finder, duration time.Duration) uiauto.Action
- func (tc *Context) Tap(finder *nodewith.Finder) uiauto.Action
- func (tc *Context) TapAt(loc coords.Point) uiauto.Action
- func (tc *Context) WithInterval(interval time.Duration) *Context
- func (tc *Context) WithPollOpts(pollOpts testing.PollOptions) *Context
- func (tc *Context) WithTimeout(timeout time.Duration) *Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTouchscreenAndConverter ¶
func NewTouchscreenAndConverter(ctx context.Context, tconn *chrome.TestConn) (*input.TouchscreenEventWriter, *input.TouchCoordConverter, error)
NewTouchscreenAndConverter is a utility to create a new touchscreen event writer and its touch coord converter with checking the display bounds.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context provides the interface to the touchscreen.
func (*Context) Hold ¶
Hold returns a function to hold the touch for the specified duration. This can only be used within Swipe method.
func (*Context) LongPress ¶
LongPress returns a function that causes a long press at the node through the touchscreen.
func (*Context) Swipe ¶
Swipe returns a function to initiate the single-touch gesture, and conducts the specified gesture actions. The gesture starts from the specified location. Examples:
// swipe from a location to another in a second. tc.Swipe(start, tc.SwipeTo(end, time.Second)) // Longpress and swipe. tc.Swipe(start, tc.Hold(time.Second), tc.SwipeTo(end, time.Second)) // Multiple points. tc.Swipe(points[0], tc.SwipeTo(points[1], time.Second), tc.SwipeTo(points[2], time.Second)) // Combine with other actions; swipe and then wait for a UI change. tc.Swipe(start, tc.SwipeTo(end, time.Second), ac.WaitUntilExists(node))
func (*Context) SwipeTo ¶
SwipeTo returns a function to swipe to the target location in the duration. This can only be used within Swipe method.
func (*Context) SwipeToNode ¶
SwipeToNode returns a function to swipe to the target node in the duration. This can only be used within Swipe method.
func (*Context) WithInterval ¶
WithInterval returns a new Context with the specified polling interval.
func (*Context) WithPollOpts ¶
func (tc *Context) WithPollOpts(pollOpts testing.PollOptions) *Context
WithPollOpts returns a new Context with the specified polling options.