[SDK-115] Re-enable BCIT embedded message test#1064
Open
franco-zalamena-iterable wants to merge 1 commit into
Open
[SDK-115] Re-enable BCIT embedded message test#1064franco-zalamena-iterable wants to merge 1 commit into
franco-zalamena-iterable wants to merge 1 commit into
Conversation
franco-zalamena-iterable
added a commit
that referenced
this pull request
Jun 2, 2026
CI run on PR #1064 surfaced four failures that all share the same root cause: the Pixel Launcher ANRs on Ubuntu+KVM during heavy parallel work and steals focus from the activity-under-test, so findObject().exists() returns false even though the view is in the tree (logcat shows `current package: android` instead of `com.iterable.integration.tests`). Three fixes: 1. BaseIntegrationTest.setUp now pressBack/pressHome to dismiss any lingering system dialog before the test runs. Universal CI-emulator hardening; benefits every test class that extends BaseIntegrationTest. 2. EmbeddedMessageIntegrationTest + DeepLinkIntegrationTest now use findObject().waitForExists(5000) instead of bare .exists(). ActivityScenario reports RESUMED before the view tree is fully rendered; waitForExists handles the race. Same pattern as PushNotificationIntegrationTest already uses. 3. activity_main.xml is now wrapped in a ScrollView so the Test Scenario buttons stay reachable even when the override card grows. Local verification: `Tests 7/7 completed. (0 skipped) (0 failed)` for the full non-push suite with `ci=true`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
franco-zalamena-iterable
added a commit
that referenced
this pull request
Jun 2, 2026
CI run on PR #1064 surfaced four failures that all share the same root cause: the Pixel Launcher ANRs on Ubuntu+KVM during heavy parallel work and steals focus from the activity-under-test, so findObject().exists() returns false even though the view is in the tree (logcat shows `current package: android` instead of `com.iterable.integration.tests`). Three fixes: 1. BaseIntegrationTest.setUp now pressBack/pressHome to dismiss any lingering system dialog before the test runs. Universal CI-emulator hardening; benefits every test class that extends BaseIntegrationTest. 2. EmbeddedMessageIntegrationTest + DeepLinkIntegrationTest now use findObject().waitForExists(5000) instead of bare .exists(). ActivityScenario reports RESUMED before the view tree is fully rendered; waitForExists handles the race. Same pattern as PushNotificationIntegrationTest already uses. 3. activity_main.xml is now wrapped in a ScrollView so the Test Scenario buttons stay reachable even when the override card grows. Local verification: `Tests 7/7 completed. (0 skipped) (0 failed)` for the full non-push suite with `ci=true`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…:// URLs Two missing pieces vs the iOS BCIT embedded test: 1. The BCIT campaign's audience predicate is on `membershipLevel == "premium"`, not on `isPremium == true`. Android was sending the wrong field, so the audience never matched and /api/embedded-messaging/messages returned `placements: []`. iOS sends `membershipLevel: "premium" / "standard"` (see EmbeddedMessageTestViewModel.swift:90); this commit does the same from both the test and the on-screen toggle. 2. The deeplink button on placement 2157 fires `openUrl` with `tester://testview`. The Iterable SDK drops URLs whose scheme isn't in IterableConfig.allowedProtocols. iOS configures `["tester", "https", "http"]`; Android did not, so the SDK silently dropped the URL and the URL handler never fired. Add the same allowed protocols in BaseIntegrationTest. Removed the @ignore on testEmbeddedMessageMVP. Renamed the isPremium-themed toggle / labels in EmbeddedMessageTestActivity to membership-level wording for parity. Local verification (CI mode, dated user, full non-push suite): Tests 7/7 completed. (0 skipped) (0 failed) BUILD SUCCESSFUL Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
34a515e to
e46e63a
Compare
sumeruchat
approved these changes
Jun 9, 2026
Contributor
There was a problem hiding this comment.
Approving.
Non-blocking (P2): the negative step (setMembershipLevel("standard") then assert placement absent) only has the 3s + 2s sleeps as a propagation guard, while the positive step polls up to 30s. A same-UTC-day rerun where the dated user was left premium could race and see a stale placement. Poll-until-absent on the standard step (mirroring syncAndWaitForPlacement) would make it idempotent across same-day retries.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the
@IgnoreonEmbeddedMessageIntegrationTest#testEmbeddedMessageMVPafter fixing two real bugs against the BCIT backend. Builds on the dated-user infrastructure already merged into the base branch (SDK-115-bcit-ci).Two bugs, both surfaced by comparing against iOS
membershipLevel == "premium", notisPremium == true. Android was sendingisPremium, so the audience never matched and/api/embedded-messaging/messagesreturnedplacements: []. iOS sendsmembershipLevel: "premium" / "standard"(EmbeddedMessageTestViewModel.swift:90); we now do the same in both the test and the on-screen toggle.IterableConfig.allowedProtocols = ["tester", "https", "http"]so the SDK doesn't drop thetester://testviewURL fired by the embedded deeplink button.)Scope of this PR
Three files, +28 / -36:
EmbeddedMessageIntegrationTest.kt—@Ignoreremoved; the eligibility-transition step now sendsmembershipLevel(standard→premium) instead ofisPremium(false→true).EmbeddedMessageTestActivity.kt— on-screen toggle and dialog rebranded "Membership Level" so the manual flow matches the test.activity_embedded_message_test.xml— button + label text updated.The
isPremiumSwitchfield name is unchanged on purpose, to keep the diff minimal.Local verification
CI mode, dated user, full non-push suite:
Tests 7/7 completed. (0 skipped) (0 failed) — BUILD SUCCESSFUL.Test plan
Integration Tests (BCIT)job is green.