Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create more E2E Tests #541

Open
KiwiKilian opened this issue Dec 8, 2024 · 1 comment
Open

Create more E2E Tests #541

KiwiKilian opened this issue Dec 8, 2024 · 1 comment

Comments

@KiwiKilian
Copy link
Collaborator

Currently there is only one E2E test, which checks if a Map is rendered and attribution for native SDK works. We should add more tests.

@brentforder
Copy link

FWIW, here's my quick stab at planning some easy wins for automated tests:

  • Add simple rendering tests like MapView's for all visual components:

    • BackgroundLayer, CircleLayer, FillExtrusionLayer, FillLayer, HeatmapLayer, LineLayer, RasterLayer, SymbolLayer
    • Annotation, Callout, HeadingIndicator, Light, NativeUserLocation, MarkerView, PointAnnotation, UserLocation
  • For the following component events, assert that the correct feature ID, geographic & view coordinates are returned for simulated presses/touches:

    • ShapeSource, with each combination of layer component: onPress() -> onPressEvent
    • Annotation: onPress() -> onPressEvent
    • PointAnnotation: onSelected(), onDeselected() -> FeaturePayload
    • MarkerView on iOS: onSelected(), onDeselected() -> FeaturePayload
    • MarkerView on Android: onPointerDown() -> PointerEvent (view coords only)
  • For the following draggable components, assert that returned view coordinates match expected coordinates for simulated drag movements:

    • PointAnnotation: onDragStart() -> FeaturePayload
    • MarkerView on iOS: onDragStart() -> FeaturePayload
    • MarkerView on Android:
      • onPointerMove() -> PointerEvent
      • onPointerMoveCapture() ->PointerEvent
      • onTouchMove() -> GestureResponderEvent
  • For the following draggable components, assert that returned view coordinates match expected coordinates for simulated drag movement completion:

    • PointAnnotation: onDragEnd() -> FeaturePayload
    • MarkerView on iOS: onDragEnd() -> FeaturePayload
    • MarkerView on Android:
      • onPointerUp() -> PointerEvent
      • onPointerUpCapture() -> PointerEvent
      • onTouchEnd() ->GestureResponderEvent
      • onTouchEndCapture() -> GestureResponderEvent

I would like coordinate system tests like the following, but it's more complex and I'm not sure how to do image-searching of the screen in RN:

  • View coordinates: For all visual components, assert random expected view coordinates within the visible MapView region upon rendering. The coordinates are checked by image-searching the screen for the marker/element,
  • Geographic coordinates: For all map layer/marker components, assert random expected geographic coordinates upon rendering. The coordinates are checked by adjusting Camera.centerCoordinate to expected coordinates, waiting for MapView.onRegionDidChange(), and image-searching the screen for the marker/element.

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

No branches or pull requests

2 participants