WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

[Bug]: unable to interact with symbolLayer using a test end2end framework (Detox) #4087

@rboucheron

Description

@rboucheron

Mapbox Implementation

Mapbox

Mapbox Version

default

React Native Version

0.76.7

React Native Architecture

Old Architecture (Paper/bridge)

Platform

iOS, Android

@rnmapbox/maps version

10.1.35

Standalone component to reproduce

import React from 'react';
import Mapbox from '@rnmapbox/maps';

type Props = {
 clusters: any[];
 markerStyle: any;
 clusterStyle: any;
 onPressMarkerCluster: (e: any) => void;
};

export default function ClusteredMarkers({
 clusters,
 markerStyle,
 clusterStyle,
 onPressMarkerCluster,
}: Props) {
 return (
   <Mapbox.ShapeSource
     id="hotels"
     shape={{
       type: 'FeatureCollection',
       features: clusters,
     }}
     onPress={onPressMarkerCluster}
   >
     <Mapbox.SymbolLayer
       id="marker"
       filter={['!', ['has', 'point_count']]}
       style={markerStyle}
     />
     <Mapbox.SymbolLayer
       id="cluster"
       filter={['has', 'point_count']}
       style={clusterStyle}
     />
   </Mapbox.ShapeSource>
 );
}

We are encountering a significant blocker when attempting to write End-to-End (E2E) tests for features involving map interactions using Detox.
It is currently impossible to interact with markers rendered by the <Mapbox.SymbolLayer /> component.

Observed behavior and steps to reproduce

  1. Inability to set testID: The <Mapbox.SymbolLayer /> component does not accept standard React Native UI properties like testID or accessibilityLabel.

  2. No Text or Label Exposure: The text properties or names associated with the GeoJSON features used in the layer are not translated into accessible labels, making text-based targeting (e.g., by.text('My Marker Name')) also impossible.

Consequently, when running a Detox test, any attempt to select a symbol results in a "View not found" error.

Expected behavior

We require a mechanism to assign and expose a unique identifier to the symbols rendered by the SymbolLayer so that E2E tools can interact with them.
For example, we would expect a solution that allows:

  • Targeting by feature property: Using a property from the GeoJSON feature (e.g., properties.id) as the testID for the symbol.

  • Interaction: Tapping, long-pressing, or querying the visible state of the symbol.

Is there a documented way to achieve E2E testability for SymbolLayer symbols that we may have missed?

Notes / preliminary analysis

No response

Additional links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions