Skip to content

Commit

Permalink
Try to fix ui test
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltroger committed May 24, 2024
1 parent 6f90dc6 commit 803b41b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.test.uiautomator.Until

private const val TIMEOUT = 5000L
private const val testFolder = "testdata"
private const val filesApp = "com.android.documentsui"

class AndroidFileAppRobot {

Expand All @@ -25,7 +26,8 @@ class AndroidFileAppRobot {
private val listViewSelector = By.desc("List view")

fun openFileManagerApp() = apply {
val intent: Intent = context.packageManager.getLaunchIntentForPackage("com.android.documentsui")!!
uiDevice.executeShellCommand("pm clear $filesApp")
val intent: Intent = context.packageManager.getLaunchIntentForPackage(filesApp)!!
context.startActivity(intent)
}

Expand Down

0 comments on commit 803b41b

Please sign in to comment.