allure-framework / allure-kotlin

Allure integrations for test frameworks targeting Kotlin and Java with 1.6 source compatibility.
Apache License 2.0
57 stars 21 forks source link

The error on granting WRITE_EXTERNAL_STORAGE permission with io.qameta.allure.android.listeners.ExternalStoragePermissionsListener #48

Closed SergKhram closed 3 years ago

SergKhram commented 3 years ago

Android SDK 29 androidTestImplementation "io.qameta.allure:allure-kotlin-model:2.2.0" androidTestImplementation "io.qameta.allure:allure-kotlin-commons:2.2.0" androidTestImplementation "io.qameta.allure:allure-kotlin-junit4:2.2.0" androidTestImplementation "io.qameta.allure:allure-kotlin-android:2.2.0"

2021-02-10 09:48:04.687 11442-11476/r E/GrantPermissionCallable: Permission: android.permission.WRITE_EXTERNAL_STORAGE cannot be granted! 2021-02-10 09:48:04.688 11442-11476/...android.debug E/TestExecutor: Fatal exception when running tests junit.framework.AssertionFailedError: Failed to grant permissions, see logcat for details at junit.framework.Assert.fail(Assert.java:50) at androidx.test.runner.permission.PermissionRequester.requestPermissions(PermissionRequester.java:111) at io.qameta.allure.android.internal.TestUtilsKt.requestExternalStoragePermissions(TestUtils.kt:28) at io.qameta.allure.android.listeners.ExternalStoragePermissionsListener.testRunStarted(ExternalStoragePermissionsListener.kt:9) at org.junit.runner.notification.SynchronizedRunListener.testRunStarted(SynchronizedRunListener.java:35) at org.junit.runner.notification.RunNotifier$1.notifyListener(RunNotifier.java:91) at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72) at org.junit.runner.notification.RunNotifier.fireTestRunStarted(RunNotifier.java:88) at org.junit.runner.JUnitCore.run(JUnitCore.java:136) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56) at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2189)

But in logcat no more information with Verbose lvl

If I use debug/AndroidManifest permission granting -> I haven't this problem

What's wrong ?