Documentation
¶
Index ¶
- type StepUtils
- func (s *StepUtils) FormatDate(t time.Time) string
- func (s *StepUtils) GetFieldType(name string, sel *agouti.Selection) (string, error)
- func (s *StepUtils) GetMaxWindowSize() (int, int)
- func (s *StepUtils) GetSelectOptions(htmlSelect *agouti.Selection) map[string]bool
- func (s *StepUtils) IsFormField(field string, sel *agouti.Selection) bool
- func (s *StepUtils) IsTextBased(field string, sel *agouti.Selection) bool
- func (s *StepUtils) ParseDate(date string) time.Time
- func (s *StepUtils) ReplaceVariables(text string) (string, error)
- func (s *StepUtils) ResolvePage(pageName string) (string, error)
- func (s *StepUtils) ResolveSelector(name string) ([]*agouti.Selection, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StepUtils ¶
type StepUtils struct { Settings *config.Settings Page interfaces.PageService Session interfaces.SessionService }
StepUtils is a set of utility functions tailored to a given Settings object and Agouti Page
func NewStepUtils ¶
func NewStepUtils(settings *config.Settings, page interfaces.PageService) *StepUtils
NewStepUtils creates a new StepUtils struct
func (*StepUtils) FormatDate ¶
FormatDate converts a `time.Time` to a string using the `dateFormat` value specified in the settings file
func (*StepUtils) GetFieldType ¶
GetFieldType attempts to determine which type of form field an element is. `name` is just the string used to identify the field in the user's gherkin script. This may be the label, name, or ID of the field; it, also, may be a key to a selector entry in the selectors file.
func (*StepUtils) GetMaxWindowSize ¶
GetMaxWindowSize attempts to determine and return the window size set
func (*StepUtils) GetSelectOptions ¶
GetSelectOptions returns a map where the keys are the visible text of each option and the values are bools indicating the selected statuses of those options
func (*StepUtils) IsFormField ¶
IsFormField determines if the selection provided is an HTML form field
func (*StepUtils) IsTextBased ¶
IsTextBased determines if a given field is a form of textbox or textarea
func (*StepUtils) ParseDate ¶
ParseDate parses a given string to a `time.Time` using the `dateFormat` value specified in the settings file
func (*StepUtils) ReplaceVariables ¶ added in v1.2.0
ReplaceVariables interpolates variables found in step arguments
func (*StepUtils) ResolvePage ¶
ResolvePage takes a page name and returns its full URL
func (*StepUtils) ResolveSelector ¶
ResolveSelector attempts to retrieve the selector specified by `name` and convert it into an Agouti selector for the provided page. If no selector is found, `name` is used to search by label, name, and ID (in that order).