Documentation
¶
Overview ¶
Package helpapp contains common functions used in the help app.
Index ¶
- Variables
- type HelpContext
- func (hc *HelpContext) ClickSearchInputAndWaitForActive() uiauto.Action
- func (hc *HelpContext) Close() uiauto.Action
- func (hc *HelpContext) EvalJSWithShadowPiercer(ctx context.Context, expr string, out interface{}) error
- func (hc *HelpContext) Exists(ctx context.Context) (bool, error)
- func (hc *HelpContext) GetLoadTimeData(ctx context.Context) (*LoadTimeData, error)
- func (hc *HelpContext) IsHTMLElementPresent(ctx context.Context, cssSelector string) (bool, error)
- func (hc *HelpContext) Launch() uiauto.Action
- func (hc *HelpContext) NavigateToPageWithURL(url string, condition uiauto.Action) uiauto.Action
- func (hc *HelpContext) NavigateToSearchPage() uiauto.Action
- func (hc *HelpContext) TrustedUIConn(ctx context.Context) (*chrome.Conn, error)
- func (hc *HelpContext) UIConn(ctx context.Context) (*chrome.Conn, error)
- func (hc *HelpContext) WaitForApp() uiauto.Action
- type LoadTimeData
Constants ¶
This section is empty.
Variables ¶
var ( SearchTabFinder = TabFinder.Name("Search") OverviewTabFinder = TabFinder.Name("Overview") PerksTabFinder = TabFinder.Name("Perks") HelpTabFinder = TabFinder.Name("Help") WhatsNewTabFinder = TabFinder.Name("See what's new") )
Tab names in Help app.
var RootFinder = nodewith.Name(apps.Help.Name).Role(role.RootWebArea)
RootFinder is the finder of Help app root window.
var TabFinder = nodewith.Role(role.TreeItem).Ancestor(RootFinder)
TabFinder is the finder of tabs in Help app.
Functions ¶
This section is empty.
Types ¶
type HelpContext ¶
type HelpContext struct {
// contains filtered or unexported fields
}
HelpContext represents a context of Help app.
func NewContext ¶
func NewContext(cr *chrome.Chrome, tconn *chrome.TestConn) *HelpContext
NewContext creates a new context of the Help app.
func (*HelpContext) ClickSearchInputAndWaitForActive ¶
func (hc *HelpContext) ClickSearchInputAndWaitForActive() uiauto.Action
ClickSearchInputAndWaitForActive clicks search input field and waits for active.
func (*HelpContext) Close ¶
func (hc *HelpContext) Close() uiauto.Action
Close closes help app and waits for it to be gone from a11y tree.
func (*HelpContext) EvalJSWithShadowPiercer ¶
func (hc *HelpContext) EvalJSWithShadowPiercer(ctx context.Context, expr string, out interface{}) error
EvalJSWithShadowPiercer executes javascript in Help app web page.
func (*HelpContext) Exists ¶
func (hc *HelpContext) Exists(ctx context.Context) (bool, error)
Exists checks whether the help app exists in the accessiblity tree.
func (*HelpContext) GetLoadTimeData ¶
func (hc *HelpContext) GetLoadTimeData(ctx context.Context) (*LoadTimeData, error)
GetLoadTimeData returns some of the LoadTimeData fields from the help app.
func (*HelpContext) IsHTMLElementPresent ¶
IsHTMLElementPresent checks whether a HTMLElement in help app is present regardless of visibility. It takes cssSelector as input param and returns a bool value. cssSelector works piercing shadowRoot.
func (*HelpContext) Launch ¶
func (hc *HelpContext) Launch() uiauto.Action
Launch launches help app and waits for it to be present in shelf.
func (*HelpContext) NavigateToPageWithURL ¶
NavigateToPageWithURL navigates to a sub page by changing url location directly.
func (*HelpContext) NavigateToSearchPage ¶
func (hc *HelpContext) NavigateToSearchPage() uiauto.Action
NavigateToSearchPage navigates to Search page by changing url via javascript.
func (*HelpContext) TrustedUIConn ¶
TrustedUIConn returns a connection to the trusted frame of Help app. It has more privileges to access browser functions same as other SWAs. The caller should close the returned connection. e.g. defer trustedConn.Close().
func (*HelpContext) UIConn ¶
UIConn returns a connection to the Help app HTML page, where JavaScript can be executed to simulate interactions with the UI. The caller should close the returned connection. e.g. defer helpAppConn.Close().
func (*HelpContext) WaitForApp ¶
func (hc *HelpContext) WaitForApp() uiauto.Action
WaitForApp waits for the app to be shown and rendered. It can be slow when the app is auto-lauched after OOBE.
type LoadTimeData ¶
type LoadTimeData struct {
IsManagedDevice bool `json:"isManagedDevice"`
}
LoadTimeData is a struct for the help app. Following fields populated by |ChromeHelpAppUIDelegate::PopulateLoadTimeData| https://source.chromium.org/chromium/chromium/src/+/HEAD:chrome/browser/chromeos/web_applications/chrome_help_app_ui_delegate.cc;l=53;drc=c2c84a5ac7711dedcc0b7ff9e79bf7f2da019537.