Skip to content

Commit a1d701e

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 4a6dd2d commit a1d701e

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
@@ -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,11 @@ class PushNotificationIntegrationTest : BaseIntegrationTest() {
239237
return null
240238
}
241239

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

0 commit comments

Comments
 (0)