File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
app/src/androidTest/kotlin/org/wordpress/aztec/demo Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 22
33package org.wordpress.aztec.demo
44
5+ import android.Manifest.permission.CAMERA
56import android.util.Log
6- import androidx.test.rule.GrantPermissionRule
7+ import androidx.test.platform.app.InstrumentationRegistry
78import androidx.test.runner.AndroidJUnit4
8- import org.junit.Rule
9+ import org.junit.Before
910import org.junit.runner.RunWith
1011
1112@RunWith(AndroidJUnit4 ::class )
1213abstract class BaseTest {
13- @Rule
14- @JvmField
15- val grantPermissionRule: GrantPermissionRule = GrantPermissionRule .grant(android.Manifest .permission.CAMERA ,
16- android.Manifest .permission.WRITE_EXTERNAL_STORAGE )
14+
15+ @Before
16+ fun grantPermissions () {
17+ val (uiAutomation, packageName) = with (InstrumentationRegistry .getInstrumentation()) {
18+ Pair (uiAutomation, targetContext.packageName)
19+ }
20+ uiAutomation.grantRuntimePermission(packageName, CAMERA )
21+ }
1722
1823 companion object {
1924 fun label (label : String ) {
You can’t perform that action at this time.
0 commit comments