package Ġcom . ch ido zie . n . aad practice project . ui . splash Ċ Ċ import Ġandroidx . core . app . Activity Compat Ċ import Ġandroidx . core . view . isVisible Ċ import Ġandroidx . test . espress o . View Assertion Ċ import Ġandroidx . test . espress o . intent . Intent s Ċ import Ġandroidx . test . espress o . intent . matcher . Intent Matchers Ċ import Ġandroidx . test . ext . junit . rules . Activity Scenario Rule Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġcom . ag oda . k ak ao . screen . Screen Ċ import Ġcom . ag oda . k ak ao . screen . Screen . Companion . on Screen Ċ import Ġcom . ch ido zie . n . aad practice project . ui . leader board . activity . Leader board Activity Ċ import Ġcom . ch ido zie . n . aad practice project . ui . util . Default Test Ċ import Ġcom . ch ido zie . n . aad practice project . ui . util . My View Action Ċ import Ġcom . google . common . truth . Truth Ċ import Ġorg . junit . After Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠSpl ash Activity Test Ġ: ĠDefault Test () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġactivity : ĠSpl ash Activity ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġval Ġactivity Rule Ġ= ĠActivity Scenario Rule ( Splash Activity :: class . java ) ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġbefore () Ġ{ ĊĠĠĠĠĠĠĠ Ġactivity Rule . scenario . on Activity Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġactivity Ġ= Ġit ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ ĠInt ents . init () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ After ĊĠĠĠ Ġfun Ġafter () Ġ{ ĊĠĠĠĠĠĠĠ ĠInt ents . release () ĊĠĠĠĠĠĠĠ ĠActivity Compat . finish Affinity ( activity ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġdisplays _ splash _ screen () Ġ{ ĊĠĠĠĠĠĠĠ Ġon Screen < K Screen > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġview . check ( View Assertion Ġ{ Ġview , Ġ_ Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTr uth . assertThat ( view . isVisible ). isTrue () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġla unches _ leader board _ after _ some _ time () Ġ{ ĊĠĠĠĠĠĠĠ Ġon Screen < K Screen > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġview . perform ( My View Action . waitFor ( 2 _ 0 0 0 )) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠInt ents . int ended ( Intent Matchers . has Component ( Leader board Activity :: class . java . name )) ĊĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġclass ĠK Screen Ġ: ĠScreen < K Screen >() Ċ Ċ } Ċ