allwright

package module
v0.0.58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Chromium = BrowserType{/* contains filtered or unexported fields */}
	Firefox  = BrowserType{/* contains filtered or unexported fields */}
)
View Source
var Mobile = mobileNamespace{
	Android: AndroidSurface{},
}

Functions

func FindConfigFile added in v0.0.30

func FindConfigFile(startDir string) (string, error)

func Ping

func Ping(ctx context.Context) (string, error)

func SetServerAddr added in v0.0.30

func SetServerAddr(serverAddr string) error

func Shutdown

func Shutdown() error

Types

type AllwrightConfig added in v0.0.30

type AllwrightConfig struct {
	SchemaVersion uint32                 `json:"schemaVersion,omitempty" yaml:"schemaVersion,omitempty"`
	Server        *configServer          `json:"server,omitempty" yaml:"server,omitempty"`
	Web           *configWeb             `json:"web,omitempty" yaml:"web,omitempty"`
	Mobile        *configMobile          `json:"mobile,omitempty" yaml:"mobile,omitempty"`
	Desktop       *configDesktop         `json:"desktop,omitempty" yaml:"desktop,omitempty"`
	Expect        *RetryConfig           `json:"expect,omitempty" yaml:"expect,omitempty"`
	Suites        map[string]suiteConfig `json:"suites,omitempty" yaml:"suites,omitempty"`
}

func LoadConfigFile added in v0.0.30

func LoadConfigFile(path string) (*AllwrightConfig, error)

type AndroidApp added in v0.0.53

type AndroidApp struct {
	// contains filtered or unexported fields
}

func (*AndroidApp) Click added in v0.0.53

func (p *AndroidApp) Click(ctx context.Context, selector string, options ...CommandOptions) (*ClickResult, error)

func (*AndroidApp) Count added in v0.0.57

func (p *AndroidApp) Count(ctx context.Context, selector string, options ...CommandOptions) (*CountResult, error)

func (*AndroidApp) Fill added in v0.0.53

func (p *AndroidApp) Fill(ctx context.Context, selector string, value string, options ...CommandOptions) (*FillResult, error)

func (*AndroidApp) Focus added in v0.0.57

func (p *AndroidApp) Focus(ctx context.Context, selector string, options ...CommandOptions) (*ElementResult, error)

func (*AndroidApp) InnerText added in v0.0.57

func (p *AndroidApp) InnerText(ctx context.Context, selector string, options ...CommandOptions) (*TextResult, error)

func (*AndroidApp) Locator added in v0.0.53

func (p *AndroidApp) Locator(selector string) *AndroidLocator

func (*AndroidApp) Press added in v0.0.57

func (p *AndroidApp) Press(ctx context.Context, selector string, key string, options ...PressOptions) (*PressResult, error)

func (*AndroidApp) Screenshot added in v0.0.54

func (p *AndroidApp) Screenshot(ctx context.Context, options ...ScreenshotOptions) (*ScreenshotResult, error)

func (*AndroidApp) SessionID added in v0.0.53

func (p *AndroidApp) SessionID() string

func (*AndroidApp) TextContent added in v0.0.57

func (p *AndroidApp) TextContent(ctx context.Context, selector string, options ...CommandOptions) (*TextResult, error)

func (*AndroidApp) WaitForSelector added in v0.0.57

func (p *AndroidApp) WaitForSelector(ctx context.Context, selector string, options ...WaitForSelectorOptions) (*WaitForSelectorResult, error)

type AndroidDevice added in v0.0.45

type AndroidDevice struct {
	// contains filtered or unexported fields
}

func (*AndroidDevice) App added in v0.0.53

func (d *AndroidDevice) App() *AndroidApp

func (*AndroidDevice) InitialApp added in v0.0.53

func (d *AndroidDevice) InitialApp() *AndroidApp

func (*AndroidDevice) Launch added in v0.0.45

func (*AndroidDevice) SessionID added in v0.0.45

func (d *AndroidDevice) SessionID() string

