package Ġcom . jon athan l . bg manager Ċ Ċ import Ġandroid . view . Gravity Ċ import Ġandroidx . test . espress o . Esp ress o . on View Ċ import Ġandroidx . test . espress o . assertion . View Assertions . matches Ċ import Ġandroidx . test . espress o . contrib . Drawer Actions Ċ import Ġandroidx . test . espress o . contrib . Drawer Matchers . is Closed Ċ import Ġandroidx . test . espress o . contrib . Navigation View Actions Ċ import Ġandroidx . test . espress o . matcher . View Matchers . is Displayed Ċ import Ġandroidx . test . espress o . matcher . View Matchers . with Id Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġandroidx . test . rule . Activity Test Rule Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠMain Menu Navigation Test Ġ{ ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġval Ġactivity Rule Ġ= ĠActivity Test Rule ( MainActivity :: class . java ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġopen And Close Navigation Drawer While In Main Page () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . drawer _ layout )). perform ( Drawer Actions . open ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . drawer _ layout )). perform ( Drawer Actions . close ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġnavigate To Game List Screen () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . drawer _ layout )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( is Closed ( Gravity . LEFT ))) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( Drawer Actions . open ()) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . nav _ view )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( Navigation View Actions . navigate To ( R . id . nav _ game _ list )) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . game List Text )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġnavigate Multiple Times Ending At Search Screen () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . drawer _ layout )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( is Closed ( Gravity . LEFT ))) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( Drawer Actions . open ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . nav _ view )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( Navigation View Actions . navigate To ( R . id . nav _ settings )) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . drawer _ layout )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( is Closed ( Gravity . LEFT ))) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( Drawer Actions . open ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . nav _ view )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( Navigation View Actions . navigate To ( R . id . nav _ share )) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . drawer _ layout )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( is Closed ( Gravity . LEFT ))) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( Drawer Actions . open ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . nav _ view )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( Navigation View Actions . navigate To ( R . id . nav _ search )) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . re cyclerView Search )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} Ċ Ċ }