-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #286 from wealthfront/migration-int-test
Add basic integration test to sample app
- Loading branch information
Showing
10 changed files
with
76 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...n-sample-migration/src/androidTest/java/com/wealthfront/magellan/IntegrationTestRunner.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.wealthfront.magellan | ||
|
||
import androidx.test.runner.AndroidJUnitRunner | ||
import com.squareup.rx2.idler.Rx2Idler | ||
import io.reactivex.plugins.RxJavaPlugins | ||
|
||
class IntegrationTestRunner : AndroidJUnitRunner() { | ||
|
||
override fun onStart() { | ||
RxJavaPlugins.setInitIoSchedulerHandler(Rx2Idler.create("RxJava 2.x IO Scheduler")) | ||
RxJavaPlugins.setInitComputationSchedulerHandler(Rx2Idler.create("RxJava 2.x Computation Scheduler")) | ||
|
||
super.onStart() | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...n-sample-migration/src/androidTest/java/com/wealthfront/magellan/uitest/NavigationTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.wealthfront.magellan.uitest | ||
|
||
import androidx.test.core.app.ActivityScenario | ||
import androidx.test.core.app.launchActivity | ||
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.action.ViewActions.click | ||
import androidx.test.espresso.assertion.ViewAssertions.matches | ||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
import androidx.test.espresso.matcher.ViewMatchers.withId | ||
import androidx.test.espresso.matcher.ViewMatchers.withText | ||
import com.wealthfront.magellan.sample.migration.MainActivity | ||
import com.wealthfront.magellan.sample.migration.R | ||
import org.junit.Before | ||
import org.junit.Test | ||
|
||
class NavigationTest { | ||
|
||
lateinit var activityScenario: ActivityScenario<MainActivity> | ||
|
||
@Before | ||
fun setup() { | ||
activityScenario = launchActivity() | ||
} | ||
|
||
@Test | ||
fun visitRetriever() { | ||
onView(withText("Akita")).perform(click()) | ||
onView(withId(R.id.dogDetailsView)).check(matches(isDisplayed())) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...an-sample-migration/src/main/java/com/wealthfront/magellan/sample/migration/api/DogApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters