I've been writing test automation in KIF, and I really like the level of integration that KIF provides. I was hoping for the same from XCUITest, but it appears that my test target doesn't link against the app.
Some examples of how I use this:
1. Test that requires a user be logged out. I can get access to a property within the app that says, yes or no, whether a user is logged in. I can bypass my test "logOut" method if there is no logged-in user. This works better than looking for evidence on-screen of someone being logged in.
2. We have buttons that show they are "selected" by a changing background color behind them. If I had app access, I could inspect that particular table cell and get information about it, to determine whether it was selected.
Another forum post had an answer that we just need to link the test target to the app target in the project editor. Specifically, "This is done on the General tab of your test target in the project editor." I looked, but such an option is not there. The only option is which target application to test, and that was already correctly selected.
Is there a way to link XCUITest to app code for deeper test integration?