2

Since upgrading to Xcode 8.1 my UI tests that use twoFingerTap() to zoom out on a Google Maps GMSMapView have been failing with

Assertion Failure: Element.swift:135: UI Testing Failure - Unable to find unoccluded area to perform event.

The message preceding that is

Recompute visible frame by excluding frames of occluding elements StatusBar and "the view's identifier"

Anyone have any idea what I should do about that? Tried tapWithNumberOfTaps(1, numberOfTouches: 2) and same thing happens.

NB. The problem is definitely with multi-finger taps only -- doubleTap() and pinchWithScale(2.0, velocity: 1.0) continue to work fine under Xcode 8.1. pinchWithScale(0.5, velocity: -1.0) continues to move origin instead of zooming, which is what it did to GMSMapView in Xcode 7 as well.

Alex Curylo
  • 4,744
  • 1
  • 27
  • 37
  • Same problem here (Xcode 8.2 beta (8C30a), Swift 3.0.2) , have you managed to find a workaround ? It appears to fail more often on 4" devices simulators such as iPhone 5 or SE. I have far less problems on larger devices... – Arnaud Nelissen Nov 29 '16 at 23:13
  • Closest I could come was digging into the subviews by index and tapping them manually. That works ... occasionally. At the moment all our Google Maps tests still disabled and back on the manual list :( – Alex Curylo Nov 30 '16 at 07:39
  • Ok thanks, hoping for a more robust solution – Arnaud Nelissen Nov 30 '16 at 19:13
  • @alexcurylo Did you found solution for your problem? – Ramis Jul 13 '17 at 09:30
  • @Ramis What I ended up doing was creating a 'Zoom' button when UI Testing and tapping that – Alex Curylo Jul 14 '17 at 22:15
  • @alexcurylo For as it is not working, but for for other as shown [here](https://github.com/TitouanVanBelle/Map) it works. – Ramis Jul 16 '17 at 17:33

3 Answers3

0

I am not sure if you're drawing your UI, or using storyboards. Nevertheless, it doesn't appear that you have the elements drawn to the view properly. Perhaps using constraints you can secure the element to your view.

mrabins
  • 197
  • 1
  • 2
  • 10
  • Use `self.googleMapView = [[GMSMapView alloc] init];` and set its `accessibilityIdentifier` and `addSubview` directly to container. Works fine when run from Xcode 7. So not seeing how constraints would help here. – Alex Curylo Nov 02 '16 at 03:27
  • @alexcurylo - i'm adding google map view as a subview in my application and setting it's accessibilityIdentifier still it's not accessible.i want to write UITest for Map view existence and tap on particular marker.i tried with finding view hierarchy from app.debugdescription but cannot find map view in it.Any help,How to achieve? – Nitisha Sharma Jul 10 '17 at 13:06
  • The hierarchy is different every time you run and there appears to be no way to identify a particular marker reliably that I've found yet. – Alex Curylo Jul 11 '17 at 19:32
0

Ive just upgraded to Xcode9 (beta) and this issue appears to be resolved

Fraser
  • 953
  • 11
  • 21
0

Not sure if you already solve your case but It will help if you put Google Map inside another view and then set it's accessibility in storyboard (make sure Accessibility's "Enabled" and "User Interaction Enabled" is checked)

Then you can find it inside otherElements and tap or doubleFingerTap on it.

Farshad Sheykhi
  • 92
  • 1
  • 10