diff --git a/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core/EvOfflineTest.kt b/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core/EvOfflineTest.kt index def40465549..008b756b19f 100644 --- a/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core/EvOfflineTest.kt +++ b/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core/EvOfflineTest.kt @@ -95,18 +95,30 @@ class EvOfflineTest : BaseCoreNoCleanUpTest() { 0.0f, ) { withoutInternet { + Log.d("Test.", "Test. request routes") + val requestResult = navigation.requestRoutes(originalTestRoute.routeOptions) .getSuccessfulResultOrThrowException() assertEquals(RouterOrigin.Onboard, requestResult.routerOrigin) navigation.setNavigationRoutesAsync(requestResult.routes) + Log.d("Test.", "Test. routes requested") + assertEquals( "onboard router doesn't add charging waypoints", listOf(2, 2), requestResult.routes.map { it.waypoints?.size } ) } + + Log.d("Test.", "Test. waiting update routes in online") + val onlineRoutes = navigation.routesUpdates().first { + Log.d( + "Test.", + "Test. updates: ${it.reason}, ${it.navigationRoutes.first().origin}" + ) + it.reason == RoutesExtra.ROUTES_UPDATE_REASON_NEW && it.navigationRoutes.first().origin == RouterOrigin.Offboard } diff --git a/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/utils/tiles/TileStore.kt b/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/utils/tiles/TileStore.kt index a8990930900..c4260a11121 100644 --- a/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/utils/tiles/TileStore.kt +++ b/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/utils/tiles/TileStore.kt @@ -62,10 +62,15 @@ suspend inline fun BaseCoreNoCleanUpTest.withMapboxNavigationAndOfflineTilesForR historyRecorderRule = historyRecorderRule, routeRefreshOptions = routeRefreshOptions ) { navigation -> + Log.d("Test.", "Test. loading tiles") + val tilesAreLoaded = withTimeoutOrNull(TIME_TO_LOAD_TILES) { loadRegion(navigation, region) true } ?: false + + Log.d("Test.", "Test. Tiles loaded: $tilesAreLoaded") + assumeTrue( "wasn't able to load routing tiles on time, ignoring test", tilesAreLoaded