Skip to content

Commit 462fa85

Browse files
[SDK-115] Push Action Buttons (#1063)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6f4e224 commit 462fa85

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

integration-tests/src/androidTest/java/com/iterable/integration/tests/PushNotificationIntegrationTest.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import org.json.JSONObject
1717
import org.junit.After
1818
import org.junit.Assert
1919
import org.junit.Before
20-
import org.junit.Ignore
2120
import org.junit.Test
2221
import org.junit.runner.RunWith
2322
import java.util.concurrent.TimeUnit
@@ -113,7 +112,6 @@ class PushNotificationIntegrationTest : BaseIntegrationTest() {
113112
}
114113

115114
@Test
116-
@Ignore("SDK-115 follow-up: action buttons aren't laid out in the collapsed notification shade; UiAutomator can't reliably expand it. Re-enable with an expand-on-find helper.")
117115
fun testPushNotificationActionButtons() {
118116
Assert.assertTrue("User should be signed in", testUtils.ensureUserSignedIn(TestConstants.TEST_USER_EMAIL))
119117
Assert.assertTrue("Notification permission should be granted", hasNotificationPermission())
@@ -135,7 +133,7 @@ class PushNotificationIntegrationTest : BaseIntegrationTest() {
135133
Assert.assertNotNull("Notification should be found", findNotification())
136134

137135
resetUrlHandlerTracking()
138-
val googleButton = uiDevice.findObject(By.text("Google"))
136+
val googleButton = findActionButton("Google")
139137
Assert.assertNotNull("Google button should be found", googleButton)
140138
googleButton?.click()
141139
Thread.sleep(2000)
@@ -155,7 +153,7 @@ class PushNotificationIntegrationTest : BaseIntegrationTest() {
155153
Assert.assertNotNull("Notification should be found", findNotification())
156154

157155
resetCustomActionHandlerTracking()
158-
val deeplinkButton = uiDevice.findObject(By.text("Deeplink"))
156+
val deeplinkButton = findActionButton("Deeplink")
159157
Assert.assertNotNull("Deeplink button should be found", deeplinkButton)
160158
deeplinkButton?.click()
161159
Thread.sleep(2000)
@@ -239,6 +237,12 @@ class PushNotificationIntegrationTest : BaseIntegrationTest() {
239237
return null
240238
}
241239

240+
// systemui pre-API-31 applied Material's textAllCaps to action-button labels
241+
// ("Google" → "GOOGLE"); API 31+ stopped doing so. Match either rendering.
242+
private fun findActionButton(label: String): UiObject2? =
243+
uiDevice.findObject(By.text(label))
244+
?: uiDevice.findObject(By.text(label.uppercase()))
245+
242246
private fun navigateToPushNotificationTestActivity() {
243247
// Wait a bit for the app to fully open
244248
Thread.sleep(1000)

0 commit comments

Comments
 (0)