TestCase class not found by Android Studio

后端 未结 7 1690
刺人心
刺人心 2020-12-03 17:24

I have written a simple test case class and placed it in the default test directory for Android Studio: \"src/androidTest\". I\'ve created an Android Tests build configurati

相关标签:
7条回答
  • 2020-12-03 18:14

    In addition to all of that written before my note (so check those please before this suggestion of mine), I've sometimes solved moving the test file outside the custom directory (as example, I've created dir like db_test or similar under /test or androidTest) to the root of test or androidTest, drag&dropping it outside dir in AndroidStudio explorer and waiting for the refactor android studio dialog for moving confirmation.

    After running it successfully, I've put again in the original directory, run again and it works.

    In another case I've solved renaming the custom dir.

    In another, because the test was in the root, I've create custom dir, move it inside, and then ran successfully.

    These worked for me, hope it could save time for someone else.

    0 讨论(0)
提交回复
热议问题