config

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	KindCypress = "cypress"
)

Kind* contains referenced config kinds

View Source
const (
	VersionV1Alpha = "v1alpha"
)

Version* contains referenced config version

Variables

This section is empty.

Functions

func StandardizeVersionFormat added in v0.24.0

func StandardizeVersionFormat(version string) string

StandardizeVersionFormat remove the leading v in version to ensure reliable comparisons.

Types

type Docker added in v0.19.0

type Docker struct {
	FileTransfer DockerFileMode `yaml:"fileTransfer,omitempty" json:"fileTransfer"`
	Image        Image          `yaml:"image,omitempty" json:"image"`
}

Docker represents docker settings.

type DockerFileMode added in v0.21.0

type DockerFileMode string

DockerFileMode represent the file providing method

const (
	DockerFileMount DockerFileMode = "mount"
	DockerFileCopy  DockerFileMode = "copy"
)

DockerFile* represent the different modes

type Image added in v0.19.0

type Image struct {
	Name string `yaml:"name,omitempty" json:"name"`
	Tag  string `yaml:"tag,omitempty" json:"tag"`
}

Image represents the docker image.

type ImageDefinition

type ImageDefinition struct {
	Base    string                 `yaml:"base,omitempty"`
	Version string                 `yaml:"version,omitempty"`
	Exec    string                 `yaml:"exec,omitempty"`
	Options map[string]interface{} `yaml:"options,omitempty"`
}

ImageDefinition describe configuration to the testrunner image

type Metadata

type Metadata struct {
	Name  string   `yaml:"name" json:"name"`
	Tags  []string `yaml:"tags" json:"tags,omitempty"`
	Build string   `yaml:"build" json:"build"`
}

Metadata describes job metadata

func (*Metadata) ExpandEnv added in v0.9.1

func (m *Metadata) ExpandEnv()

ExpandEnv expands environment variables inside metadata fields.

Example
os.Setenv("tname", "Envy")
os.Setenv("ttag", "xp1")
os.Setenv("tbuild", "Bob")

m := Metadata{
	Name:  "Test $tname",
	Tags:  []string{"$ttag"},
	Build: "Build $tbuild",
}

m.ExpandEnv()

fmt.Println(m)
Output:

{Test Envy [xp1] Build Bob}

type Npm added in v0.20.0

type Npm struct {
	Packages map[string]string `yaml:"packages,omitempty" json:"packages"`
}

Npm represents the npm settings

type Project added in v0.11.0

type Project struct {
	TypeDef      `yaml:",inline"`
	Metadata     Metadata          `yaml:"metadata,omitempty"`
	Suites       []Suite           `yaml:"suites,omitempty"`
	Files        []string          `yaml:"files,omitempty"`
	FileTransfer DockerFileMode    `yaml:"fileTransfer,omitempty"`
	Image        ImageDefinition   `yaml:"image,omitempty"`
	BeforeExec   []string          `yaml:"beforeExec,omitempty"`
	Timeout      int               `yaml:"timeout,omitempty"`
	Sauce        SauceConfig       `yaml:"sauce,omitempty"`
	Env          map[string]string `yaml:"env,omitempty"`
	Parallel     bool              `yaml:"parallel,omitempty"`
	Npm          Npm               `yaml:"npm,omitempty"`
}

Project represents the project configuration.

func NewJobConfiguration

func NewJobConfiguration(cfgFilePath string) (Project, error)

NewJobConfiguration creates a new job configuration based on a config file

func (*Project) SyncCapabilities added in v0.14.0

func (p *Project) SyncCapabilities()

SyncCapabilities uses the project capabilities if no settings have been defined in the suites.

type Run added in v0.12.0

type Run struct {
	Match       []string `yaml:"match"`
	ProjectPath string   `yaml:"projectPath"`
}

Run represents the configuration for a particular test run. This information is communicated to the test framework.

type RunnerConfiguration

type RunnerConfiguration struct {
	RootDir     string   `yaml:"rootDir"`
	TargetDir   string   `yaml:"targetDir"`
	ExecCommand []string `yaml:"execCommand"`
}

RunnerConfiguration describes configurations for the testrunner

func NewRunnerConfiguration

func NewRunnerConfiguration(cfgFilePath string) (RunnerConfiguration, error)

NewRunnerConfiguration reads yaml file for runner configurations

type SauceConfig added in v0.8.0

type SauceConfig struct {
	Region      string   `yaml:"region,omitempty" json:"region"`
	Metadata    Metadata `yaml:"metadata,omitempty" json:"metadata"`
	Tunnel      Tunnel   `yaml:"tunnel,omitempty" json:"tunnel,omitempty"`
	Concurrency int      `yaml:"concurrency,omitempty" json:"concurrency,omitempty"`
}

SauceConfig represents sauce labs related settings.

type Settings added in v0.14.0

type Settings struct {
	BrowserName               string   `yaml:"browserName,omitempty"`
	BrowserVersion            string   `yaml:"browserVersion,omitempty"`
	PlatformName              string   `yaml:"platformName,omitempty"`
	AcceptInsecureCerts       bool     `yaml:"acceptInsecureCerts,omitempty"`
	PageLoadStrategy          bool     `yaml:"pageLoadStrategy,omitempty"`
	SetWindowRect             bool     `yaml:"setWindowRect,omitempty"`
	Timeouts                  Timeouts `yaml:"timeouts,omitempty"`
	StrictFileInteractability bool     `yaml:"strictFileInteractability,omitempty"`
	UnhandledPromptBehavior   string   `yaml:"unhandledPromptBehavior,omitempty"`
}

Settings describes job settings

type Suite added in v0.11.0

type Suite struct {
	Name         string   `yaml:"name,omitempty"`
	Capabilities Settings `yaml:"capabilities,omitempty"`
	Settings     Settings `yaml:"settings,omitempty"`
	Match        string   `yaml:"match,omitempty"`
}

Suite represents the test suite configuration.

type Timeouts

type Timeouts struct {
	Script   int `yaml:"script,omitempty"`
	PageLoad int `yaml:"pageLoad,omitempty"`
	Implicit int `yaml:"implicit,omitempty"`
}

Timeouts describes WebDriver timeouts

type Tunnel added in v0.22.0

type Tunnel struct {
	ID     string `yaml:"id,omitempty" json:"id"`
	Parent string `yaml:"parent,omitempty" json:"parent,omitempty"`
}

Tunnel represents a sauce labs tunnel.

type TypeDef added in v0.19.0

type TypeDef struct {
	APIVersion string `yaml:"apiVersion,omitempty"`
	Kind       string `yaml:"kind,omitempty"`
}

TypeDef represents the type definition of the config.

func Describe added in v0.19.0

func Describe(cfgPath string) (TypeDef, error)

Describe returns a description of the given config that is cfgPath.

Jump to

Keyboard shortcuts

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