test(api-demos): stabilize visual testing suite and fix rendering glitches#44
Open
dkhawk wants to merge 20 commits into
Open
test(api-demos): stabilize visual testing suite and fix rendering glitches#44dkhawk wants to merge 20 commits into
dkhawk wants to merge 20 commits into
Conversation
…sh UI test baseline - Created a centralized samples catalog at the repository root for better discoverability, integrating the PlacesUIKit3D sample. - Created BasicComposeMapActivity from scratch to serve as a minimal pedagogical reference for Maps 3D Compose integration. - Established a baseline of UI smoke tests across key activities in both advanced and PlacesUIKit3D modules to ensure stability.
Created ComposeDemos module with skeletons, tests, and automation script. Reorganized catalog into module-specific READMEs.
Enabled immersive mode in all implemented activities and updated screenshots in catalog.
Implemented Polygons, Models, and Markers samples in Compose with visual tests and updated catalog.
Implemented Camera Restrictions sample in Compose with visual test and updated catalog.
…log automation - **Java App**: Fix `CameraControlsVisualTest` by searching for "Heading" after UI string update. - **Kotlin App**: Add skeleton activities to `MainActivity` and add `:visual-testing` dependency. - **Common**: Update `camera_state_format` to use "Heading:" instead of "Hdg:" to align with Kotlin. - **Visual Testing**: Add blocking methods to `GeminiVisualTestHelper` for Java interop and update model to `gemini-2.5-pro`. - **Automation**: Update `catalog_automation.py` to save screenshots to `screenshots/` instead of `assets/` to avoid bundling them in the APK. This change brings the Java and Kotlin View samples into better alignment, fixes the failing camera controls test, and improves the automation infrastructure for generating documentation catalogs.
…va and Kotlin Views
…ttern for Java and Kotlin View samples
…tches - Correct Gemini model endpoint configurations in GeminiVisualTestHelper.kt to use gemini-3.5-flash on the v1beta API endpoint for unified visual testing. - Resolve Denver altitude rendering glitch in PolygonsActivity.java by switching from UnitsKt.getMeters(1.0) to UnitsKt.getMiles(1.0), preventing the camera and polygons from rendering deep underground. - Refactor PolygonsActivity.java view lifecycle to utilize the robust delayed initialization fallback pattern for 3D renderer stability. - Align prompts and expectations in MarkersVisualTest (Java and Kotlin) to verify the NYC / Giant Ape / custom pins configuration instead of the outdated Devils Tower setup. - Align prompts and expected text in PopoversVisualTest (Java and Kotlin) to target the Golden Gate Bridge marker and check for its populated popover layout. - Implement standard camera setup in HelloMapActivity.kt at the Delicate Arch to achieve full visual parity with the Java implementation. - Resolve JSON substring extraction bug in PopoversVisualTest.kt by utilizing standard string concatenation. - Integrate explicit setOnMapSteadyListener wait synchronization at the start of CameraControlsActivityTest.testFlyAround to prevent coordinate validation races.
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.
Overview
This PR stabilizes and fixes the instrumented visual testing suites in both the Java and Kotlin View-based
ApiDemosapplications for the Maps 3D SDK. It resolves rendering errors, prompt discrepancies, lifecycle race conditions, and ensures 100% green test verification on physical connected devices.Key Changes
Endpoint Verification (
visual-testing)GeminiVisualTestHelper.ktto usegemini-3.5-flashon Ktorsv1beta` API endpoint, avoiding regional/version discrepancy errors.Denver Altitude Fix (
PolygonsActivity.java)UnitsKt.getMeters(1.0)withUnitsKt.getMiles(1.0)(which evaluates to ~1609 meters). This corrects the initial camera and museum polygon altitude which was previously set at ground/sea level (deep inside the Denver terrain), fixing the severe blueish-grey mesh rendering glitch.PolygonsActivityinitialization to utilize a robust, delayedHandlerfallback pattern to let the 3D rendering engine stabilize before placing map camera or geometry.Visual Prompt Alignments (
java-appandkotlin-app)MarkersVisualTest(Java/Kotlin) to expect the NYC / Giant Ape marker on the Empire State Building and red/yellow pins instead of the outdated Devils Tower setup.PopoversVisualTest(Java/Kotlin) to locate the "Golden Gate Bridge" marker and assert on "The Golden Gate Bridge" popover title text.Kotlin App Fixes & Synchronization
HelloMapActivity.ktto center on Delicate Arch (38.743502, -109.499374), aligning it with the Java counterpart and allowing the visual test to successfully verify the Delicate Arch.s lambda inPopoversVisualTest.kt` using standard string concatenation.setOnMapSteadyListenercountdown latch synchronization insideCameraControlsActivityTest.testFlyAroundto ensure the camera has fully settled at NYC coordinates before clicking "Fly Around". This avoids state leaks and coordinate mismatches from previous tests.Testing
./gradlew :Maps3DSamples:ApiDemos:java-app:connectedDebugAndroidTeston Pixel 6 -> All 9/9 tests passed../gradlew :Maps3DSamples:ApiDemos:kotlin-app:connectedDebugAndroidTeston Pixel 6 -> All 12/12 tests passed.