package Ġkotlinx . kotlin ui čĊč Ċ import Ġandroidx . test . core . app . Activity Scenario č Ċ import Ġandroidx . test . core . app . Application Provider č Ċ import Ġandroidx . test . espress o . Esp ress o . on View č Ċ import Ġandroidx . test . espress o . action . View Actions .* č Ċ import Ġandroidx . test . espress o . matcher . View Matchers .* č Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 č Ċ import Ġorg . junit . Test č Ċ import Ġorg . junit . runner . RunWith čĊč Ċ @ RunWith ( Android JUnit 4 :: class ) č Ċ class ĠText App Test Ġ{ čĊĠĠĠ Ġlateinit Ġvar Ġactivity Rule : ĠActivity Scenario < Test Activity > čĊčĊĠĠĠ Ġ@ Test čĊĠĠĠ Ġfun Ġsample () Ġ{ čĊĠĠĠĠĠĠĠ ĠTest Activity . view Ġ= ĠText (" Target ĠText ") čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build View ( Application Provider . getApplicationContext ()) čĊĠĠĠĠĠĠĠ Ġactivity Rule Ġ= ĠActivity Scenario . launch ( Test Activity :: class . java ) čĊĠĠĠĠĠĠĠ Ġon View ( with Text (" Target ĠText ")) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( click ()) čĊĠĠĠ Ġ} č Ċ }