Last active
May 12, 2021 21:21
-
-
Save jraska/729a624235299f301c4b869414fc80cb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class PushIntegrationTest { | |
lateinit var pushClient: PushServerClient | |
lateinit var thisDeviceToken: String | |
@get:Rule | |
val pushRule = PushAwaitRule() | |
@Before | |
fun setUp() { | |
pushClient = PushServerClient.create(apiKey()) | |
val tokenTask = FirebaseMessaging.getInstance().token | |
thisDeviceToken = Tasks.await(tokenTask) | |
} | |
@Test | |
fun testPushIntegrationFromSettingsToAbout() { | |
DeepLinkLaunchTest.launchDeepLink("https://github.com/settings") // just launches screen to start from | |
pushRule.onViewAwaitPush() // makes Espresso wait for push to arrive | |
sendDeepLinkPush("https://github.com/about") // Triggers the push through FCM backend | |
onView(withText("by Josef Raska")).check(matches(isDisplayed())) // Asserts that the expected about screen was launched | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment