File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
androidTest/java/com/iterable/iterableapi/testapp
test/java/com/iterable/iterableapi Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 33import androidx .test .ext .junit .runners .AndroidJUnit4 ;
44import androidx .test .rule .ActivityTestRule ;
55
6+ import com .iterable .iterableapi .IterableApi ;
67import com .iterable .iterableapi .ui .R ;
78import com .iterable .iterableapi .ui .inbox .IterableInboxActivity ;
89
910import org .junit .Rule ;
1011import org .junit .Test ;
1112import org .junit .runner .RunWith ;
1213
14+ import static androidx .test .core .app .ApplicationProvider .getApplicationContext ;
1315import static androidx .test .espresso .Espresso .onView ;
1416import static androidx .test .espresso .action .ViewActions .click ;
1517import static androidx .test .espresso .matcher .ViewMatchers .withId ;
1820@ RunWith (AndroidJUnit4 .class )
1921public class InboxUITest {
2022 @ Rule
21- public ActivityTestRule rule = new ActivityTestRule <>(IterableInboxActivity .class );
23+ public ActivityTestRule <IterableInboxActivity > rule = new ActivityTestRule <IterableInboxActivity >(IterableInboxActivity .class ) {
24+ @ Override
25+ protected void beforeActivityLaunched () {
26+ super .beforeActivityLaunched ();
27+ IterableApi .initialize (getApplicationContext (), "apiKey" );
28+ }
29+ };
2230
2331 @ Test
2432 public void basicTest () {
Original file line number Diff line number Diff line change 33import androidx .test .ext .junit .runners .AndroidJUnit4 ;
44import androidx .test .rule .ActivityTestRule ;
55
6- import com .iterable .iterableapi .ui .inbox .IterableInboxActivity ;
76import com .iterable .iterableapi .ui .R ;
7+ import com .iterable .iterableapi .ui .inbox .IterableInboxActivity ;
88
99import org .junit .Rule ;
1010import org .junit .Test ;
11- import org .junit .rules .TestRule ;
1211import org .junit .runner .RunWith ;
1312
13+ import static androidx .test .core .app .ApplicationProvider .getApplicationContext ;
1414import static androidx .test .espresso .Espresso .onView ;
1515import static androidx .test .espresso .action .ViewActions .click ;
1616import static androidx .test .espresso .matcher .ViewMatchers .withId ;
1919@ RunWith (AndroidJUnit4 .class )
2020public class InboxUITest {
2121 @ Rule
22- public ActivityTestRule rule = new ActivityTestRule <>(IterableInboxActivity .class );
22+ public ActivityTestRule <IterableInboxActivity > rule = new ActivityTestRule <IterableInboxActivity >(IterableInboxActivity .class ) {
23+ @ Override
24+ protected void beforeActivityLaunched () {
25+ super .beforeActivityLaunched ();
26+ IterableApi .initialize (getApplicationContext (), "apiKey" );
27+ }
28+ };
2329
2430 @ Test
2531 public void basicTest () {
You can’t perform that action at this time.
0 commit comments