Documentation
¶
Overview ¶
Package electron provides an opt-in Electron E2E harness backed by the existing Bldr desktop runtime.
Index ¶
- func E2EElectronEnabled() bool
- type Harness
- func (h *Harness) ActivateApp(ctx context.Context) error
- func (h *Harness) AppPages() []playwright.Page
- func (h *Harness) ArtifactDir() string
- func (h *Harness) CDPEndpoint() string
- func (h *Harness) CLISocketPath() string
- func (h *Harness) CaptureTrayPopoverScreenshot(ctx context.Context, name string) (string, error)
- func (h *Harness) ConnectDriver() error
- func (h *Harness) ControlEndpoint() string
- func (h *Harness) E2EControlEndpoint() string
- func (h *Harness) LastLogFilePath() string
- func (h *Harness) OpenTrayPopover(ctx context.Context) error
- func (h *Harness) Relaunch(ctx context.Context) error
- func (h *Harness) Release()
- func (h *Harness) RepoRoot() string
- func (h *Harness) SpacewaveDataRoot() string
- func (h *Harness) StateRoot() string
- func (h *Harness) WaitForAppPageCount(ctx context.Context, count int) ([]playwright.Page, error)
- func (h *Harness) WaitForAppPages(ctx context.Context, count int) ([]playwright.Page, error)
- func (h *Harness) WaitForNoAppPages(ctx context.Context) error
- func (h *Harness) WaitForPage(ctx context.Context) (playwright.Page, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func E2EElectronEnabled ¶
func E2EElectronEnabled() bool
E2EElectronEnabled reports whether the heavy Electron e2e suite should run.
Types ¶
type Harness ¶
type Harness struct {
// contains filtered or unexported fields
}
Harness owns a Bldr desktop runtime plus a Playwright CDP attachment to the Electron renderer.
func Boot ¶
Boot starts Bldr's current desktop runtime and waits until Electron exposes its debug-only CDP endpoint.
func (*Harness) ActivateApp ¶ added in v0.51.3
ActivateApp triggers the Electron app activation path through the opt-in e2e control endpoint.
func (*Harness) AppPages ¶
func (h *Harness) AppPages() []playwright.Page
AppPages returns the renderer pages visible through the CDP driver.
func (*Harness) ArtifactDir ¶ added in v0.51.3
ArtifactDir returns the E2E artifact directory.
func (*Harness) CDPEndpoint ¶
CDPEndpoint returns the local Electron CDP HTTP endpoint.
func (*Harness) CLISocketPath ¶
CLISocketPath returns the dev-mode Spacewave daemon socket path.
func (*Harness) CaptureTrayPopoverScreenshot ¶ added in v0.51.4
CaptureTrayPopoverScreenshot stores the current opt-in popover screenshot under the harness artifact directory and returns its path.
func (*Harness) ConnectDriver ¶
ConnectDriver attaches Playwright to Electron through the Chrome DevTools Protocol endpoint exposed by the Electron main process.
func (*Harness) ControlEndpoint ¶ added in v0.51.3
ControlEndpoint returns the local Electron main e2e control endpoint.
func (*Harness) E2EControlEndpoint ¶ added in v0.51.3
E2EControlEndpoint returns the local Electron-main e2e control endpoint.
func (*Harness) LastLogFilePath ¶ added in v0.51.3
LastLogFilePath returns the devtool log path for the latest runtime start.
func (*Harness) OpenTrayPopover ¶ added in v0.51.4
OpenTrayPopover triggers the opt-in tray popover through the Electron-main e2e control surface. The popover is available only when BLDR_ELECTRON_DESKTOP_TRAY_POPOVER=1 is set before Boot.
func (*Harness) Relaunch ¶
Relaunch terminates the current Electron runtime, starts it again with the same state root, and reconnects the Playwright CDP driver.
func (*Harness) Release ¶
func (h *Harness) Release()
Release stops Playwright, cancels the Bldr desktop runtime, and restores env.
func (*Harness) SpacewaveDataRoot ¶ added in v0.51.3
SpacewaveDataRoot returns the short scratch SPACEWAVE_DATA_DIR.
func (*Harness) WaitForAppPageCount ¶ added in v0.51.3
WaitForAppPageCount waits until exactly count renderer pages are visible.
func (*Harness) WaitForAppPages ¶
WaitForAppPages waits until at least count renderer pages are visible.
func (*Harness) WaitForNoAppPages ¶
WaitForNoAppPages waits until no app renderer pages are visible.
func (*Harness) WaitForPage ¶
WaitForPage waits until a renderer page is visible through the CDP driver.