0Pricing
Jetpack Compose Academy · Ders

Doğrulamalar ve Eylem Gerçekleştirme

Durumu doğrulayın ve kullanıcı girdisini benzetin.

Doğrulamalar ve Eylem Gerçekleştirme, CoddyKit'te ücretsiz bir Jetpack Compose Academy dersidir. Bu, 4 dersinin 2. 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, Jetpack Compose Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Jetpack Compose Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Find, Then Verify

Finding a node is only half the job. To prove your UI behaves, you add an assertion that states what should be true about that node. ✅

assertIsDisplayed

The most common assertion is assertIsDisplayed. It confirms the node is actually visible to the user, not just present in the tree.

composeTestRule.onNodeWithText("Welcome")
    .assertIsDisplayed()

assertExists vs assertIsDisplayed

Watch the difference: assertExists checks the node is in the tree, while assertIsDisplayed also checks it is on screen and not clipped away.

composeTestRule.onNodeWithText("Footer")
    .assertExists()

Chaining Assertions

You can chain several checks on one node. Each returns the node again, so the test reads like a clear sentence about your UI state.

rule.onNodeWithText("Save")
    .assertIsDisplayed()
    .assertIsEnabled()

Performing a Click

To simulate a tap, call performClick on a found node. Compose dispatches the same click your real users would trigger.

composeTestRule.onNodeWithText("Add")
    .performClick()

Typing Text

For input fields, performTextInput types characters into the focused field, letting you test forms exactly as a user would fill them.

rule.onNodeWithText("Email")
    .performTextInput("a@b.com")

Act, Then Assert

The classic flow is act then assert: perform a click, then verify the new state appeared. This mirrors how a person uses your app.

rule.onNodeWithText("+").performClick()
rule.onNodeWithText("Count: 1")
    .assertIsDisplayed()

Asserting on State Flags

Beyond visibility, you can check toggles. assertIsOn and assertIsOff verify switches and checkboxes hold the value you expect.

rule.onNodeWithText("Notifications")
    .assertIsOff()

Quick Check

You want to confirm a button is genuinely on screen, not merely present in the tree. Which assertion do you use?

Assert on Count

When you grab a group with onAllNodes, verify how many matched using assertCountEquals. It is perfect for checking list sizes.

rule.onAllNodesWithText("Item")
    .assertCountEquals(3)

Clear Before You Type

Replacing text? Call performTextClearance first, then performTextInput, so old characters do not stick around and break your check.

rule.onNodeWithText("Name")
    .performTextClearance()

Readable, Trustworthy Tests

Good assertions describe behavior, not pixels. Aim for tests that read like requirements, so a failure instantly tells you what behavior broke.

Recap: Actions & Assertions

You drive the UI with actions like performClick and performTextInput, then prove the result with assertions like assertIsDisplayed. That is the heart of UI testing. 🎯

Sıkça Sorulan Sorular

“Doğrulamalar ve Eylem Gerçekleştirme” dersi ücretsiz mi?

Evet — “Doğrulamalar ve Eylem Gerçekleştirme” 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 Jetpack Compose Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Jetpack Compose Academy kursu toplamda 4 dersten oluşur.

“Doğrulamalar ve Eylem Gerçekleştirme” dersinde ne öğreneceğim?

Durumu doğrulayın ve kullanıcı girdisini benzetin. Jetpack Compose 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.

Jetpack Compose Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Jetpack Compose 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 2. dersidir.

“Doğrulamalar ve Eylem Gerçekleştirme” 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 Jetpack Compose Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Jetpack Compose 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

  1. createComposeRule ve Bulucular
  2. Doğrulamalar ve Eylem Gerçekleştirme
  3. Anlambilim ve Test Etiketleri
  4. ViewModels ve Flow'ları Test Etme
← Jetpack Compose Academy Sayfasına Dön