iOS app testers, the game changer is here
Hi there bugs,
Recently Apple introduced this new technology called Xcode UI Tests. (Documentation in the link. Just kidding, there's no documentation)
Why does the code bug care. Well, if up until now you tested your iOS apps manually like this:
The code bug knows how boring this can be.
What you can now do is press Command + U and let the tests run themselves like this:
But Code Bug, you yell, I saw in the video that we have to write code. You know we don't like to write code.
Well, here is how you create those tests. You record them :
You press the record button tap button and code is magically generated.
After you have them all recorded, either press Command + U to run your UI tests or by typing this:
xcodebuild -scheme "SchemeName" \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 6,OS=9.0'
test
See Felix Krausse's article to get more details on running your tests from the command line.
If you want to test for something XCTAssert is your friend. You can have conditions like the existence of a button:
XCTAssertTrue(app.buttons["Login"].exists)
Or check that a table has only one row
XCTAssertTrue(app.tables.cells.count == 1)
To get more information on how to test and assert that certain things should happen including demos go to Apple's website.
Hopefully this will save you massive amounts of time. If you don't know Swift, don't worry, your developer most likely does. Automating your UI Tests will increase your productivity by at least a factor of two. Any investment is worth it