package Ġio . github . hid ro h . t ld roid Ċ Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroid . content . Content Values Ċ import Ġandroidx . test . platform . app . Instrumentation Registry Ċ import Ġandroidx . test . espress o . Esp ress o . on Data Ċ import Ġandroidx . test . espress o . Esp ress o . on View Ċ import Ġandroidx . test . espress o . action . View Actions .* Ċ import Ġandroidx . test . espress o . assertion . View Assertions . does NotExist Ċ import Ġandroidx . test . espress o . assertion . View Assertions . matches Ċ import Ġandroidx . test . espress o . intent . Intent s . int ended Ċ import Ġandroidx . test . espress o . intent . matcher . Component Name Matchers . has ClassName Ċ import Ġandroidx . test . espress o . intent . matcher . Intent Matchers . has Component Ċ import Ġandroidx . test . espress o . intent . rule . Intent s Test Rule Ċ import Ġandroidx . test . espress o . matcher . Cursor Matchers Ċ import Ġandroidx . test . espress o . matcher . Root Matchers . is Dialog Ċ import Ġandroidx . test . espress o . matcher . Root Matchers . with Decor View Ċ import Ġandroidx . test . espress o . matcher . View Matchers .* Ċ import Ġandroidx . test . espress o . web . assertion . WebView Assertions . web Content Ċ import Ġandroidx . test . espress o . web . matcher . Dom Matchers . containing Text In Body Ċ import Ġandroidx . test . espress o . web . s ugar . Web . on WebView Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġio . github . hid ro h . t ld roid . test . Esp ress o Helper . waitFor At Most Ċ import Ġorg . hamcrest . Matchers .` is ` Ċ import Ġorg . hamcrest . Matchers . not Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠMainActivity Test Ġ{ ĊĠ Ġ@ Rule Ġ@ Jvm Field ĊĠ Ġval Ġintent s Rule Ġ= ĠCustom Test Rule ( MainActivity :: class . java ) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Info () Ġ{ ĊĠĠĠ Ġon View ( is Root ()). perform ( close Soft Keyboard ()) ĊĠĠĠ Ġon View ( with Id ( R . id . info _ button )). perform ( click ()) ĊĠĠĠ Ġon View ( is Root ()) ĊĠĠĠĠĠĠĠ Ġ. in Root ( is Dialog ()) ĊĠĠĠĠĠĠĠ Ġ. perform ( waitFor At Most ( 1 0 0 0 , Ġwith Id ( R . id . web _ view ))) ĊĠĠĠ Ġon WebView ( with Id ( R . id . web _ view )) ĊĠĠĠĠĠĠĠ Ġ. force Javascript Enabled () ĊĠĠĠĠĠĠĠ Ġ. check ( web Content ( containing Text In Body (" License "))) ĊĠĠĠ Ġon View ( is Root ()). perform ( press Back ()) ĊĠĠĠ Ġon View ( with Id ( R . id . web _ view )) ĊĠĠĠĠĠĠĠ Ġ. check ( does NotExist ()) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Browse () Ġ{ ĊĠĠĠ Ġon View ( is Root ()). perform ( close Soft Keyboard ()) ĊĠĠĠ Ġon View ( with Id ( R . id . list _ button )). perform ( click ()) ĊĠĠĠ Ġon Data ( Cursor Matchers . with Row String (" name ", Ġ` is ` (" ls "))) ĊĠĠĠĠĠĠĠ Ġ. in Root ( is Dialog ()) ĊĠĠĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) ĊĠĠĠĠĠĠĠ Ġ. perform ( click ()) ĊĠĠĠ Ġintended ( has Component ( has ClassName ( Command Activity :: class . java . name ))) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Search () Ġ{ ĊĠĠĠ Ġon View ( with Id ( R . id . edit _ text )). perform ( type Text (" l "), Ġclose Soft Keyboard ()) ĊĠĠĠ Ġon View ( with Text (" ls ")) ĊĠĠĠĠĠĠĠ Ġ. in Root ( with Decor View ( not ( int ents Rule . activity . window . decor View ))) ĊĠĠĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) ĊĠĠĠĠĠĠĠ Ġ. perform ( click ()) ĊĠĠĠ Ġintended ( has Component ( has ClassName ( Command Activity :: class . java . name ))) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Empty Search () Ġ{ ĊĠĠĠ Ġon View ( with Id ( R . id . edit _ text )). perform ( type Text (" git "), Ġpress I me ActionButton ()) ĊĠĠĠ Ġintended ( has Component ( has ClassName ( Command Activity :: class . java . name ))) ĊĠ Ġ} ĊĊĠ Ġclass ĠCustom Test Rule < T Ġ: ĠAppCompatActivity >( activity Class : ĠClass < T > ?) Ġ: ĠInt ents Test Rule < T >( activity Class ) Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġbefore Activity La unched () Ġ{ ĊĠĠĠĠĠ Ġsuper . before Activity La unched () ĊĠĠĠĠĠ Ġval Ġcv Ġ= ĠContent Values () ĊĠĠĠĠĠ Ġcv . put ( T ldr Provider . Command Entry . COLUMN _ NAME , Ġ" ls ") ĊĠĠĠĠĠ Ġcv . put ( T ldr Provider . Command Entry . COLUMN _ PLATFORM , Ġ" common ") ĊĠĠĠĠĠ ĠInstrument ation Registry . get Instrumentation (). target Context . content Resolver ĊĠĠĠĠĠĠĠĠĠ Ġ. insert ( T ldr Provider . URI _ COMMAND , Ġcv ); ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġafter Activity Finished () Ġ{ ĊĠĠĠĠĠ Ġsuper . after Activity Finished () ĊĠĠĠĠĠ ĠInstrument ation Registry . get Instrumentation (). target Context . content Resolver ĊĠĠĠĠĠĠĠĠĠ Ġ. delete ( T ldr Provider . URI _ COMMAND , Ġnull , Ġnull ) ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