XCUIElement tap() method doesn't work

Originator:xavi.gil
Number:rdar://26320475 Date Originated:17-May-2016 02:51 PM
Status:Duplicate of 23764033 Resolved:
Product:Developer Tools Product Version:7.3.1
Classification:Serious bug Reproducible:Always
 
Summary:
Calling tap() doesn't trigger the associated IBAction logic

Steps to Reproduce:
1. Create a XCTestCase in your UITests
2. Set a XCUIElement variable by querying a UIButton
2. Call the tap() method no the previous XCUIElement

Expected Results:
The IBAction logic is run 

Actual Results:
The IBAction logic is not run. Either set a breakpoint or test the resulting IBAction to realise

Version:
7.3.1

Notes:
If the tap() instruction is duplicated and called twice, the test passes.

Comments

Apple engineer work around:

"The second possibility is that you are running into a problem that sometimes occurs where the application finishes launching but the splash screen doesn't immediately disappear and events dispatched to the app are not handled properly.

To try to work around that issue, consider placing a small delay at the beginning of your test (sleep(1) should be enough)."


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!