package Ġcom . br aff dev . st eg an of y . ui . internal Ċ Ċ import Ġandroid . Manifest Ċ import Ġandroidx . test . ext . junit . rules . Activity Scenario Rule Ċ import Ġandroidx . test . platform . app . Instrumentation Registry Ċ import Ġandroidx . test . rule . Grant Permission Rule Ċ import Ġandroidx . test . uia utom ator . Ui Device Ċ import Ġcom . br aff dev . st eg an of y . ui . main . MainActivity Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ Ċ abstract Ġclass ĠFlow Test Ġ{ ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġvar Ġactivity Rule Ġ= ĠActivity Scenario Rule ( MainActivity :: class . java ) ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġvar Ġpermission Rule Ġ= ĠGrant Permission Rule . grant ( Manifest . permission . READ _ EXTERNAL _ STORAGE , ĠManifest . permission . WRITE _ EXTERNAL _ STORAGE ) ĊĊĠĠĠ Ġlateinit Ġvar Ġdevice : ĠUi Device ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġdevice Ġ= ĠUi Device . getInstance ( Instrumentation Registry . get Instrumentation ()) ĊĠĠĠ Ġ} Ċ }