You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write a TestRule that takes a screenshot after a test is run , the code for taking screenshot is working, I'm extending ActivityTestRule but i don't have any hook to run my takeScreenshot method after a test is done but before an activity is finished.
//in ActivityStatement
@Override
public void evaluate() throws Throwable {
try {
if (mLaunchActivity) {
mActivity = launchActivity(getActivityIntent());
}
mBase.evaluate();
} finally {
// I need to take a screenshot here , maybe something like beforeActivityFinished
finishActivity();
afterActivityFinished();
}
}
maybe ActivityTestRule could have a beforeActivityFinished listener that is invoked just before finishActivity ?