Issue
I am trying to implement TestButler library to remove flakiness of emulator. One of the steps mentioned is to add following code to the test runner class:
package com.linkedin.util;
import android.os.Bundle;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnitRunner;
import com.linkedin.android.testbutler.TestButler;
public class ExampleTestRunner extends AndroidJUnitRunner {
@Override
public void onStart() {
TestButler.setup(InstrumentationRegistry.getTargetContext());
super.onStart();
}
@Override
public void finish(int resultCode, Bundle results) {
TestButler.teardown(InstrumentationRegistry.getTargetContext());
super.finish(resultCode, results);
}
}
I am not sure where to insert this code as in my test cases i am using @RunWith(AndroidJUnit4.class).
Solution
You should probably put it in build.gradle in android -> defaultConfig
testInstrumentationRunner 'com.linkedin.util.ExampleTestRunner'
to override the default runner
Answered By - Piotr Zawadzki
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.