cucumber

package
v0.125.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Kind represents the type definition of this config.
	Kind = "playwright-cucumberjs"

	// APIVersion represents the supported config version.
	APIVersion = "v1alpha"
)

Config descriptors.

Functions

func FilterSuites

func FilterSuites(p *Project, suiteName string) error

FilterSuites filters out suites in the project that don't match the given suite name.

func IsSharded

func IsSharded(suites []Suite) bool

IsSharded checks if the suite is sharded

func SetDefaults

func SetDefaults(p *Project)

SetDefaults applies config defaults in case the user has left them blank.

func SplitSuites

func SplitSuites(p Project) (Project, Project)

SplitSuites divided Suites to dockerSuites and sauceSuites

func Validate

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 Options

type Options struct {
	Config            string            `yaml:"config,omitempty" json:"config"`
	Name              string            `yaml:"name,omitempty" json:"name"`
	Paths             []string          `yaml:"paths,omitempty" json:"paths"`
	ExcludedTestFiles []string          `yaml:"excludedTestFiles,omitempty" json:"excludedTestFiles"`
	Backtrace         bool              `yaml:"backtrace,omitempty" json:"backtrace"`
	Require           []string          `yaml:"require,omitempty" json:"require"`
	Import            []string          `yaml:"import,omitempty" json:"import"`
	Tags              []string          `yaml:"tags,omitempty" json:"tags"`
	Format            []string          `yaml:"format,omitempty" json:"format"`
	FormatOptions     map[string]string `yaml:"formatOptions,omitempty" json:"formatOptions"`
	Parallel          int               `yaml:"parallel,omitempty" json:"parallel"`
}

Options represents cucumber settings

type Playwright

type Playwright struct {
	// Version represents the playwright framework version.
	Version string `yaml:"version,omitempty" json:"version"`
}

Playwright represents the playwright setting

type Project

type Project struct {
	config.TypeDef `yaml:",inline" mapstructure:",squash"`
	DryRun         bool                   `yaml:"-" json:"-"`
	ShowConsoleLog bool                   `yaml:"showConsoleLog" json:"-"`
	ConfigFilePath string                 `yaml:"-" json:"-"`
	CLIFlags       map[string]interface{} `yaml:"-" json:"-"`
	Sauce          config.SauceConfig     `yaml:"sauce,omitempty" json:"sauce"`
	// Suite is only used as a workaround to parse adhoc suites that are created via CLI args.
	Suite         Suite                `yaml:"suite,omitempty" json:"-"`
	Suites        []Suite              `yaml:"suites,omitempty" json:"suites"`
	BeforeExec    []string             `yaml:"beforeExec,omitempty" json:"beforeExec"`
	Docker        config.Docker        `yaml:"docker,omitempty" json:"docker"`
	Playwright    Playwright           `yaml:"playwright,omitempty" json:"playwright"`
	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"`
	Reporters     config.Reporters     `yaml:"reporters,omitempty" json:"-"`
	Defaults      config.Defaults      `yaml:"defaults,omitempty" json:"defaults"`
	Env           map[string]string    `yaml:"env,omitempty" json:"env"`
	Notifications config.Notifications `yaml:"notifications,omitempty" json:"-"`
}

Project represents cucumber sauce config

func FromFile

func FromFile(cfgPath string) (Project, error)

FromFile creates a new cucumber project based on the filepath.

type Suite

type Suite struct {
	Name             string            `yaml:"name,omitempty" json:"name"`
	BrowserName      string            `yaml:"browserName,omitempty" json:"browserName"`
	BrowserVersion   string            `yaml:"browserVersion,omitempty" json:"browserVersion"`
	PlatformName     string            `yaml:"platformName,omitempty" json:"platformName"`
	Env              map[string]string `yaml:"env,omitempty" json:"env"`
	Shard            string            `yaml:"shard,omitempty" json:"shard"`
	Mode             string            `yaml:"mode,omitemty" json:"mode"`
	Timeout          time.Duration     `yaml:"timeout,omitempty" json:"timeout"`
	ScreenResolution string            `yaml:"screenResolution,omitempty" json:"screenResolution"`
	PreExec          []string          `yaml:"preExec,omitempty" json:"preExec"`
	Options          Options           `yaml:"options,omitempty" json:"options"`
	PassThreshold    int               `yaml:"passThreshold,omitempty" json:"-"`
}

Suite represents the playwright-cucumberjs test suite configuration.

func SortByHistory

func SortByHistory(suites []Suite, history insights.JobHistory) []Suite

SortByHistory sorts the suites in the order of job history

Jump to

Keyboard shortcuts

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