Grant `POST_NOTIFICATIONS` permission in instrumented tests

pull/738/head
Simon Marquis 2 years ago committed by GitHub
parent d209105955
commit 331e8cffac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,6 +16,7 @@
package com.google.samples.apps.nowinandroid.feature.foryou
import android.Manifest
import androidx.activity.ComponentActivity
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.ui.test.assertHasClickAction
@ -28,6 +29,8 @@ import androidx.compose.ui.test.onFirst
import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performScrollToNode
import androidx.test.rule.GrantPermissionRule
import androidx.test.rule.GrantPermissionRule.grant
import com.google.samples.apps.nowinandroid.core.testing.data.followableTopicTestData
import com.google.samples.apps.nowinandroid.core.testing.data.userNewsResourcesTestData
import com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState
@ -35,6 +38,10 @@ import org.junit.Rule
import org.junit.Test
class ForYouScreenTest {
@get:Rule
val permissionTestRule: GrantPermissionRule = grant(Manifest.permission.POST_NOTIFICATIONS)
@get:Rule
val composeTestRule = createAndroidComposeRule<ComponentActivity>()

Loading…
Cancel
Save