KassiOS: a Kaspresso-style layer for XCUITest, tested against a broken bank
Описание и применение
KassiOS — слой над XCUITest, обеспечивающий ожидание, повторные попытки и подробный отчёт, протестированный на искусственно баговатом приложении ChaosBank.
Задача
XCUITest lacks built‑in waiting, retries, screen objects and reporting, leading to fragile tests.
Результат
KassiOS reduced test code verbosity, centralized waiting logic, and uncovered hidden defects in both the app and the framework itself when run against ChaosBank.
Рабочий процесс
- 1. Define screen objects as subclasses of KassScreen with lazy elements and onLoad arrays.
- 2. Write tests using onScreen blocks that perform actions and assertions.
- 3. KassiOS automatically waits for elements, retries within a time budget, scrolls, dismisses keyboard, and verifies state changes.
- 4. On failure, KassiOS captures a screenshot, accessibility tree, and a helpful message.
- 5. Run tests against ChaosBank, a deliberately buggy app, to validate defect detection.
Доказательства
XCUITest gives you primitives and leaves waiting, retries, screen objects and reporting to you.
KassiOS checks the elements in onLoad. If the app ended up on a different screen, the test fails right there, in the "On LoginScreen" step, instead of on whichever field it happened to touch first.
When something does fail, the report gets a screenshot of the screen at that moment and the full accessibility tree, and the message tries to say why: KassiOS: text 'welcom' — assertVisible failed: does not exist ↳ element not found in the current hierarchy ↳ did you mean: 'welcome', 'Welcome!'?
The first full run had 34 tests (Xcode 27.1, iPhone 17 simulator, M1 Max), and it was humbling: test_portfolio_showsTotalAndPnl stayed green with every defect on, including one that shows a loss as a gain.
- Дата записи: 2026-11-02T05:44:02.679Z