Documentation ¶
Overview ¶
Package testutil contains functionality shared by tast tests for android apps on Chromebooks.
Index ¶
- Constants
- Variables
- func ClamshellFullscreenApp(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func ClamshellResizeWindow(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func CurrentAppPackage(ctx context.Context, d *ui.Device, s *testing.State) (string, error)
- func DetectAndHandleCloseCrashOrAppNotResponding(ctx context.Context, s *testing.State, d *ui.Device)
- func EscKey(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func GetAppVersion(ctx context.Context, s *testing.State, a *arc.ARC, d *ui.Device, ...) (string, error)
- func HandleDialogBoxes(ctx context.Context, s *testing.State, d *ui.Device, appPkgName string)
- func KeyboardNavigations(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func Largescreenlayout(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func MinimizeRestoreApp(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func MouseClick(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func MouseScrollAction(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func OrientationSize(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func ReOpenWindow(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func ResizeLock(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func RunTestCases(ctx context.Context, s *testing.State, appPkgName, appActivity string, ...)
- func SplitScreen(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func StylusClick(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func TouchAndPlayVideo(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func TouchAndTextInputs(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func TouchScreenScroll(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- func TouchviewRotate(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, ...)
- type TestCase
- type TestFunc
- type TestParams
Constants ¶
const ( AndroidButtonClassName = "android.widget.Button" DefaultUITimeout = 20 * time.Second ShortUITimeout = 30 * time.Second LongUITimeout = 90 * time.Second )
Variables used by other tast tests
Variables ¶
var ClamshellCommonTests = []TestCase{ {Name: "Clamshell: Touchscreen Scroll", Fn: TouchScreenScroll}, {Name: "Clamshell: Fullscreen app", Fn: ClamshellFullscreenApp}, {Name: "Clamshell: Minimise and Restore", Fn: MinimizeRestoreApp}, {Name: "Clamshell: Reopen app", Fn: ReOpenWindow}, {Name: "Clamshell: Resize Lock", Fn: ResizeLock}, }
ClamshellCommonTests is a list of all tests common to all apps in clamshell mode.
var ClamshellOnlyModels = []string{
"sarien",
"elemi",
"berknip",
"dratini",
"careena",
"kasumi",
"treeya",
"grunt",
"barla",
"aleena",
"liara",
"nuwani",
"bluebird",
"apel",
"blooglet",
"blorb",
"bobba",
"casta",
"dorp",
"droid",
"fleex",
"foob",
"garfour",
"garg",
"laser14",
"lick",
"mimrock",
"nospike",
"orbatrix",
"phaser",
"sparky",
}
ClamshellOnlyModels is a list of clamshell only models to be skipped from tablet mode runs.
var ClamshellSmokeTests = []TestCase{ {Name: "Clamshell: Touchscreen Scroll", Fn: TouchScreenScroll}, {Name: "Clamshell: Physical Keyboard", Fn: TouchAndTextInputs}, {Name: "Clamshell: Mouse click", Fn: MouseClick}, {Name: "Clamshell: Resize window", Fn: ClamshellResizeWindow}, }
ClamshellSmokeTests is a list of clamshell tests common to apps in appcompat_smoke suite.
var TabletOnlyModels = []string{
"dru",
"krane",
}
TabletOnlyModels is a list of tablet only models to be skipped from clamshell mode runs.
var TouchviewCommonTests = []TestCase{ {Name: "Touchview: Rotate", Fn: TouchviewRotate}, {Name: "Touchview: Minimise and Restore", Fn: MinimizeRestoreApp}, {Name: "Touchview: Reopen app", Fn: ReOpenWindow}, }
TouchviewCommonTests is a list of all tests common to all apps in touchview mode.
var TouchviewSmokeTests = []TestCase{ {Name: "Touchview: Minimise and Restore", Fn: MinimizeRestoreApp}, {Name: "Touchview: Reopen app", Fn: ReOpenWindow}, }
TouchviewSmokeTests is a list of touchview tests common to apps in appcompat_smoke suite.
Functions ¶
func ClamshellFullscreenApp ¶
func ClamshellFullscreenApp(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
ClamshellFullscreenApp Test launches the app in full screen window and verifies launch successfully without crash or ANR on ARC-P devices
func ClamshellResizeWindow ¶
func ClamshellResizeWindow(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
ClamshellResizeWindow Test "resize and restore back to original state of the app" and verifies app launch successfully without crash or ANR on ARC-P devices.
func CurrentAppPackage ¶
CurrentAppPackage func to get info on current package name.
func DetectAndHandleCloseCrashOrAppNotResponding ¶
func DetectAndHandleCloseCrashOrAppNotResponding(ctx context.Context, s *testing.State, d *ui.Device)
DetectAndHandleCloseCrashOrAppNotResponding func to handle Crash or ANR.
func EscKey ¶
func EscKey(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
EscKey Test verifies if app doesn't quit on pressing esc key and without crash or ANR.
func GetAppVersion ¶
func GetAppVersion(ctx context.Context, s *testing.State, a *arc.ARC, d *ui.Device, appPkgName string) (string, error)
GetAppVersion provides info on app version.
func HandleDialogBoxes ¶
HandleDialogBoxes func will handle the dialog box
func KeyboardNavigations ¶
func KeyboardNavigations(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
KeyboardNavigations func verifies app perform keyboard navigations successfully without crash or ANR.
func Largescreenlayout ¶
func Largescreenlayout(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
Largescreenlayout Test verifies if app utilizes large screen after maximizing the app and without crash or ANR.
func MinimizeRestoreApp ¶
func MinimizeRestoreApp(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
MinimizeRestoreApp Test "minimize and relaunch the app" and verifies app relaunch successfully without crash or ANR.
func MouseClick ¶
func MouseClick(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
MouseClick func verifies mouse click work successfully in the app without crash or ANR.
func MouseScrollAction ¶
func MouseScrollAction(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
MouseScrollAction func verifies app perform mouse scroll actions successfully without crash or ANR.
func OrientationSize ¶
func OrientationSize(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
OrientationSize Test verifies orientation size of the app after launch.
func ReOpenWindow ¶
func ReOpenWindow(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
ReOpenWindow Test "close and relaunch the app" and verifies app launch successfully without crash or ANR.
func ResizeLock ¶
func ResizeLock(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
ResizeLock Test verifies if app has resize lock feature available or not and verifies if app launch successfully without crash or ANR.
func RunTestCases ¶
func RunTestCases(ctx context.Context, s *testing.State, appPkgName, appActivity string, testCases TestParams)
RunTestCases setups the device and runs all app compat test cases.
func SplitScreen ¶
func SplitScreen(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
SplitScreen Test verifies if app supports split screen and check if app performs split screen without crash or ANR.
func StylusClick ¶
func StylusClick(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
StylusClick func verifies if stylus click works properly in the app without crash or ANR.
func TouchAndPlayVideo ¶
func TouchAndPlayVideo(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
TouchAndPlayVideo func verifies app perform touch and play video successfully without crash or ANR.
func TouchAndTextInputs ¶
func TouchAndTextInputs(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
TouchAndTextInputs func verify touch and text inputs in the app are working properly without crash or ANR.
Types ¶
type TestFunc ¶
type TestFunc func(ctx context.Context, s *testing.State, tconn *chrome.TestConn, a *arc.ARC, d *ui.Device, appPkgName, appActivity string)
TestFunc represents the "test" function.
type TestParams ¶
type TestParams struct { LaunchTests []TestCase CommonTests []TestCase AppSpecificTests []TestCase }
TestParams represents the collection of tests to run in tablet mode or clamshell mode.