type AndroidLocator added in v0.0.48

type AndroidLocator struct {
	// contains filtered or unexported fields
}

func (*AndroidLocator) App added in v0.0.53

func (l *AndroidLocator) App() *AndroidApp

func (*AndroidLocator) Click added in v0.0.48

func (l *AndroidLocator) Click(ctx context.Context, options ...CommandOptions) (*ClickResult, error)

func (*AndroidLocator) Count added in v0.0.57

func (l *AndroidLocator) Count(ctx context.Context, options ...CommandOptions) (*CountResult, error)

func (*AndroidLocator) Fill added in v0.0.48

func (l *AndroidLocator) Fill(ctx context.Context, value string, options ...CommandOptions) (*FillResult, error)

func (*AndroidLocator) Focus added in v0.0.57

func (l *AndroidLocator) Focus(ctx context.Context, options ...CommandOptions) (*ElementResult, error)

func (*AndroidLocator) InnerText added in v0.0.57

func (l *AndroidLocator) InnerText(ctx context.Context, options ...CommandOptions) (*TextResult, error)

func (*AndroidLocator) Locator added in v0.0.48

func (l *AndroidLocator) Locator(selector string) *AndroidLocator

func (*AndroidLocator) Press added in v0.0.57

func (l *AndroidLocator) Press(ctx context.Context, key string, options ...PressOptions) (*PressResult, error)

func (*AndroidLocator) Selector added in v0.0.48

func (l *AndroidLocator) Selector() string

func (*AndroidLocator) TextContent added in v0.0.57

func (l *AndroidLocator) TextContent(ctx context.Context, options ...CommandOptions) (*TextResult, error)

func (*AndroidLocator) WaitFor added in v0.0.57

type AndroidSurface added in v0.0.45

type AndroidSurface struct{}

func (AndroidSurface) Connect added in v0.0.45

type Browser

type Browser struct {
	// contains filtered or unexported fields
}

func LaunchBrowser added in v0.0.27

func LaunchBrowser(ctx context.Context, browserKind enginev1.BrowserKind, options LaunchOptions) (*Browser, error)

func LaunchChrome

func LaunchChrome(ctx context.Context, options LaunchOptions) (*Browser, error)

func LaunchConfiguredBrowser added in v0.0.30

func LaunchConfiguredBrowser(ctx context.Context, config *ResolvedConfig) (*Browser, error)

func LaunchFirefox added in v0.0.27

func LaunchFirefox(ctx context.Context, options LaunchOptions) (*Browser, error)

func (*Browser) BrowserName

func (b *Browser) BrowserName() string

func (*Browser) CdpWebSocketURL

func (b *Browser) CdpWebSocketURL() string

func (*Browser) Close

func (b *Browser) Close(ctx context.Context) error

func (*Browser) InitialPage added in v0.0.27

func (b *Browser) InitialPage() *Page

func (*Browser) InitialTab

func (b *Browser) InitialTab() *Tab

func (*Browser) LaunchNote

func (b *Browser) LaunchNote() string

func (*Browser) NewPage added in v0.0.27

func (b *Browser) NewPage(ctx context.Context, options ...CommandOptions) (*Page, error)

func (*Browser) NewTab

func (b *Browser) NewTab(ctx context.Context, options ...CommandOptions) (*Tab, error)

func (*Browser) Page added in v0.0.27

func (b *Browser) Page() *Page

func (*Browser) Ping

func (b *Browser) Ping(ctx context.Context, message string) (string, error)

func (*Browser) SessionID

func (b *Browser) SessionID() string

func (*Browser) UserDataDir

func (b *Browser) UserDataDir() string

type BrowserType added in v0.0.27

type BrowserType struct {
	// contains filtered or unexported fields
}

func (BrowserType) Launch added in v0.0.27

func (bt BrowserType) Launch(ctx context.Context, options LaunchOptions) (*Browser, error)

type ClickResult

type ClickResult struct {
	Selector      string
	Note          string
	BidiSessionID string
}

