John Kennedy
John Kennedy

Reputation: 21

How to call other test class in Android Espresso?

I am writing testcases using Android Espresso.

I have two activities: activity A and activity B. Also I am having a separate test class for both the activities.

After I execute all the testcases in activity A, I don't know how to run the testcases in activity B continuously.

How can I go to activity B test class from activity A test class?

Upvotes: 2

Views: 873

Answers (1)

Emmaaa
Emmaaa

Reputation: 320

If I understand your question correctly, would something like a separate "test suite" class work for you? For example:

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({
    activityATest.class,
    activityBTest.class,
    activityCTest.class

})
public class ActivityTestSuite {
}

And then you would just run your tests from this suite

Upvotes: 6

Related Questions