common

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FeaturesDir is the name given to the features directory in a Kosher project
	FeaturesDir = "features"

	// ConfigDir is the name given to the config directory in a Kosher project
	ConfigDir = "config"

	// ResultsDir is the name given to the results directory where test results are written
	ResultsDir = "results"

	// MacrosDir is the name given to the macros directory where marcros are stored
	MacrosDir = "macros"

	// ResourcesDir is the name given to the resources directory where resource files are kept
	ResourcesDir = "resources"

	// ResultsBootstrapFile is the name given to the HTML report generated
	ResultsBootstrapFile = "results-bootstrap.html"

	// ResultsSimpleFile is the name given to the HTML report generated
	ResultsSimpleFile = "results-simple.html"

	// ResultsJSONFile is the name given to the Cucumber format JSON results generated
	ResultsJSONFile = "cucumber.json"

	// AxeResultsHTMLFile is the name given to the HTML report generated for Axe scans
	AxeResultsHTMLFile = "axe-results.html"

	// AxeResultsJSONFile is the name given to the JSON file generated for Axe scans
	AxeResultsJSONFile = "axe-results.json"

	// EnvironmentsFile is the name given to the environments file in a Kosher project
	EnvironmentsFile = "environments.json"

	// PagesFile is the name given to the pages file in a Kosher project
	PagesFile = "pages.json"

	// SelectorsFile is the name given to the selectors file in a Kosher project
	SelectorsFile = "selectors.json"

	// SettingsFile is the name given to the settings file in a Kosher project
	SettingsFile = "settings.json"

	// ExampleFeatureFile is the name given to the sample feature provided when a project is initialized
	ExampleFeatureFile = "example.feature"

	// DefaultScreenFormat is the default screen format
	DefaultScreenFormat = "desktop"

	// DefaultScreenWidth is the fail-safe screen width
	DefaultScreenWidth = 1024

	// DefaultScreenHeight is the fail-safe screen height
	DefaultScreenHeight = 768
)

Variables

View Source
var CurrentVersion = &Version{
	Major: 1,
	Minor: 11,
	Patch: 0,
}

CurrentVersion is the current version of Kosher; the one, true version number in this code base.

Functions

func BuildTestProject added in v1.7.0

func BuildTestProject(fs afero.Fs) error

BuildTestProject is intended for using during unit testing to build an in-memory representation of the project

func CaptureStdout added in v1.7.0

func CaptureStdout(task func()) string

CaptureStdout executes a task and returns any text it wrote to Stdout

func FormatDate

func FormatDate(t time.Time, dateFormat string) string

FormatDate converts a `time.Time` to a string using the `dateFormat` value specified in the settings file

func ParseDate

func ParseDate(date string, dateFormat string) time.Time

ParseDate parses a given string to a `time.Time` using the `dateFormat` value specified in the settings file

func StringSliceContains added in v1.4.0

func StringSliceContains(s []string, v string) bool

StringSliceContains returns true if the SORTED slice `s` contains `v`.

func StringSliceContainsFold added in v1.4.0

func StringSliceContainsFold(s []string, v string) bool

StringSliceContainsFold returns true if the SORTED slice `s` contains `v`, ignoring case.

Types

type Version

type Version struct {
	Major  int
	Minor  int
	Patch  int
	Suffix string
}

Version represents a fully qualified version number

func (*Version) Version

func (v *Version) Version() string

Version returns the version information in string form (e.g. 1.02.55)

Jump to

Keyboard shortcuts

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