When I am running the test cases separately test case passes successfully, but when I am running complete test suite the test runner crash showing the above error message. I have investigated this issue but didn't get the specific answer please help me to solve this issue?
Asked
Active
Viewed 643 times
1
-
what in device logcat? – Ehcnalb Jun 24 '19 at 15:20
-
Thanks for replay!, I didn't take a complete logcat but the only error message is `Reason: 'Test run failed to complete. Expected 87 tests, received 47'. – Aniket Yawalkar Jun 24 '19 at 15:32
-
May be a condition in Before or BeforeClass is not when you do test suite – Ehcnalb Jun 25 '19 at 07:53
-
I have added the code to register the idling resources in the BeforeClass() @BeforeClass public static void beforeClass() { IdlingRegistry.getInstance().register(EspressoIdlingResource.getIdlingResource()); } – Aniket Yawalkar Jun 25 '19 at 08:16
-
and in the @Before() @RequiresApi(api = Build.VERSION_CODES.KITKAT) @Before public void setUp() { SharedPreferences.Editor prefs = PreferenceManager.getDefaultSharedPreferences(getInstrumentation().getTargetContext()).edit(); prefs.remove("active_meal_uri").apply(); logout(); selectPrefsAndEnvironment(VALUE_ENVIRONMENT_PREPROD); } – Aniket Yawalkar Jun 25 '19 at 08:18
-
This is my added code please verify the let me know your findings. – Aniket Yawalkar Jun 25 '19 at 08:19
-
Should I have added some extra code? – Aniket Yawalkar Jun 25 '19 at 08:37
-
First : put your code in your question (it will more clear), second : this may help you I think https://stackoverflow.com/questions/11640028/test-run-failed-test-run-failed-to-complete-expected-1-tests-received-0 – Ehcnalb Jun 25 '19 at 08:41
-
This will also happen if my test will fail. Basically, they have to show the failing exception but runner stops on the failing test cases and the tests are continuously running my device. – Aniket Yawalkar Jun 25 '19 at 09:33
-
recently I updated my build Gradle dependencies is it related to that because I verified my BeforeClass() and Before() by handling the exception but this is still reprodisable – Aniket Yawalkar Jun 25 '19 at 12:02