stripe / stripe-react-native

React Native library for Stripe.
https://stripe.dev/stripe-react-native
MIT License
1.27k stars 265 forks source link

Cannot access Primary Button from Payment Sheet on Android in Detox Tests #1504

Open cunderw opened 1 year ago

cunderw commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Present the PaymentSheet
  2. Attempt to tap the Primary (Pay $XX.XX) button on Android in a Detox Test
  3. Cannot access the button from a Detox Test

Expected behavior Detox can interact with the primary pay button

Smartphone (please complete the following information):

Additional context RN Version: 0.72.0

Code to present the payment sheet: `const {paymentSheet} = await fetchPaymentSheetParams();

    const {error} = await initPaymentSheet({
      appearance: PaymentSheetStyle,
      merchantDisplayName: 'Test',
      customerId: paymentSheet.customer,
      customerEphemeralKeySecret: paymentSheet.ephemeralKey,
      paymentIntentClientSecret: paymentSheet.paymentIntent,
      defaultBillingDetails: {
        email: user?.details?.email,
        name: user?.details?.firstName + ' ' + user?.details?.lastName,
      },
    });`

This works in iOS

    await waitFor(element(by.text(`Pay $${orderTotal}`)))
      .toBeVisible()
      .withTimeout(3000);

    await element(by.text(`Pay $${orderTotal}`)).tap();

Nothing tried has worked for Android, byId, byText, byType, etc...

raldred commented 1 month ago

Presumably this is related to the accessibility properties of the elements created by the native SDK rather than this react-native interface?