XCUITest ile Kullanıcı Arayüzü Testleri
Ekranlardaki dokunuşları ve doğrulamaları otomatikleştirin.
XCUITest ile Kullanıcı Arayüzü Testleri, CoddyKit'te ücretsiz bir SwiftUI Academy dersidir. Bu, 4 dersinin 3. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, SwiftUI Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. SwiftUI Academy kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
What UI Tests Do
UI tests drive your app like a real person: they tap, type, and swipe, then check the screen reacted correctly. 📱
A Separate Test Target
UI tests live in their own UI Testing target. Xcode adds it when you create the project or from the test navigator later.
Launching the App
Every UI test starts by launching a fresh app instance with XCUIApplication. This gives you a clean state to work from.
let app = XCUIApplication()
app.launch()Finding Elements
You reach controls through queries like buttons, staticTexts, and textFields. Each query finds elements by their kind on screen.
app.buttons["Add"]Tapping a Button
Call tap on an element to simulate a finger press. The app responds exactly as it would for a real user.
app.buttons["Add"].tap()Typing Text
Tap a field first, then send keystrokes with typeText. This is how you fill in forms during a test.
app.textFields["name"].typeText("Sam")Accessibility Identifiers
Give views a stable accessibilityIdentifier so tests find them even when the visible label changes or is localized.
.accessibilityIdentifier("addButton")Asserting What Appears
Check the result with exists. It returns true when the element is on screen, confirming your action worked.
XCTAssertTrue(app.staticTexts["Done"].exists)Waiting for Elements
If content loads after a delay, use waitForExistence with a timeout. The test pauses until the element shows up. ⏳
label.waitForExistence(timeout: 3)Record to Learn
New to queries? Use Xcode's record button. It writes code as you tap, giving you a starting point to clean up.
Keep UI Tests Few
UI tests are slower than unit tests. Cover key flows like sign-in and checkout, and leave the rest to faster unit tests.
Quick Check
What is the most reliable way for a UI test to find a control?
Recap
You drove the app with XCUITest: launch it, query controls, tap and type, then assert with exists. Real user flows, automated. 🎉
Sıkça Sorulan Sorular
“XCUITest ile Kullanıcı Arayüzü Testleri” dersi ücretsiz mi?
Evet — “XCUITest ile Kullanıcı Arayüzü Testleri” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve SwiftUI Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. SwiftUI Academy kursu toplamda 4 dersten oluşur.
“XCUITest ile Kullanıcı Arayüzü Testleri” dersinde ne öğreneceğim?
Ekranlardaki dokunuşları ve doğrulamaları otomatikleştirin. SwiftUI Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
SwiftUI Academy öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te SwiftUI Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 3. dersidir.
“XCUITest ile Kullanıcı Arayüzü Testleri” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu SwiftUI Academy dersinde kod yazıp çalıştırabilir miyim?
Evet. Her SwiftUI Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- ViewModels Birim Testleri
- Asenkron Kodu Test Etme
- XCUITest ile Kullanıcı Arayüzü Testleri
- Anlık Görüntü ve Önizleme Odaklı Test