Documentation
¶
Overview ¶
Package environment provides an interface for defining how browser environments are managed.
Index ¶
- type Base
- func (b *Base) Healthy(context.Context) error
- func (b *Base) Name() string
- func (b *Base) SetUp(ctx context.Context) error
- func (b *Base) StartSession(ctx context.Context, id int, caps *capabilities.Capabilities) (*capabilities.Capabilities, error)
- func (b *Base) StopSession(ctx context.Context, _ int) error
- func (b *Base) TearDown(ctx context.Context) error
- func (*Base) WDAddress(context.Context) string
- type Env
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
*metadata.Metadata
diagnostics.Diagnostics
// contains filtered or unexported fields
}
Base is a partial implementation of Env useful as the base struct for implementations of Env.
func NewBase ¶
func NewBase(name string, m *metadata.Metadata, d diagnostics.Diagnostics) (*Base, error)
NewBase creates a new Base environment with the given component name.
func (*Base) Healthy ¶
Healthy returns nil (i.e., healthy) iff the environment has been started and has not yet been stopped.
func (*Base) StartSession ¶
func (b *Base) StartSession(ctx context.Context, id int, caps *capabilities.Capabilities) (*capabilities.Capabilities, error)
StartSession merges the passed in caps with b.Metadata.Capabilities and returns the merged capabilities that should be used when calling new session on the WebDriver server.
func (*Base) StopSession ¶
StopSession is a no-op implementation of Env.StopSession.
type Env ¶
type Env interface {
healthreporter.HealthReporter
// SetUp is called once at the beginning of the test run, and should start a
// WebDriver server. It is not necessary that the environment be healthy when
// this returns.
SetUp(ctx context.Context) error
// StartSession is called for each new WebDriver session, before the new
// session command is sent to the WebDriver server. caps is the capabilities
// sent to the proxy from the client, and the return value is the capabilities
// that should be actually sent to the WebDriver server new session command.
StartSession(ctx context.Context, id int, caps *capabilities.Capabilities) (*capabilities.Capabilities, error)
// StopSession is called for each new WebDriver session, before the delete
// session command is sent to the WebDriver server.
StopSession(ctx context.Context, id int) error
// TearDown is called at the end of the test run.
TearDown(ctx context.Context) error
// WDAddress returns the address of the WebDriver server.
WDAddress(context.Context) string
}
Env allows web_test environments to be started for controlling a browser using Selenium WebDriver.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package external works with an externally started WebDriver server located at EXTERNAL_WEBDRIVER_SERVER_ADDRESS.
|
Package external works with an externally started WebDriver server located at EXTERNAL_WEBDRIVER_SERVER_ADDRESS. |
|
Package local provides a basic environment for web tests locally.
|
Package local provides a basic environment for web tests locally. |
|
Package sauce provides a simple environment for accessing a SauceLabs browser.
|
Package sauce provides a simple environment for accessing a SauceLabs browser. |