Skip to content

Commit d7ac834

Browse files
[SDK-115] Re-enable testPushNotificationActionButtons
The previous @ignore reason ("action buttons aren't laid out in the collapsed shade") was wrong. Dumping the systemui hierarchy from a CI-mode run shows both action buttons present and clickable in the shade — but their text is rendered as "GOOGLE" / "DEEPLINK" because systemui applies Material's textAllCaps to action-button labels. By.text("Google") never matches. Tiny helper findActionButton(label) uppercases before lookup. Both action button paths (URL handler via "Google", custom action handler via "Deeplink") now pass under the existing Phase B simulated-push path. Local verification (CI mode): $ ./gradlew :integration-tests:connectedDebugAndroidTest \ -Pandroid.testInstrumentationRunnerArguments.class=com.iterable.integration.tests.PushNotificationIntegrationTest \ -Pandroid.testInstrumentationRunnerArguments.ci=true Pixel_3(AVD) - 9 Tests 1/2 completed. (0 skipped) (0 failed) BUILD SUCCESSFUL Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent bab3c07 commit d7ac834

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 7 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
@@ -116,7 +115,6 @@ class PushNotificationIntegrationTest : BaseIntegrationTest() {
116115
}
117116

118117
@Test
119-
@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.")
120118
fun testPushNotificationActionButtons() {
121119
Assert.assertTrue("User should be signed in", testUtils.ensureUserSignedIn(TestConstants.TEST_USER_EMAIL))
122120
Assert.assertTrue("Notification permission should be granted", hasNotificationPermission())
@@ -138,7 +136,7 @@ class PushNotificationIntegrationTest : BaseIntegrationTest() {
138136
Assert.assertNotNull("Notification should be found", findNotification())
139137

140138
resetUrlHandlerTracking()
141-
val googleButton = uiDevice.findObject(By.text("Google"))
139+
val googleButton = findActionButton("Google")
142140
Assert.assertNotNull("Google button should be found", googleButton)
143141
googleButton?.click()
144142
Thread.sleep(2000)
@@ -158,7 +156,7 @@ class PushNotificationIntegrationTest : BaseIntegrationTest() {
158156
Assert.assertNotNull("Notification should be found", findNotification())
159157

160158
resetCustomActionHandlerTracking()
161-
val deeplinkButton = uiDevice.findObject(By.text("Deeplink"))
159+
val deeplinkButton = findActionButton("Deeplink")
162160
Assert.assertNotNull("Deeplink button should be found", deeplinkButton)
163161
deeplinkButton?.click()
164162
Thread.sleep(2000)
@@ -242,6 +240,11 @@ class PushNotificationIntegrationTest : BaseIntegrationTest() {
242240
return null
243241
}
244242

243+
// systemui renders notification action labels in uppercase via Material's textAllCaps,
244+
// so the label we set ("Google") is rendered as "GOOGLE" in the accessibility tree.
245+
private fun findActionButton(label: String): UiObject2? =
246+
uiDevice.findObject(By.text(label.uppercase()))
247+
245248
private fun navigateToPushNotificationTestActivity() {
246249
// Wait a bit for the app to fully open
247250
Thread.sleep(1000)

0 commit comments

Comments
 (0)