Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionReportItem ¶ added in v0.2.1
type ActionsReport ¶ added in v0.2.1
type ActionsReport map[string]ActionReportItem
type Auth ¶
type Auth struct { Username Element `yaml:"username" json:"username"` Password Element `yaml:"password" json:"password"` ConfirmPassword Element `yaml:"confirmPassword,omitempty" json:"confirmPassword,omitempty"` RequireConfirm bool `yaml:"requireConfirm,omitempty" json:"requireConfirm,omitempty"` IdpManaged bool `yaml:"idpManaged" json:"idpManaged"` IdpSelector *Element `yaml:"idpSelector,omitempty" json:"idpSelector,omitempty"` MfaSelector *Element `yaml:"mfaSelector,omitempty" json:"mfaSelector,omitempty"` IdpUrl string `yaml:"idpUrl" json:"idpUrl"` Submit Element `yaml:"submit" json:"submit"` }
type BaseConfig ¶ added in v0.1.2
type BaseConfig struct { BaseUrl string `yaml:"baseUrl" json:"baseUrl"` LauncherConfig *WebConfig `yaml:"browserConfig,omitempty" json:"browserConfig,omitempty"` ContinueOnError bool `yaml:"continueOnError" json:"continueOnError"` IsSinglePageApp bool `yaml:"isSinglePageApp" json:"isSinglePageApp"` }
BaseConfig is the base config object each web session will have its own go routine to run the entire session Auth -> LoggedInPage ->[]Actions
type ElementAction ¶ added in v0.1.2
type ElementAction struct { Name string `yaml:"name" json:"name"` Element Element `yaml:"element" json:"element"` Assert bool `yaml:"assert,omitempty" json:"assert,omitempty"` SkipOnErrorMessage string `yaml:"skipOnErrorMessage,omitempty" json:"skipOnErrorMessage,omitempty"` CaptureOutput bool `yaml:"captureOutput,omitempty" json:"captureOutput,omitempty"` // contains filtered or unexported fields }
ElementAction
type IframeAction ¶ added in v0.1.2
type IframeAction struct { Selector string `yaml:"selector,omitempty" json:"selector,omitempty"` // WaitEval has to be in the form of a boolean return // e.g. `myVar !== null` or `(myVar !== null || document.title == "ready")` // the supplied value will be appended to an existing // `return document.readyState === 'complete' && ${WaitEval};` WaitEval string `yaml:"waitEval,omitempty" json:"waitEval,omitempty"` }
IframeAction
type LoggedInPage ¶
type LoggedInPage struct { *Web // contains filtered or unexported fields }
func (*LoggedInPage) DetermineActionElement ¶
func (lp *LoggedInPage) DetermineActionElement(page *rod.Page, action *ElementAction) (*rod.Element, error)
DetermineActionType returns the rod.Element with correct action
func (*LoggedInPage) DetermineActionType ¶
func (lp *LoggedInPage) DetermineActionType(action *ElementAction, elem *rod.Element) error
DetermineActionType returns the rod.Element with correct action either Click/Swipe or Input when Input is selected - ensure you have specified the input HTML element as the enclosing elements may not always allow for input...
func (*LoggedInPage) PerformActions ¶ added in v0.1.2
func (lp *LoggedInPage) PerformActions(action *ViewAction) error
PerformAction handles a single action on Navigate'd page/view of SPA
type UIStrategyError ¶ added in v0.2.2
type UIStrategyError struct {
// contains filtered or unexported fields
}
UIStrategyError custom error handler TODO: enable mutex lock on this just in case
func (*UIStrategyError) Error ¶ added in v0.2.2
func (e *UIStrategyError) Error() string
type UiStrategyConf ¶
type UiStrategyConf struct { Setup BaseConfig `yaml:"setup" json:"setup"` // Auth is optional // should be omitted for apps that do not require a login Auth *Auth `yaml:"auth,omitempty" json:"auth,omitempty"` Actions []*ViewAction `yaml:"actions" json:"actions"` }
type ViewAction ¶ added in v0.1.2
type ViewAction struct { Iframe *IframeAction `yaml:"iframe,omitempty" json:"iframe,omitempty"` Name string `yaml:"name" json:"name"` ElementActions []*ElementAction `yaml:"elementActions" json:"elementActions"` // contains filtered or unexported fields }
ViewAction defines a single action to do e.g. look up item, input text, click/swipe can include Assertion that action successfully occured
func (*ViewAction) WithNavigate ¶ added in v0.1.2
func (a *ViewAction) WithNavigate(baseUrl string) *ViewAction
WithNavigate correctly formats the Navigate URL to include the full baseUrl
type ViewReport ¶ added in v0.1.2
type ViewReport map[string]ViewReportItem
type ViewReportItem ¶ added in v0.2.1
type ViewReportItem struct { Message string `json:"message"` Actions ActionsReport `json:"actions"` }
type Web ¶
type Web struct {
// contains filtered or unexported fields
}
Web is the single instance struct
func New ¶
func New(conf BaseConfig) *Web
New returns an initialised instance of Web struct with the provided BaseConfig
func (*Web) DoAuth ¶
func (web *Web) DoAuth(auth *Auth) (*LoggedInPage, error)
DoAuth performs the required Authentication in the browser and returns a authed Page
type WebConfig ¶ added in v0.1.2
type WebConfig struct { Headless bool `yaml:"headless" json:"headless"` // if enabled it will store session data on disk // when used in CI, if you also want this enabled // you should also cache the default location of where the cache is: // ~/.uistratetegy-data PersistSessionOnDisk bool `yaml:"persist" json:"persist"` // Timeout will initialises a copy of the page with a context Timeout Timeout int `yaml:"timeout" json:"timeout"` BrowserPathExec string `yaml:"execPath" json:"execPath"` UserMode bool `yaml:"userMode" json:"userMode"` DataDir string `yaml:"dataDir" json:"dataDir"` ReuseBrowserCache bool `yaml:"reuseBrowserCache" json:"reuseBrowserCache"` NoSandbox bool `yaml:"noSandbox" json:"noSandbox"` }