Skip to content

Commit

Permalink
chore: increased timeout times
Browse files Browse the repository at this point in the history
  • Loading branch information
kikoso committed Oct 11, 2023
1 parent b4aaaa8 commit 8881419
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class GoogleMapViewTests {
initMap()
assertEquals(CameraMoveStartedReason.NO_MOVEMENT_YET, cameraPositionState.cameraMoveStartedReason)
zoom(shouldAnimate = true, zoomIn = true) {
composeTestRule.waitUntil(1000) {
composeTestRule.waitUntil(timeout2) {
cameraPositionState.isMoving
}
assertTrue(cameraPositionState.isMoving)
Expand All @@ -92,10 +92,10 @@ class GoogleMapViewTests {
fun testCameraReportsNotMoving() {
initMap()
zoom(shouldAnimate = true, zoomIn = true) {
composeTestRule.waitUntil(1000) {
composeTestRule.waitUntil(timeout2) {
cameraPositionState.isMoving
}
composeTestRule.waitUntil(5000) {
composeTestRule.waitUntil(timeout5) {
!cameraPositionState.isMoving
}
assertFalse(cameraPositionState.isMoving)
Expand All @@ -106,10 +106,10 @@ class GoogleMapViewTests {
fun testCameraZoomInAnimation() {
initMap()
zoom(shouldAnimate = true, zoomIn = true) {
composeTestRule.waitUntil(1000) {
composeTestRule.waitUntil(timeout2) {
cameraPositionState.isMoving
}
composeTestRule.waitUntil(3000) {
composeTestRule.waitUntil(timeout3) {
!cameraPositionState.isMoving
}
assertEquals(
Expand All @@ -124,10 +124,10 @@ class GoogleMapViewTests {
fun testCameraZoomIn() {
initMap()
zoom(shouldAnimate = false, zoomIn = true) {
composeTestRule.waitUntil(1000) {
composeTestRule.waitUntil(timeout2) {
cameraPositionState.isMoving
}
composeTestRule.waitUntil(3000) {
composeTestRule.waitUntil(timeout3) {
!cameraPositionState.isMoving
}
assertEquals(
Expand All @@ -142,10 +142,10 @@ class GoogleMapViewTests {
fun testCameraZoomOut() {
initMap()
zoom(shouldAnimate = false, zoomIn = false) {
composeTestRule.waitUntil(1000) {
composeTestRule.waitUntil(timeout2) {
cameraPositionState.isMoving
}
composeTestRule.waitUntil(3000) {
composeTestRule.waitUntil(timeout3) {
!cameraPositionState.isMoving
}
assertEquals(
Expand All @@ -160,10 +160,10 @@ class GoogleMapViewTests {
fun testCameraZoomOutAnimation() {
initMap()
zoom(shouldAnimate = true, zoomIn = false) {
composeTestRule.waitUntil(1000) {
composeTestRule.waitUntil(timeout2) {
cameraPositionState.isMoving
}
composeTestRule.waitUntil(3000) {
composeTestRule.waitUntil(timeout3) {
!cameraPositionState.isMoving
}
assertEquals(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class StreetViewTests {
onClick = onClick
)
}
composeTestRule.waitUntil(10000) {
composeTestRule.waitUntil(timeout5) {
cameraPositionState.location.position.latitude != 0.0 &&
cameraPositionState.location.position.longitude != 0.0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package com.google.maps.android.compose
import com.google.android.gms.maps.model.LatLng
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
const val timeout2 = 2_000L
const val timeout3 = 3_000L
const val timeout5 = 5_000L

val hasValidApiKey: Boolean =
BuildConfig.MAPS_API_KEY.isNotBlank() && BuildConfig.MAPS_API_KEY != "YOUR_API_KEY"
Expand Down

0 comments on commit 8881419

Please sign in to comment.