Skip to content
Snippets Groups Projects
Commit 994fac6a authored by Andrej Rasevic's avatar Andrej Rasevic
Browse files

fixing permissions tests

parent 52899290
No related branches found
No related tags found
No related merge requests found
......@@ -68,8 +68,9 @@ class TestGoToDangerousApp {
assertNotNull("GoToDangerousActivity Didn't start", startDangerousApp)
startDangerousApp.click()
//
val PermissionDialog = mDevice!!.wait(Until.findObject(By.text("ALLOW")), 2000)
PermissionDialog?.click()
val allowButtonPattern = Pattern.compile("ALLOW", Pattern.CASE_INSENSITIVE)
val permissionDialog = mDevice!!.wait(Until.findObject(By.text(allowButtonPattern)), 2000)
permissionDialog?.click()
val phoneNumber = mDevice!!.wait(Until.findObject(By.text("You have opened a dangerous activity")), 5000)
assertNotNull(phoneNumber)
}
......
......@@ -67,8 +67,9 @@ class TestPhoneStatus {
@Test
fun testPermissionRequested() {
val PermissionDialog = mDevice!!.wait(Until.findObject(By.text("ALLOW")), 2000)
PermissionDialog?.click()
val allowButtonPattern = Pattern.compile("ALLOW", Pattern.CASE_INSENSITIVE)
val permissionDialog = mDevice!!.wait(Until.findObject(By.text(allowButtonPattern)), 2000)
permissionDialog?.click()
val phonePattern = Pattern.compile("Phone Number: \\+?\\d+")
val phoneNumber = mDevice!!.wait(Until.findObject(By.text(phonePattern)), 5000)
assertNotNull(phoneNumber)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment