playstore

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: 10 Imported by: 0

Documentation

Overview

Package playstore provides set of util functions used to install applications through the playstore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAndDismissDialog

func FindAndDismissDialog(ctx context.Context, d *ui.Device, dialogText, buttonText string, timeout time.Duration) error

FindAndDismissDialog finds a dialog containing text with a corresponding button and presses the button.

func InstallApp

func InstallApp(ctx context.Context, a *arc.ARC, d *ui.Device, pkgName string, opt *Options) error

InstallApp uses the Play Store to install an application. It will wait for the app to finish installing before returning. Play Store should be open to the homepage before running this function.

func InstallOrUpdateApp

func InstallOrUpdateApp(ctx context.Context, a *arc.ARC, d *ui.Device, pkgName string, opt *Options) error

InstallOrUpdateApp installs the application via Play Store. If the application is already installed, it updates the app if an update is available. It will wait for the app to finish installing/updating before returning.

func InstallOrUpdateAppAndClose

func InstallOrUpdateAppAndClose(ctx context.Context, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, pkgName string, opt *Options) error

InstallOrUpdateAppAndClose installs or updates an application via Play Store, closes Play Store after installation. If the application is already installed, it updates the app if an update is available. It will wait for the app to finish installing/updating and closes Play Store before returning.

Types

type Options

type Options struct {
	// TryLimit limits number of tries to install or update an app.
	// Default value is 3, and -1 means unlimited.
	TryLimit int

	// DefaultUITimeout is used when waiting for UI elements.
	// Default value is 20 sec.
	DefaultUITimeout time.Duration

	// ShortUITimeout is used when waiting for "Complete account setup" button.
	// Default value is 10 sec.
	ShortUITimeout time.Duration

	// InstallationTimeout is used when waiting for app installation.
	// Default value is 90 sec.
	InstallationTimeout time.Duration
}

Options contains options used when installing or updating an app.

Jump to

Keyboard shortcuts

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