cucumber

package
v0.175.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 14 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 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 is a regular expression for selecting scenario names.
	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"`
	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"`
	EnvFlag       map[string]string    `yaml:"-" json:"-"`
	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.

func (*Project) FilterFailedTests added in v0.138.0

func (p *Project) FilterFailedTests(suiteName string, report saucereport.SauceReport) error

FilterFailedTests takes the failed specs in the report and sets them as a test filter in the suite. The test filter remains unchanged if the report does not contain any failed tests.

func (*Project) IsSmartRetried added in v0.148.0

func (p *Project) IsSmartRetried() bool

IsSmartRetried checks if the suites contain a smartRetried suite

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"`
	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:"-"`
	SmartRetry       config.SmartRetry `yaml:"smartRetry,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