package Ġcom . bad oo . ri bs . samples . android . launch ing _ activities . rib Ċ Ċ import Ġandroid . content . Component Name Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . test . espress o . Esp ress o . on View Ċ import Ġandroidx . test . espress o . action . View Actions . click Ċ import Ġandroidx . test . espress o . intent . Intent s . init Ċ import Ġandroidx . test . espress o . intent . Intent s . int ended Ċ import Ġandroidx . test . espress o . intent . matcher . Intent Matchers . has Component Ċ import Ġandroidx . test . espress o . matcher . View Matchers Ċ import Ġandroidx . test . platform . app . Instrumentation Registry Ċ import Ġcom . bad oo . ri bs . R ib Test Activity Ċ import Ġcom . bad oo . ri bs . android . activity starter . Activity Starter Ċ import Ġcom . bad oo . ri bs . core . modal ity . BuildContext Ċ import Ġcom . bad oo . ri bs . samples . android . launch ing _ activities . R Ċ import Ġcom . bad oo . ri bs . samples . android . launch ing _ activities . app . Other Activity Ċ import Ġcom . bad oo . ri bs . samples . android . launch ing _ activities . rib . child 1 . Launch ing Activities Child 1 Builder Ċ import Ġcom . bad oo . ri bs . samples . android . launch ing _ activities . rib . child _ common . Launch ing Activities Child Base Ċ import Ġcom . bad oo . ri bs . test . R ib s Rule Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ Ċ class ĠLaunch ing Activities Parent Test Ġ{ ĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġval Ġri bs Rule Ġ= ĠR ib s Rule Ġ{ Ġactivity , ĠsavedInstanceState Ġ-> ĊĠĠĠĠĠĠĠ Ġbuild R ib ( activity , ĠsavedInstanceState ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġinit () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġbuild R ib ( rib Test Activity : ĠR ib Test Activity , ĠsavedInstanceState : ĠBundle ?) Ġ= ĊĠĠĠĠĠĠĠ ĠLaunch ing Activities Child 1 Builder ( object Ġ: ĠLaunch ing Activities Child Base . Dependency Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġval Ġactivity Starter : ĠActivity Starter Ġ= Ġ rib Test Activity . integration Point . activity Starter ĊĠĠĠĠĠĠĠ Ġ}). build ( BuildContext . root ( savedInstanceState )) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Launch Activity Button Is Pressed Then Other Activity Is Started () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( View Matchers . with Id ( R . id . launch Activity Button )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġintended ( has Component ( Component Name ( Instrumentation Registry . get Instrumentation (). context , ĠOther Activity :: class . java ))) ĊĠĠĠ Ġ} Ċ } Ċ