type CommandOptions added in v0.0.3

type CommandOptions struct {
	Timeout time.Duration
}

type CountResult added in v0.0.3

type CountResult struct {
	Selector string
	Count    uint32
	Note     string
}

type ElementResult added in v0.0.5

type ElementResult struct {
	Selector string
	Note     string
}

type FillResult added in v0.0.5

type FillResult struct {
	Selector string
	Value    string
	Note     string
}

type HighlightOptions added in v0.0.3

type HighlightOptions struct {
	Timeout  time.Duration
	Duration time.Duration
}

type HighlightResult added in v0.0.3

type HighlightResult struct {
	Selector string
	Count    uint32
	Note     string
}

type LaunchOptions

type LaunchOptions struct {
	BrowserBinary string
	Timeout       time.Duration
}

type Locator added in v0.0.27

type Locator struct {
	// contains filtered or unexported fields
}

func (*Locator) Click added in v0.0.27

func (l *Locator) Click(ctx context.Context, options ...CommandOptions) (*ClickResult, error)

func (*Locator) Count added in v0.0.27

func (l *Locator) Count(ctx context.Context, options ...CommandOptions) (*CountResult, error)

func (*Locator) Fill added in v0.0.27

func (l *Locator) Fill(ctx context.Context, value string, options ...CommandOptions) (*FillResult, error)

func (*Locator) Focus added in v0.0.27

func (l *Locator) Focus(ctx context.Context, options ...CommandOptions) (*ElementResult, error)

func (*Locator) Highlight added in v0.0.27

func (l *Locator) Highlight(ctx context.Context, options ...HighlightOptions) (*HighlightResult, error)

func (*Locator) Hover added in v0.0.27

func (l *Locator) Hover(ctx context.Context, options ...CommandOptions) (*ElementResult, error)

func (*Locator) InnerText added in v0.0.27

func (l *Locator) InnerText(ctx context.Context, options ...CommandOptions) (*TextResult, error)

func (*Locator) Locator added in v0.0.27

func (l *Locator) Locator(selector string) *Locator

func (*Locator) Page added in v0.0.27

func (l *Locator) Page() *Page

func (*Locator) Press added in v0.0.27

func (l *Locator) Press(ctx context.Context, key string, options ...PressOptions) (*PressResult, error)

func (*Locator) Selector added in v0.0.27

func (l *Locator) Selector() string

func (*Locator) TextContent added in v0.0.27

func (l *Locator) TextContent(ctx context.Context, options ...CommandOptions) (*TextResult, error)

func (*Locator) WaitFor added in v0.0.27

func (l *Locator) WaitFor(ctx context.Context, options ...WaitForSelectorOptions) (*WaitForSelectorResult, error)

type MobileAndroidConnectOptions added in v0.0.45

type MobileAndroidConnectOptions struct {
	Device           string
	AdbEndpoint      string
	PreserveAppState bool
	Timeout          uint32
}

type MobileAndroidLaunchOptions added in v0.0.45

type MobileAndroidLaunchOptions struct {
	APKPath          string
	AppID            string
	LaunchActivity   string
	StopBeforeLaunch bool
	Timeout          uint32
}
type NavigateResult struct {
	URL             string
	Note            string
	BidiSessionID   string
	MapperTargetID  string
	MapperSessionID string
	PackageVersion  string
}

type Page added in v0.0.27

type Page = Tab

type PressOptions added in v0.0.5

type PressOptions struct {
	Timeout time.Duration
	Text    string
}

type PressResult added in v0.0.5

type PressResult struct {
	Selector string
	Key      string
	Note     string
}

type ResolveConfigOptions added in v0.0.30

type ResolveConfigOptions struct {
	Cwd        string
	ConfigFile string
	Suite      string
}

type ResolvedConfig added in v0.0.30

type ResolvedConfig struct {
	ConfigFilePath string
	SuiteName      string
	ServerAddr     string
	BrowserName    string
	BrowserBinary  string
	LaunchOptions  LaunchOptions
	Expect         RetryConfig
	Web            *configWeb
	Mobile         *configMobile
	Desktop        *configDesktop
}

