package
2.0.0+incompatible
Repository: https://github.com/grafana/xk6-browser.git
Documentation: pkg.go.dev

# Packages

Package k6test provides mock implementations of k6 elements for testing purposes.

# Functions

Abort will shutdown the whole test run.
AbortingPromise is like Promise, but it aborts the event loop if an error occurs.
GetCustomMetrics returns the CustomK6Metrics object attached to the context.
GetScenarioName returns the scenario name associated with the given context.
GetScenarioOpts returns the browser options and environment variables associated with the given context.
GetVU returns the attached k6 VU instance from ctx, which can be used to retrieve the sobek runtime and other k6 objects relevant to the currently executing VU.
Panic will cause a panic with the given error which will stop the current iteration.
Promise runs fn in a goroutine and returns a new sobek.Promise.
RegisterCustomMetrics creates and registers our custom metrics with the k6 VU Registry and returns our internal struct pointer.
Runtime is a convenience function for getting a k6 VU runtime.
WithCustomMetrics attaches the CustomK6Metrics object to the context.
WithVU returns a new context based on ctx with the k6 VU instance attached.

# Structs

CustomMetrics are the custom k6 metrics used by xk6-browser.
UserFriendlyError maps an internal error to an error that users can easily understand.

# Type aliases

PromisifiedFunc is a type of the function to run as a promise.