0Pricing
Jetpack Compose Academy · Ders

Anlambilim ve Test Etiketleri

Kullanıcı arayüzünü test edilebilir ve erişilebilir hâle getirin.

Anlambilim ve Test Etiketleri, CoddyKit'te ücretsiz bir Jetpack Compose 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, 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.

The Semantics Tree

Compose builds a semantics tree next to the visual one. It describes what each element means, and it is exactly what both tests and screen readers read.

Why Semantics Matter

If a node carries no meaning in the tree, finders cannot reach it and TalkBack cannot announce it. Good semantics make your app both testable and accessible. ♿

Content Descriptions Add Meaning

Icons and images carry no text, so give them a contentDescription. It feeds the semantics tree, letting tests find them and screen readers describe them.

Icon(Icons.Default.Add,
    contentDescription = "Add item")

When Text Is Not Unique

Sometimes many nodes share the same text and a text finder gets confused. You need a stable handle that does not depend on the visible label.

Introducing testTag

A testTag is an invisible identifier you attach with a Modifier. It gives a node a unique name for tests without affecting how it looks.

Box(Modifier.testTag("avatar"))

Finding by Tag

Once tagged, locate the node with onNodeWithTag. This is rock-solid even when text changes across languages or states.

composeTestRule.onNodeWithTag("avatar")
    .assertIsDisplayed()

Quick Check

Several buttons share the label Done, so a text finder is ambiguous. What gives one button a unique, invisible handle for tests?

Tags vs Descriptions

Keep them separate: contentDescription serves real users, while testTag exists only for tests. Do not overload one to do the other's job.

The semantics Modifier

For full control, the semantics modifier lets you set custom properties, like marking a node as a heading for accessibility tools.

Modifier.semantics { heading() }

Merging Descendants

Compose can merge a parent and its children into one node with mergeDescendants. That makes a whole row announce as a single, friendly unit.

Modifier.semantics(mergeDescendants = true) {}

Print the Tree to Debug

Stuck on a missing node? Call printToLog on the root to dump the full semantics tree, then read exactly what is available to match.

rule.onRoot().printToLog("TREE")

Design for Testability

Adding clear descriptions and tags as you build means your tests almost write themselves. Accessible apps and testable apps grow from the same habits.

Recap: Semantics & Tags

The semantics tree powers both testing and accessibility. Use contentDescription for users and testTag for tests to keep your UI easy to verify. 🌳

Sıkça Sorulan Sorular

“Anlambilim ve Test Etiketleri” dersi ücretsiz mi?

Evet — “Anlambilim ve Test Etiketleri” 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.

“Anlambilim ve Test Etiketleri” dersinde ne öğreneceğim?

Kullanıcı arayüzünü test edilebilir ve erişilebilir hâle getirin. 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 3. dersidir.

“Anlambilim ve Test Etiketleri” 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