-
-
Field Summary
Fields Modifier and Type Field Description private final StringtargetAppLauncherPackageNameprivate final StringtargetAppPackageName
-
Constructor Summary
Constructors Constructor Description AppsImpl(UiTestLogger logger, Context context, UiDevice uiDevice, AdbServer adbServer)
-
Method Summary
Modifier and Type Method Description Unitinstall(String apkPath)Installs an app via ADB. UnitinstallIfNotExists(String packageName, String apkPath)Installs an app via ADB only if packageName is not installedRequired Permissions: INTERNET. Unituninstall(String packageName)Uninstalls an app via ADB. UnituninstallIfExists(String packageName)Uninstalls an app via ADB only if it installedRequired Permissions: INTERNET. BooleanisInstalled(String packageName)Checks app is installed on device UnitwaitForLauncher(Long timeout, String launcherPackageName)UnitwaitForAppLaunchAndReady(Long timeout, String packageName)UnitopenUrlInChrome(String url)Opens the given url on Chrome. Unitlaunch(String packageName, Uri data)Launches an app with given packageName. UnitopenRecent(String contentDescription)Opens the app from the recent list by the description. Unitkill(String packageName)Kills the process of the app by the given packageName. StringgetTargetAppLauncherPackageName()StringgetTargetAppPackageName()-
-
Constructor Detail
-
AppsImpl
AppsImpl(UiTestLogger logger, Context context, UiDevice uiDevice, AdbServer adbServer)
-
-
Method Detail
-
install
Unit install(String apkPath)
Installs an app via ADB.
Required Permissions: INTERNET.
- Parameters:
apkPath- a path to an apk to be installed.
-
installIfNotExists
Unit installIfNotExists(String packageName, String apkPath)
Installs an app via ADB only if packageName is not installed
Required Permissions: INTERNET.
- Parameters:
packageName- an android package name of the app to be checked.apkPath- a path to the apk to be installed.
-
uninstall
Unit uninstall(String packageName)
Uninstalls an app via ADB.
Required Permissions: INTERNET.
- Parameters:
packageName- an android package name of an app to be deleted.
-
uninstallIfExists
Unit uninstallIfExists(String packageName)
Uninstalls an app via ADB only if it installed
Required Permissions: INTERNET.
- Parameters:
packageName- an android package name of an app to be deleted.
-
isInstalled
Boolean isInstalled(String packageName)
Checks app is installed on device
- Parameters:
packageName- an android package name of the app to be checked.
-
waitForLauncher
Unit waitForLauncher(Long timeout, String launcherPackageName)
-
waitForAppLaunchAndReady
Unit waitForAppLaunchAndReady(Long timeout, String packageName)
-
openUrlInChrome
Unit openUrlInChrome(String url)
Opens the given url on Chrome.
- Parameters:
url- the url to be opened.
-
launch
Unit launch(String packageName, Uri data)
Launches an app with given packageName.
- Parameters:
packageName- the package name of an app to launch.data- the data to put to the launch intent.
-
openRecent
Unit openRecent(String contentDescription)
Opens the app from the recent list by the description.
- Parameters:
contentDescription- the description of the app to launch.
-
kill
Unit kill(String packageName)
Kills the process of the app by the given packageName.
- Parameters:
packageName- the package name of the app to be killed.
-
getTargetAppLauncherPackageName
String getTargetAppLauncherPackageName()
-
getTargetAppPackageName
String getTargetAppPackageName()
-
-
-
-