-
Notifications
You must be signed in to change notification settings - Fork 124
/
MainActivityRobotiumTest.java
executable file
·42 lines (32 loc) · 1.21 KB
/
MainActivityRobotiumTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package in.ravidsrk.sample;
import android.support.test.InstrumentationRegistry;
import android.support.test.rule.ActivityTestRule;
import com.robotium.solo.Solo;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public class MainActivityRobotiumTest {
private Solo solo;
@Rule
public ActivityTestRule<MainActivity> activityTestRule =
new ActivityTestRule<>(MainActivity.class);
public void setUp() {
solo = new Solo(InstrumentationRegistry.getInstrumentation(),
activityTestRule.getActivity());
}
public void tearDown() {
solo.finishOpenedActivities();
}
@Ignore
@Test
public void testPushClickMe() {
solo.waitForActivity(MainActivity.class);
solo.assertCurrentActivity("MainActivity is not displayed", MainActivity.class);
assertTrue("This is a test in EditText is not displayed",
solo.searchText("this is a test"));
solo.clickOnButton("Click Me");
assertTrue("You clicked me text is not displayed in the EditText",
solo.searchText("you clicked me!"));
}
}