helpapp

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package helpapp contains common functions used in the help app.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var RootFinder = nodewith.Name(apps.Help.Name).Role(role.RootWebArea)

RootFinder is the finder of Help app root window.

View Source
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

func (hc *HelpContext) IsHTMLElementPresent(ctx context.Context, cssSelector string) (bool, error)

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

func (hc *HelpContext) NavigateToPageWithURL(url string, condition uiauto.Action) uiauto.Action

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

func (hc *HelpContext) TrustedUIConn(ctx context.Context) (*chrome.Conn, error)

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

func (hc *HelpContext) UIConn(ctx context.Context) (*chrome.Conn, error)

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.

Jump to

Keyboard shortcuts

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