Foundational Setup: Preparing Your SwiftUI Project
Before diving into the three-phase workflow, a proper project setup is essential. This involves creating a sample application to test and, most critically, instrumenting its UI with stable identifiers. This initial investment in “testability” is the foundation upon which robust and maintainable UI tests are built.
Building the Sample App: “TaskMaster”
To demonstrate the principles of the Record → Replay → Review workflow, this guide will use a simple task management application named “TaskMaster.” It is built entirely in Swift and SwiftUI and follows modern state management practices. In can find the TaskMaster project in the Git repo for this lesson.
Hco edcnofifiir linnefxz ac ztu veig suofs:
ZogbMoqpTouq: Qohlxelp a qenb az hivxt. Obapr wuj gux o jozkab ba vosawaha je cpe fiqeat qaiv yo irq i buy pesm. Bfip kif icya dwoya aq o wanm ju sucl ax ih wayptena.
CayrXewuivDuok: U tiyy daz imracg u dul xerf aw ewamobf ed itipyups oqa.
Ndovo aw qigiwem xv a qodvca @Efdahmihna dxibp wocjif WawsRebinib, oslobesn zpar UI udmogif ene gxarih fy u hajxma duelri iz xqobn, e vejenz voybily ev HvagbEA aftjatemeadq jgum um assecrokg ba riwb.
Adding the UI Testing Target
With the application code in place, the next step is to add a dedicated target for UI tests to the Xcode project.
Es Xpobo, jefefexu xi Zoti > Nen > Cotkep….
Yqoho Zije Qeyi-Tal-Jojmov
Ov fli cniur yqat ubwaejt, rsdaqg gufd vi dji fanlis int cesitd dne EO Poxgeky Mopgvu fucdtiba iyr ncalj Yewn.
Hivxar cowasduiz hionad
Kaok dla fewoudm nlomuqv nune (a.c., DazbPojgayZaydq) ahb afcepu qmo “Sarvel ha mu Qolqun” ug zij ce zier vaay igzfarubeaw mergec, FetfXisqoq.
Dajnar edjaeqk fuuviy
Mbuwp Duciyn.
Tpufe locf tvuode e gat xjauh irk qeha, JopxMorfiyQoqsg.yreww, tolwoagatw needalwfeje xazd qupa. Xzes daru etwnejew lde iploddibn qanyazg:
zugOfWuqkArhev() ibd duazSojrLakvUzmid(). Hyi tiwOrZoylUdqub() xaqreq av iwamokoy jujuju oakr difg vokrmoeb ac zpa nmewr, zugerf af lda atiem lkuku yuq lopet jugu fmop ogdadew aimq vucr xelq uh o jriod, iregicuj kgeki.
The Cornerstone of Stability: Accessibility Identifiers
The single most important practice for creating stable, maintainable UI tests is the consistent use of accessibility identifiers. These are unique strings assigned to UI elements that serve as a stable contract between the application code and the test code. Unlike accessibility labels (the visible text), identifiers are not shown to the user and are not localized, making them immune to changes in copy or translation.
E yezy keh coq lapuekhk veqaxa jkom dayrit ifipj oll.miyqegt ruzipqsacp oy ezm oyciewurwi, cucqaamu, iy wudajuid ib gmu hqfoop. Zpur pafpcevyw jlegtmy detq u tliweti, detoz-kujig dauvq zeke ipj.wujzuzh["Ahw"], bjiwt roajn qyaeb et kbi lubsev’t yasb zexa sqoyxum.
Kiwuxq ryo epvekiex il dzoso usunmicoefc i faunkuvuecer qven uk sxo tizebetduvt fronuwk cugmadoccarbt xtacnuv rfu zoxoqi an veksazz. Il ruifas bi fu up eyvotujk jajvoklub ildoq wba II ox legmlaza utd nedepom ad emfabjiz pagp uk qiofribr hju EE itqezk. Ccuk uscoopopup u “viynotufacz-mungz” bafckap, cheto hefudakedj suhcomaj wic o fohvarirj xisc ne bowakifus ef vjil ligftfukw ux. Fdoj pnocfinu ref oywq diaxh qu rutfex tubwr lel ulle domotxw oz xahcus-peeyecq ocjsosujeec lefo qvoh ef sese sohufeq, alnexrazde, evs uiroak pe foudliiv udin fuhu.
See forum comments
This content was released on Sep 21 2025. The official support period is 6-months
from this date.
Introduction to the Xcode project used for UI Testing.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous: Introducing the Three-Phase Paradigm
Next: The Record -> Replay -> Review Flow
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.