electron

package
v0.51.3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package electron provides an opt-in Electron E2E harness backed by the existing Bldr desktop runtime.

Index

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

func Boot(ctx context.Context, le *logrus.Entry) (_ *Harness, retErr error)

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

func (h *Harness) ActivateApp(ctx context.Context) error

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

func (h *Harness) ArtifactDir() string

ArtifactDir returns the E2E artifact directory.

func (*Harness) CDPEndpoint

func (h *Harness) CDPEndpoint() string

CDPEndpoint returns the local Electron CDP HTTP endpoint.

func (*Harness) CLISocketPath

func (h *Harness) CLISocketPath() string

CLISocketPath returns the dev-mode Spacewave daemon socket path.

func (*Harness) ConnectDriver

func (h *Harness) ConnectDriver() error

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

func (h *Harness) ControlEndpoint() string

ControlEndpoint returns the local Electron main e2e control endpoint.

func (*Harness) E2EControlEndpoint added in v0.51.3

func (h *Harness) E2EControlEndpoint() string

E2EControlEndpoint returns the local Electron-main e2e control endpoint.

func (*Harness) LastLogFilePath added in v0.51.3

func (h *Harness) LastLogFilePath() string

LastLogFilePath returns the devtool log path for the latest runtime start.

func (*Harness) Relaunch

func (h *Harness) Relaunch(ctx context.Context) error

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) RepoRoot

func (h *Harness) RepoRoot() string

RepoRoot returns the project repository root used by the harness.

func (*Harness) SpacewaveDataRoot added in v0.51.3

func (h *Harness) SpacewaveDataRoot() string

SpacewaveDataRoot returns the short scratch SPACEWAVE_DATA_DIR.

func (*Harness) StateRoot

func (h *Harness) StateRoot() string

StateRoot returns the isolated Bldr state root used by the harness.

func (*Harness) WaitForAppPageCount added in v0.51.3

func (h *Harness) WaitForAppPageCount(
	ctx context.Context,
	count int,
) ([]playwright.Page, error)

WaitForAppPageCount waits until exactly count renderer pages are visible.

func (*Harness) WaitForAppPages

func (h *Harness) WaitForAppPages(
	ctx context.Context,
	count int,
) ([]playwright.Page, error)

WaitForAppPages waits until at least count renderer pages are visible.

func (*Harness) WaitForNoAppPages

func (h *Harness) WaitForNoAppPages(ctx context.Context) error

WaitForNoAppPages waits until no app renderer pages are visible.

func (*Harness) WaitForPage

func (h *Harness) WaitForPage(ctx context.Context) (playwright.Page, error)

WaitForPage waits until a renderer page is visible through the CDP driver.

Jump to

Keyboard shortcuts

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