Files
sanderling/internal/driver/driver.go
T
pj d2fae427f9 feat(driver): add TapSelector and make mock WaitForIdle honor duration
Real maestro driver will resolve selectors itself rather than
forcing the runner to look up coordinates from the hierarchy. Mock
now waits the requested duration so tests don't busy-spin and
starve the SDK fixture goroutine.
2026-04-17 23:54:00 +07:00

37 lines
880 B
Go

package driver
import (
"context"
"time"
)
// Driver abstracts the platform-specific UI automation backend. v0.1 surface
// matches proto/driverpb/driver.proto. The Maestro sidecar implementation
// lives under driver/maestro; tests use driver/mock.
type Driver interface {
Launch(ctx context.Context, bundleID string, clearState bool) error
Terminate(ctx context.Context) error
Tap(ctx context.Context, x, y int) error
TapSelector(ctx context.Context, selector string) error
InputText(ctx context.Context, text string) error
Hierarchy(ctx context.Context) (string, error)
Screenshot(ctx context.Context) (Image, error)
WaitForIdle(ctx context.Context, duration time.Duration) error
Health(ctx context.Context) (Health, error)
}
type Image struct {
PNG []byte
Width int
Height int
}
type Health struct {
Ready bool
Version string
Platform string
}