Skip to content

test: add multi-tier testing pyramid with Kotlin Power-Assert, Google Truth, and android-maps-testing - #32

Draft
dkhawk wants to merge 1 commit into
mainfrom
test/navigation-samples-suite
Draft

dkhawk wants to merge 1 commit into
mainfrom
test/navigation-samples-suite

Conversation

@dkhawk

@dkhawk dkhawk commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a 3-tier testing pyramid across both standalone projects in this repository (navigation-sample in Kotlin/Java and map-sample in Java), totaling 82 automated tests across 15 test suites (76 fast host-side JVM, Robolectric, and deterministic golden screenshot tests + 6 connected-device smoke and AI visual tests):

  • Tier 1 — Fast Host-Side Pure JVM & Robolectric Shadow Tests (71 tests / 9 suites):
    • Configures org.jetbrains.kotlin.plugin.power-assert alongside com.google.maps.android:maps-testing-robolectric:1.0.0-rc01 Power-Assert extensions (assertGeo, assertMap, assertMarker, distanceTo, meters, isCenteredOn, connects, hasVertexNear, contains) for Kotlin tests.
    • Uses Google Truth (Truth.assertThat) and MapsTruth.assertThat(map) domain subjects for Java code and Java-to-Kotlin interop tests (LayoutDelegatesJavaTest.java, MapUtilitiesJavaTest.java, MapActivitiesTruthTest.java).
  • Tier 2 — Offline Deterministic Golden Screenshot Tests (5 tests / 2 suites):
    • Uses com.google.maps.android:maps-testing-golden:1.0.0-rc01 (enableGoldenTesting, GoldenTileStrategy, assertMatchesGolden, hasOverlayPixelAt) with 5 recorded and committed .png baseline images under src/test/resources/goldens/.
  • Tier 3 — Connected-Device Smoke & Multimodal AI Visual Tests (6 tests / 4 suites):
    • Uses AndroidJUnit4, Google Truth, and com.google.maps.android:maps-testing-visual:1.0.0-rc01 (BaseVisualTest + verifyScreenshotWithGoldenFallback) in NavigationSampleSmokeTest.kt, NavigationVisualTest.kt, MapSampleSmokeTest.java, and MapSampleVisualTest.kt.
  • Bug Fix:
    • Fixes a NullPointerException in CustomizationPanelsDelegate.kt where AdapterView.OnItemSelectedListener.onItemSelected declared a non-null view: View parameter (which is null when Spinner.setSelection fires while a customization panel is hidden).

Verification

  • cd navigation-sample && ./gradlew testDebugUnitTest lintDebug assembleDebugAndroidTest (37/37 unit/Robolectric/Golden tests passing, 0 lint/compile errors)
  • cd map-sample && ./gradlew testDebugUnitTest lintDebug assembleDebugAndroidTest (39/39 unit/Robolectric/Golden tests passing, 0 lint/compile errors)

… Truth, and android-maps-testing

- Add 76 host-side unit, Robolectric, and deterministic golden screenshot tests across navigation-sample (37 tests) and map-sample (39 tests), plus 6 connected-device smoke and AI visual tests (82 total tests across 15 suites).
- Configure org.jetbrains.kotlin.plugin.power-assert with android-maps-testing Power-Assert extensions (assertGeo, assertMap, assertMarker) for Kotlin tests and Google Truth + MapsTruth subjects for Java tests.
- Record and commit 5 deterministic golden baseline PNGs under src/test/resources/goldens/ using com.google.maps.android:maps-testing-golden.
- Fix nullable view parameter in CustomizationPanelsDelegate.OnItemSelectedListener.onItemSelected when Spinner selection fires while panel is hidden.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant