browser

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 31 Imported by: 4

Documentation

Overview

Package browser is the browser module's entry point, and initializer of various global types, and a translation layer between sobek and the internal business logic.

It initializes and drives the downstream components by passing the necessary concrete dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSModule

type JSModule struct {
	Browser         *sobek.Object
	Devices         map[string]common.Device
	NetworkProfiles map[string]common.NetworkProfile `js:"networkProfiles"`
}

JSModule exposes the properties available to the JS script.

type ModuleInstance

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

ModuleInstance represents an instance of the JS module.

func (*ModuleInstance) Exports

func (mi *ModuleInstance) Exports() k6modules.Exports

Exports returns the exports of the JS module so that it can be used in test scripts.

type RootModule

type RootModule struct {
	PidRegistry *pidRegistry
	// contains filtered or unexported fields
}

RootModule is the global module instance that will create module instances for each VU.

func New

func New() *RootModule

New returns a pointer to a new RootModule instance.

func NewSync added in v1.6.0

func NewSync() *RootModule

NewSync returns a pointer to a new RootModule instance that maps the browser's business logic to the synchronous version of the module's JS API.

func (*RootModule) NewModuleInstance

func (m *RootModule) NewModuleInstance(vu k6modules.VU) k6modules.Instance

NewModuleInstance implements the k6modules.Module interface to return a new instance for each VU.

Jump to

Keyboard shortcuts

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