cypress

package
v0.39.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitSuites added in v0.38.0

func SplitSuites(p Project) (Project, Project)

SplitSuites divided Suites to dockerSuites and sauceSuites

func Validate added in v0.23.3

func Validate(p Project) error

Validate validates basic configuration of the project and returns an error if any of the settings contain illegal values. This is not an exhaustive operation and further validation should be performed both in the client and/or server side depending on the workflow that is executed.

Types

type Cypress

type Cypress struct {
	// ConfigFile is the path to "cypress.json".
	ConfigFile string `yaml:"configFile,omitempty" json:"configFile"`

	// Version represents the cypress framework version.
	Version string `yaml:"version" json:"version"`

	// Record represents the cypress framework record flag.
	Record bool `yaml:"record" json:"record"`

	// Key represents the cypress framework key flag.
	Key string `yaml:"key" json:"key"`

	// ProjectPath is the path to the cypress directory itself. Not set by the user, but is instead based on the
	// location of ConfigFile.
	ProjectPath string `yaml:"-" json:"-"`

	// EnvFile is the path to cypress.env.json. Not set by the user, but is instead based on the location of ConfigFile.
	EnvFile string `yaml:"-" json:"-"`
}

Cypress represents crucial cypress configuration that is required for setting up a project.

type Project

type Project struct {
	config.TypeDef `yaml:",inline"`
	Defaults       config.Defaults `yaml:"defaults" json:"defaults"`
	ShowConsoleLog bool
	ConfigFilePath string             `yaml:"-" json:"-"`
	DryRun         bool               `yaml:"-" json:"-"`
	Sauce          config.SauceConfig `yaml:"sauce,omitempty" json:"sauce"`
	Cypress        Cypress            `yaml:"cypress,omitempty" json:"cypress"`
	Suites         []Suite            `yaml:"suites,omitempty" json:"suites"`
	BeforeExec     []string           `yaml:"beforeExec,omitempty" json:"beforeExec"`
	Docker         config.Docker      `yaml:"docker,omitempty" json:"docker"`
	Npm            config.Npm         `yaml:"npm,omitempty" json:"npm"`
	RootDir        string             `yaml:"rootDir,omitempty" json:"rootDir"`
	RunnerVersion  string             `yaml:"runnerVersion,omitempty" json:"runnerVersion"`
	Artifacts      config.Artifacts   `yaml:"artifacts,omitempty" json:"artifacts"`
}

Project represents the cypress project configuration.

func FromFile

func FromFile(cfgPath string) (Project, error)

FromFile creates a new cypress Project based on the filepath cfgPath.

type Suite

type Suite struct {
	Name             string      `yaml:"name,omitempty" json:"name"`
	Browser          string      `yaml:"browser,omitempty" json:"browser"`
	BrowserVersion   string      `yaml:"browserVersion,omitempty" json:"browserVersion"`
	PlatformName     string      `yaml:"platformName,omitempty" json:"platformName"`
	Config           SuiteConfig `yaml:"config,omitempty" json:"config"`
	ScreenResolution string      `yaml:"screenResolution,omitempty" json:"screenResolution"`
	Mode             string      `yaml:"mode,omitempty" json:"-"`
}

Suite represents the cypress test suite configuration.

type SuiteConfig

type SuiteConfig struct {
	TestFiles []string          `yaml:"testFiles,omitempty" json:"testFiles"`
	Env       map[string]string `yaml:"env,omitempty" json:"env"`
}

SuiteConfig represents the cypress config overrides.

Jump to

Keyboard shortcuts

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