package Ġcom . f az em er ight . my inventory tracker . ui . item list Ċ Ċ 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 . matches Ċ import Ġandroidx . test . espress o . intent . Intent s . int ended Ċ import Ġandroidx . test . espress o . intent . matcher . Intent Matchers . has Component Ċ import Ġandroidx . test . espress o . matcher . View Matchers .* Ċ import Ġcom . f az em er ight . my inventory tracker . R Ċ import Ġcom . f az em er ight . my inventory tracker . is View Displayed Ċ import Ġcom . f az em er ight . my inventory tracker . is View With Text Displayed Ċ import Ġcom . f az em er ight . my inventory tracker . ui . add bag . Add Bag Activity Ċ import Ġcom . f az em er ight . my inventory tracker . ui . add item . AddItem Activity Ċ import Ġcom . f az em er ight . my inventory tracker . ui . base . Base Ui Test Ċ import Ġorg . junit . Test Ċ Ċ class ĠItem List Activity Test Ġ: ĠBase Ui Test < ItemList Activity >() Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠgetActivity (): ĠClass < ItemList Activity > Ġ= ĠItem List Activity :: class . java ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġoverride Ġfun Ġall Views Are Displayed () Ġ{ ĊĠĠĠĠĠĠĠ ĠR . id . fab AddItem . is View Displayed () ĊĠĠĠĠĠĠĠ ĠR . id . item _ list . is View Displayed () ĊĠĠĠĠĠĠĠ ĠR . id . action _ search . is View Displayed () ĊĊĠĠĠĠĠĠĠ ĠR . string . app _ name . is View With Text Displayed () ĊĊĠĠĠĠĠĠĠ Ġon View ( with Content Description (" More Ġoptions ")). check ( matches ( is Displayed ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( click ()) ĊĊĠĠĠĠĠĠĠ ĠR . string . add _ bag . is View With Text Displayed () ĊĠĠĠĠĠĠĠ ĠR . string . settings . is View With Text Displayed () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun ĠonClick Fab () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . fab AddItem )). check ( matches ( is Displayed ())). perform ( click ()) ĊĊĠĠĠĠĠĠĠ Ġintended ( has Component ( AddItem Activity :: class . java . name )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun ĠonClick Add Bag () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Content Description (" More Ġoptions ")). check ( matches ( is Displayed ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . add _ bag )). check ( matches ( is Displayed ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( click ()) ĊĠĠĠĠĠĠĠ Ġintended ( has Component ( Add Bag Activity :: class . java . name )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġon AddItem Successfully () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . fab AddItem )). check ( matches ( is Displayed ())). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġintended ( has Component ( AddItem Activity :: class . java . name )) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . ed t ItemName )). check ( matches ( is Displayed ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( type Text (" Test ĠItem "), Ġclose Soft Keyboard ()) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . action _ add _ item )). check ( matches ( is Displayed ())). perform ( click ()) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . fab AddItem )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} Ċ }