Created
September 8, 2017 05:40
-
-
Save Cassie-von-Clausewitz/47a60e0dda2ebaee8d577094ea8e9501 to your computer and use it in GitHub Desktop.
Blank extension of an ActivityTestRule, need to extend if you want to be able to do something before or after the activity is launched or finished
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity | |
import android.content.Intent | |
import android.support.test.rule.ActivityTestRule | |
import org.junit.runner.Description | |
import org.junit.runners.model.Statement | |
class AcceptanceTestRule<A : Activity?>(activityClass: Class<A>?, initialTouchMode: Boolean, launchActivity: Boolean) : ActivityTestRule<A>(activityClass, initialTouchMode, launchActivity) { | |
override fun afterActivityLaunched() { | |
super.afterActivityLaunched() | |
} | |
override fun beforeActivityLaunched() { | |
super.beforeActivityLaunched() | |
} | |
override fun apply(base: Statement?, description: Description?): Statement = | |
super.apply(base, description) | |
override fun afterActivityFinished() { | |
super.afterActivityFinished() | |
} | |
override fun getActivityIntent(): Intent = super.getActivityIntent() | |
override fun getActivity(): A = super.getActivity() | |
override fun launchActivity(startIntent: Intent?): A = super.launchActivity(startIntent) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment