browser_testbed

package
v0.51.4 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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LayoutServer

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

LayoutServer provides a WebSocket-based RPC server for browser layout E2E tests. It exposes a LayoutHost service that can be connected to from browser tests.

func NewLayoutServer

func NewLayoutServer(le *logrus.Entry) *LayoutServer

NewLayoutServer creates a new LayoutServer.

func (*LayoutServer) DrainLayoutUpdates

func (s *LayoutServer) DrainLayoutUpdates()

DrainLayoutUpdates drains any pending layout updates.

func (*LayoutServer) GetLayoutModel

func (s *LayoutServer) GetLayoutModel() *s4wave_layout.LayoutModel

GetLayoutModel returns the current layout model.

func (*LayoutServer) GetPort

func (s *LayoutServer) GetPort() int

GetPort returns the port the server is listening on, or 0 if not running.

func (*LayoutServer) SetLayoutModel

func (s *LayoutServer) SetLayoutModel(model *s4wave_layout.LayoutModel)

SetLayoutModel sets the current layout model (server-initiated). This will be streamed to connected clients via WatchLayoutModel.

func (*LayoutServer) Start

func (s *LayoutServer) Start(ctx context.Context) (int, error)

Start starts the WebSocket server on a random available port. Returns the port number the server is listening on.

func (*LayoutServer) Stop

func (s *LayoutServer) Stop(ctx context.Context) error

Stop stops the server.

func (*LayoutServer) WaitForLayoutUpdate

func (s *LayoutServer) WaitForLayoutUpdate(ctx context.Context) (*s4wave_layout.LayoutModel, error)

WaitForLayoutUpdate waits for the frontend to push a layout update. Returns the updated model or an error if ctx is canceled.

func (*LayoutServer) WaitForNavigateTab

func (s *LayoutServer) WaitForNavigateTab(ctx context.Context) (*s4wave_layout.NavigateTabRequest, error)

WaitForNavigateTab waits for the frontend to navigate within a tab. Returns the navigate request or an error if ctx is canceled.

type Server

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

Server provides a WebSocket-based RPC server for browser E2E tests. It exposes an srpc.Mux over WebSocket for browser clients.

func NewServer

func NewServer(le *logrus.Entry, mux srpc.Mux) *Server

NewServer creates a new Server with the given mux.

func (*Server) GetPort

func (s *Server) GetPort() int

GetPort returns the port the server is listening on, or 0 if not running.

func (*Server) Start

func (s *Server) Start(ctx context.Context) (int, error)

Start starts the WebSocket server on a random available port. Returns the port number the server is listening on.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop stops the server.

Jump to

Keyboard shortcuts

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