package Ġcom . tz ion . jet pack movies . ui Ċ Ċ 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 . matcher . View Matchers . is Displayed Ċ import Ġandroidx . test . espress o . matcher . View Matchers . with Id Ċ import Ġandroidx . test . espress o . matcher . View Matchers . with Text Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġandroidx . test . rule . Activity Test Rule Ċ import Ġcom . tz ion . jet pack movies . R Ċ import Ġorg . hamcrest . Matchers . all Of Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠMainActivity Test Ġ{ ĊĊĠĠĠ Ġ@ get : Rule Ġval Ġactivity Rule Ġ= ĠActivity Test Rule ( MainActivity :: class . java ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġdefault Find AM ov ie Text ShouldBe Displayed () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( all Of ( with Id ( R . id . tv _ instructions ), Ġwith Text (" Find Ġa Ġmovie "))) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġdefault Find AM ov ie Image ShouldBe Displayed () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . ac iv _ search _ display _ movies )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġverify Drawer Navigation Open () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . drawer _ layout )). perform ( Drawer Actions . open ()) ĊĠĠĠĠĠĠĠ ĠThread . sleep ( 2 0 0 0 ) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . find Movies ByName Fragment )). check ( matches ( is Displayed ())) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . favorite Movies Fragment )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} Ċ } Ċ