func ResolveConfig added in v0.0.30

func ResolveConfig(options ResolveConfigOptions) (*ResolvedConfig, error)

type RetryConfig added in v0.0.30

type RetryConfig struct {
	TimeoutMs  uint32 `json:"timeoutMs,omitempty" yaml:"timeoutMs,omitempty"`
	IntervalMs uint32 `json:"intervalMs,omitempty" yaml:"intervalMs,omitempty"`
}

type ScreenshotOptions added in v0.0.55

type ScreenshotOptions struct {
	Timeout  time.Duration
	FullPage bool
	Path     string
}

type ScreenshotResult added in v0.0.54

type ScreenshotResult struct {
	PNGData []byte
	Note    string
}

type Tab

type Tab struct {
	// contains filtered or unexported fields
}

func (*Tab) Click

func (t *Tab) Click(ctx context.Context, cssSelector string, options ...CommandOptions) (*ClickResult, error)

func (*Tab) Close

func (t *Tab) Close(ctx context.Context) error

func (*Tab) Count added in v0.0.3

func (t *Tab) Count(ctx context.Context, cssSelector string, options ...CommandOptions) (*CountResult, error)

func (*Tab) Fill added in v0.0.5

func (t *Tab) Fill(ctx context.Context, cssSelector string, value string, options ...CommandOptions) (*FillResult, error)

func (*Tab) Focus added in v0.0.5

func (t *Tab) Focus(ctx context.Context, cssSelector string, options ...CommandOptions) (*ElementResult, error)

func (*Tab) Goto added in v0.0.27

func (t *Tab) Goto(ctx context.Context, url string, options ...CommandOptions) (*NavigateResult, error)

func (*Tab) Highlight added in v0.0.3

func (t *Tab) Highlight(ctx context.Context, cssSelector string, options ...HighlightOptions) (*HighlightResult, error)

func (*Tab) Hover added in v0.0.5

func (t *Tab) Hover(ctx context.Context, cssSelector string, options ...CommandOptions) (*ElementResult, error)

func (*Tab) InnerText added in v0.0.5

func (t *Tab) InnerText(ctx context.Context, cssSelector string, options ...CommandOptions) (*TextResult, error)

func (*Tab) Locator added in v0.0.27

func (t *Tab) Locator(selector string) *Locator

func (*Tab) Navigate

func (t *Tab) Navigate(ctx context.Context, url string, options ...CommandOptions) (*NavigateResult, error)

func (*Tab) Ping

func (t *Tab) Ping(ctx context.Context, message string) (string, error)

func (*Tab) Press added in v0.0.5

func (t *Tab) Press(ctx context.Context, cssSelector string, key string, options ...PressOptions) (*PressResult, error)

func (*Tab) Screenshot added in v0.0.54

func (t *Tab) Screenshot(ctx context.Context, options ...ScreenshotOptions) (*ScreenshotResult, error)

func (*Tab) SessionID

func (t *Tab) SessionID() string

func (*Tab) TextContent added in v0.0.5

func (t *Tab) TextContent(ctx context.Context, cssSelector string, options ...CommandOptions) (*TextResult, error)

func (*Tab) WaitForSelector added in v0.0.5

func (t *Tab) WaitForSelector(ctx context.Context, cssSelector string, options ...WaitForSelectorOptions) (*WaitForSelectorResult, error)

type TextResult added in v0.0.5

type TextResult struct {
	Selector string
	Text     string
	Note     string
}

type WaitForSelectorOptions added in v0.0.5

type WaitForSelectorOptions struct {
	Timeout time.Duration
	Visible *bool
}

type WaitForSelectorResult added in v0.0.5

type WaitForSelectorResult struct {
	Selector string
	Visible  bool
	Note     string
}

Directories

Path Synopsis
examples
android-basic command
web-basic command
gen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL