Menu

KassiOS: a Kaspresso-style layer for XCUITest, tested against a broken bank
πŸ“°

KassiOS: a Kaspresso-style layer for XCUITest, tested against a broken bank

DEV Community: iosΒ·Vadim ToptunovΒ·14 days ago
#8VdBET39
#devtoios#devto#dev#test#kassios
Reading 0:00
15s threshold

My background is QA automation, mostly mobile and mostly Appium. When I decided to learn native iOS UI testing properly, XCUITest looked like the obvious choice: it's Apple's own framework, it needs no automation server, and it works with the accessibility hierarchy directly. Then a simple login turned into this:

let email = app . textFields [ "login.email" ] XCTAssertTrue ( email . waitForExistence ( timeout : 10 ), "Email field did not appear" ) email . tap () email . typeText ( "[email protected]" )

let loginButton = app . buttons [ "login.submit" ] XCTAssertTrue ( loginButton . waitForExistence ( timeout : 10 ), "Login button did not appear" ) loginButton . tap ()

Enter fullscreen mode

Exit fullscreen mode

XCUITest gives you primitives and leaves waiting, retries, screen objects and reporting to you. In most projects I've seen, that gap gets filled by a waitAndTap() extension, then a few more, until there's a small framework that nobody tests.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.