Thursday, 13 August 2015

android espresso, assert current Activity



import static org.hamcrest.MatcherAssert.assertThat;

import org.hamcrest.Matchers;

assertThat(MyApplication.getCurrentActivity(), Matchers.instanceOf(XXXActivity.class));

of course you should implement "getCurrentActivity()" first. To do this, you can check another post from me:  android, get current Activity reference


No comments:

Post a comment