2

I am using the Google Maps API in my app following the instructions provided here. As soon as I launch the app, a permission modal comes up to ask for location services to be turned on. I have UI tests using EarlGrey being run on the app and I noticed that I am unable to interact with this modal and no other EarlGrey action can be performed.

Does EarlGrey not support modals at all or does this only have to do with system modals?

Wyetro
  • 8,439
  • 9
  • 46
  • 64
Zheng Xu
  • 101
  • 6

1 Answers1

2

EarlGrey can only interact with modal dialogs and alerts that belong to the app process based on their features doc.

Note: Out-of-process (i.e. system generated) alert views and other modal dialogs that obscure the UI can interfere with this process (Visibility Check / Interactions).

However, there are workarounds by which you can facilitate the dismissing of these modals and alerts.

  • You can use this workaround for System Dialogs, that's been tested on the simulator.

  • You could manually add accept the prompts, thus any further test invocation would have them already accepted/dismissed.

  • In case these might be internal dialogs or so, you could also try and mock them.

gran_profaci
  • 8,087
  • 15
  • 66
  • 99