Maestro Deep Dive: Testing a SwiftUI App End to End
Описание и применение
Maestro CLI позволяет автоматизировать тестирование небольшого приложения SwiftUI, включая вход, работу с задачами и выход, генерируя отчёты.
Задача
Automate end‑to‑end testing of a small SwiftUI app with login and to‑do list screens.
Результат
Maestro CLI 2.10.0 successfully executed end‑to‑end tests for the TodoDemo app, handling login, system permission dialog, task operations, and logout, producing detailed reports.
Рабочий процесс
- Create Xcode project TodoDemo with SwiftUI
- Add accessibility identifiers to emailField, passwordField, loginButton, loginError
- Implement login logic with demo credentials
- Add TodoListView with add, complete, delete, progress, logout
- Write Maestro YAML test with reusable sub‑flows, env vars, conditional logic, JS, tags
- Run tests locally with Maestro CLI
- Inspect generated reports and debug failures
- Compare test syntax with XCUITest
Доказательства
The app has two screens: Login and My Tasks
Everything here uses the free, open-source Maestro CLI
The valid credentials are [email protected] / password123
- Дата записи: 2026-10-27T20:11:12.799Z