Hello Everyone!
This feels really stupid, but I'm really stuck... Is there any documentation for the new Xcode 7 UI Testing? I really can't find it.
Thanks!
Hello Everyone!
This feels really stupid, but I'm really stuck... Is there any documentation for the new Xcode 7 UI Testing? I really can't find it.
Thanks!
Really wish I could find some documentation on this subject too 😟
Only what I've seen in the https://developer.apple.com/xcode7-beta-release-notes
UI Testing
User interface testing and recording. Test applications at the user interface surface with elements, queries, and simulated events. The UI recording feature enables capture of UI actions into source to facilitate creating tests.
Workaround: Set an accessibility identifier instead.
UI testing may fail to find elements with names containing decomposable Unicode characters. (20804391)
title.precomposedStringWithCanonicalMapping.
Workaround: Disable auto-correct on devices and simulators used for UI testing.
Workaround: Launching the application before clicking the “Record” button should resolve this.
◅▻
If you haven't watched the UI Testing session at https://developer.apple.com/videos/wwdc/2015/?id=406 yet, that's definitely worth your time.
Yeah same here, just started using it and not sure how to do a lot of things other than use the record button.
Would love to know how to wite a test that waits for a network request to finish
Lucky me i had watched that . But im experiencing multiple questions when it gets to details. I think some kind of reference like it was with UI Automation will be very helpful
You shouldn't be testing with the network, you should be mocking it. You cannot guarantee that the network will be available or the server on the other end when you run your tests, so your tests are never deterministic.
What I've been doing is creating a mock web service with my expected result for a request, serializing the object and passing that through to the UI Tests application launch arguments. Then in the actual code, I have a Resolver which if I'm running a UI Test deserializes any objects and assigns them to my properties.
That way I can make a UI Test return a 404, wrong JSON, bad JSON, whatever I want for any request. With no-need for an API to hit.
eg.
MyClass has a WebService property which is a WebServiceProtocol.
I have a TestWebService which is a WebServiceProtocol.
The UI Test serializes the TestWebService into the app.launchArguments
MyClass has a Resolve step which either creates a new WebService, or deserializes from the Launch Arguments.
The serialize/deserialize step is a bit of a pain, so I just wrote a framework for it, now my entire app uses it.
If there's a better way to do this for UI Testing, I'm all ears.
I found this: http://joemasilotti.github.io/XCTest-Documentation/
Someone has quite cleverly "extracted" some early documentation:
"One of the first things you might notice about the new framework is the lack of documentation. Neither iOS 9 nor Xcode 7 include any official docs on UI Testing. Luckily, most of the new
XCU*
classes have well commented header files. By using appledoc, I was able to pull these header files into an Xcode and Dash compatible docset. Just clone the repository and open up the file; your default documentation browser will add the new APIs."He has put the resultant reference structure up on GitHub here:
joemasilotti.github.io/XCTest-Documentation/index.html
For the article in which he discusses UI Testing in Xcode 7:
masilotti.com/ui-testing-xcode-7/
Thanks for the mention! Here's an online-viewable version of the XCTest documentation.
Searching for such a framework before writing it on my own I found your reply.
Is there any chance to get access to this framework, or any blog post where you explain about?