package Ġcom . so od k art ik . mv pp attern . modules . login Ċ Ċ import Ġandroidx . test . espress o . Esp ress o . on View Ċ import Ġandroidx . test . espress o . action . View Actions .* Ċ 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 . so od k art ik . mv pp attern . R Ċ import Ġcom . so od k art ik . mv pp attern . modules . login . activity . Login Activity Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith ĊĊ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠLogin UIT est Ġ{ ĊĊĠĠĠ Ġprivate Ġval ĠUSER NAME _ TYPE D Ġ= Ġ" K art ik so od " ĊĊĠĠĠ Ġprivate Ġval ĠUSER NAME _ PASSWORD Ġ= Ġ" 1 2 3 4 5 6 " ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġvar Ġm Login Activity Rule : ĠActivity Test Rule < Login Activity > Ġ= ĊĠĠĠĠĠĠĠ ĠActivity Test Rule ( Login Activity :: class . java ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġlogin Clicked Success () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . username _ ed )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( type Text ( USERNAME _ TYPE D )) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . password _ ed )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( type Text ( USERNAME _ PASSWORD )) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . submit _ button )). perform ( close Soft Keyboard ()). perform ( click ()) ĊĠĠĠ Ġ} Ċ }