Documentation ¶
Overview ¶
Package browser allows interactions with browser window.
Index ¶
- type Browser
- func (b *Browser) BookmarkCurrentTab(ctx context.Context, keyboard *input.KeyboardEventWriter) error
- func (b *Browser) Close(ctx context.Context) error
- func (b *Browser) CurrentTabBookmarkName(ctx context.Context, keyboard *input.KeyboardEventWriter) (string, error)
- func (b *Browser) GetAddressBarText(ctx context.Context) (string, error)
- func (b *Browser) Hide(ctx context.Context, keyboard *input.KeyboardEventWriter) error
- func (b *Browser) IsBookmarkStarIconVisible(ctx context.Context) (bool, error)
- func (b *Browser) IsBookmarkVisible(ctx context.Context, bookmarkName string) (bool, error)
- func (b *Browser) Navigate(ctx context.Context, url string) error
- func (b *Browser) OpenBookmark(ctx context.Context, bookmarkName string) error
- func (b *Browser) RemoveBookmarkForCurrentTab(ctx context.Context, keyboard *input.KeyboardEventWriter) error
- func (b *Browser) RenameBookmarkForCurrentTab(ctx context.Context, keyboard *input.KeyboardEventWriter, newName string) error
- func (b *Browser) ShowBookmarksBar(ctx context.Context, keyboard *input.KeyboardEventWriter) error
- func (b *Browser) ToggleBookmarksBar(ctx context.Context, keyboard *input.KeyboardEventWriter) error
- func (b *Browser) VisibleBookmarksCount(ctx context.Context) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Browser ¶
type Browser struct {
// contains filtered or unexported fields
}
Browser represents an instance of the browser.
func Launch ¶
func Launch(ctx context.Context, tconn *chrome.TestConn, cr *chrome.Chrome, url string) (*Browser, error)
Launch launches a browser with the given url. An error is returned if the browser fails to launch.
func (*Browser) BookmarkCurrentTab ¶
func (b *Browser) BookmarkCurrentTab(ctx context.Context, keyboard *input.KeyboardEventWriter) error
BookmarkCurrentTab opens bookmark dialog for the current tab and adds it as a bookmark.
func (*Browser) Close ¶
Close closes the web content, the connection and frees related resources. Tests should typically defer calls to this method and ignore the returned error.
func (*Browser) CurrentTabBookmarkName ¶
func (b *Browser) CurrentTabBookmarkName(ctx context.Context, keyboard *input.KeyboardEventWriter) (string, error)
CurrentTabBookmarkName opens bookmark dialog for the current tab and returns the name of the bookmark for the current tab.
func (*Browser) GetAddressBarText ¶
GetAddressBarText returns the address bar text.
func (*Browser) IsBookmarkStarIconVisible ¶
IsBookmarkStarIconVisible checks if the bookmark icon is visible.
func (*Browser) IsBookmarkVisible ¶
IsBookmarkVisible checks if bookmark with a given name is visible on the bookmark bar.
func (*Browser) OpenBookmark ¶
OpenBookmark opens bookmark with a given name from the bookmark bar.
func (*Browser) RemoveBookmarkForCurrentTab ¶
func (b *Browser) RemoveBookmarkForCurrentTab(ctx context.Context, keyboard *input.KeyboardEventWriter) error
RemoveBookmarkForCurrentTab opens bookmark dialog for the current tab and removes bookmark.
func (*Browser) RenameBookmarkForCurrentTab ¶
func (b *Browser) RenameBookmarkForCurrentTab(ctx context.Context, keyboard *input.KeyboardEventWriter, newName string) error
RenameBookmarkForCurrentTab opens bookmark dialog for the current tab and renames the bookmark name.
func (*Browser) ShowBookmarksBar ¶
ShowBookmarksBar makes bookmarks bar UI element visible.
func (*Browser) ToggleBookmarksBar ¶
func (b *Browser) ToggleBookmarksBar(ctx context.Context, keyboard *input.KeyboardEventWriter) error
ToggleBookmarksBar toggles bookmarks bar using keyboard shortcut.