package Ġcom . avi 5 he k . sur veys . presentation . feature . main Ċ Ċ import Ġandroidx . test . core . app . Activity Scenario Ċ import Ġandroidx . test . espress o . Esp ress o . on View Ċ import Ġandroidx . test . espress o . action . View Actions . click Ċ import Ġandroidx . test . espress o . assertion . View Assertions . matches Ċ 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 Ġcom . avi 5 he k . sur veys . R Ċ import Ġcom . avi 5 he k . sur veys . presentation . utils . Loading Dialog Instruction Ċ import Ġcom . az im ol abs . condition watcher . Condition Watcher Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ /** Ċ Ġ* ĠCreated Ġby Ġ" A vis he k " Ġon Ġ 8 / 7 / 2 0 2 0 . Ċ Ġ*/ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠMainActivity Test Ġ{ ĊĊĠ Ġ@ get : Rule ĊĠ Ġval Ġactivity Rule Ġ= ĠActivity Test Rule ( MainActivity :: class . java ) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġapp L unches Successfully () Ġ{ ĊĠĠĠ ĠActivity Scenario . launch ( MainActivity :: class . java ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġwhen App Is La unched _ Check Loading Dialog Displayed () Ġ{ ĊĠĠĠ Ġon View ( with Id ( R . id . progress _ bar )) ĊĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġwhen Loading Is Finished _ Check Survey List Fragment Is Displayed () Ġ{ ĊĠĠĠ ĠCondition Watcher . setTimeout Limit ( 3 0 0 0 0 ) ĊĠĠĠ ĠCondition Watcher . waitFor Condition ( Loading Dialog Instruction ( activity Rule . activity )) ĊĊĠĠĠ Ġon View ( with Id ( R . id . pager )) ĊĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) ĊĠĠĠ Ġon View ( with Id ( R . id . button _ take _ survey )) ĊĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) ĊĠĠĠ Ġon View ( with Id ( R . id . text _ toolbar _ title )) ĊĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) ĊĠĠĠ Ġon View ( with Id ( R . id . image _ refresh )) ĊĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġwhen Take Survey Button Is Clicked _ Navigate To Survey Details () Ġ{ ĊĠĠĠ ĠCondition Watcher . setTimeout Limit ( 3 0 0 0 0 ) ĊĠĠĠ ĠCondition Watcher . waitFor Condition ( Loading Dialog Instruction ( activity Rule . activity )) ĊĊĠĠĠ Ġon View ( with Id ( R . id . button _ take _ survey )) ĊĠĠĠĠĠ Ġ. perform ( click ()) ĊĊĠĠĠ Ġon View ( with Id ( R . id . text _ message )) ĊĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) ĊĠ Ġ} Ċ Ċ } Ċ