Kotlin and new ActivityTestRule : The @Rule must be public

前端 未结 5 2063
温柔的废话
温柔的废话 2020-12-07 09:33

I\'m trying to make UI test for my android app in Kotlin. Since the new system using ActivityTestRule, I can\'t make it work: it compiles correctly, and at runtime, I get:

5条回答
  •  温柔的废话
    2020-12-07 09:44

    Use this:

    @get:Rule
    var mActivityRule: ActivityTestRule = ActivityTestRule(MainActivity::class.java)
    

提交回复
热议问题