Documentation
¶
Overview ¶
Package test provides utility drivers for running UI tests without rendering
Index ¶
- func Canvas() fyne.Canvas
- func NewApp() fyne.App
- func NewClipboard() fyne.Clipboard
- func NewDriver() fyne.Driver
- func NewDriverWithPainter(painter SoftwarePainter) fyne.Driver
- func NewWindow(content fyne.CanvasObject) fyne.Window
- func Tap(obj fyne.Tappable)
- func TapAt(obj fyne.Tappable, pos fyne.Position)
- func TapSecondary(obj fyne.Tappable)
- func TapSecondaryAt(obj fyne.Tappable, pos fyne.Position)
- func Type(obj fyne.Focusable, chars string)
- func TypeOnCanvas(c fyne.Canvas, chars string)
- type SoftwarePainter
- type WindowlessCanvas
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewApp ¶
NewApp returns a new dummy app used for testing. It loads a test driver which creates a virtual window in memory for testing.
func NewClipboard ¶
NewClipboard returns a single use in-memory clipboard used for testing
func NewDriverWithPainter ¶ added in v1.2.0
func NewDriverWithPainter(painter SoftwarePainter) fyne.Driver
NewDriverWithPainter creates a new dummy driver that will pass the given painter to all canvases created
func NewWindow ¶
func NewWindow(content fyne.CanvasObject) fyne.Window
NewWindow creates and registers a new window for test purposes
func TapAt ¶ added in v1.2.0
TapAt simulates a left mouse click on the passed object at a specified place within it.
func TapSecondary ¶ added in v1.1.1
TapSecondary simulates a right mouse click on the specified object.
func TapSecondaryAt ¶ added in v1.2.0
TapSecondaryAt simulates a right mouse click on the passed object at a specified place within it.
func Type ¶
Type performs a series of key events to simulate typing of a value into the specified object. The focusable object will be focused before typing begins. The chars parameter will be input one rune at a time to the focused object.
func TypeOnCanvas ¶
TypeOnCanvas is like the Type function but it passes the key events to the canvas object rather than a focusable widget.
Types ¶
type SoftwarePainter ¶ added in v1.2.0
SoftwarePainter describes a simple type that can render canvases
type WindowlessCanvas ¶ added in v1.2.0
WindowlessCanvas provides functionality for a canvas to operate without a window
func NewCanvas ¶
func NewCanvas() WindowlessCanvas
NewCanvas returns a single use in-memory canvas used for testing
func NewCanvasWithPainter ¶ added in v1.2.0
func NewCanvasWithPainter(painter SoftwarePainter) WindowlessCanvas
NewCanvasWithPainter allows creation of an in-memory canvas with a specific painter. The painter will be used to render in the Capture() call.