GrandPermissionRule doesn't work after extending AndroidJUnitRunner

9 views
Skip to first unread message

Dawid Hyży

unread,
Sep 10, 2019, 2:42:38 AM9/10/19
to Android Testing Support Library

After extending AndroidJUnitRunner GrandPermissionRule stopped working and the test is blocked by permission dialog.

Here is my runner class:


package com.my.package

import android.app.Application
import android.content.Context
import androidx.test.runner.AndroidJUnitRunner
import com.my.package.TestApplication

class MockTestRunner : AndroidJUnitRunner() {
    @Throws(
        InstantiationException::class,
        IllegalAccessException::class,
        ClassNotFoundException::class
    )
    override fun newApplication(cl: ClassLoader, className: String, context: Context): Application {
        return super.newApplication(cl, TestApplication::class.java.name, context)
    }
}


Gradle runner config:

testInstrumentationRunner 'com.my.package.MockTestRunner'Before everything was working as intended. Anyone had this issue? How to fix that?


Before everything was working as intended. Anyone had this issue? How to fix that?

Reply all
Reply to author
Forward
0 new messages