browser

package
v0.0.0-...-9474aff Latest Latest
Warning

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

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

Documentation

Overview

Package browser allows interactions with browser window.

Index

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

func (b *Browser) Close(ctx context.Context) error

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

func (b *Browser) GetAddressBarText(ctx context.Context) (string, error)

GetAddressBarText returns the address bar text.

func (*Browser) Hide

func (b *Browser) Hide(ctx context.Context, keyboard *input.KeyboardEventWriter) error

Hide makes bookmarks bar UI element not visible.

func (*Browser) IsBookmarkStarIconVisible

func (b *Browser) IsBookmarkStarIconVisible(ctx context.Context) (bool, error)

IsBookmarkStarIconVisible checks if the bookmark icon is visible.

func (*Browser) IsBookmarkVisible

func (b *Browser) IsBookmarkVisible(ctx context.Context, bookmarkName string) (bool, error)

IsBookmarkVisible checks if bookmark with a given name is visible on the bookmark bar.

func (*Browser) Navigate

func (b *Browser) Navigate(ctx context.Context, url string) error

Navigate navigates the browser to a url.

func (*Browser) OpenBookmark

func (b *Browser) OpenBookmark(ctx context.Context, bookmarkName string) error

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

func (b *Browser) ShowBookmarksBar(ctx context.Context, keyboard *input.KeyboardEventWriter) error

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.

func (*Browser) VisibleBookmarksCount

func (b *Browser) VisibleBookmarksCount(ctx context.Context) (int, error)

VisibleBookmarksCount returns count of visible bookmarks on bookmarks bar.

Jump to

Keyboard shortcuts

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