package Ġcom . moon pi . swift notes . screens Ċ Ċ import Ġandroid . support . test . espress o . Esp ress o . on View Ċ import Ġandroid . support . test . espress o . action . View Actions Ċ import Ġandroid . support . test . espress o . action . View Actions . click Ċ import Ġandroid . support . test . espress o . assertion . View Assertions Ċ import Ġandroid . support . test . espress o . matcher . View Matchers .* Ċ import Ġandroid . widget . Image Button Ċ import Ġcom . moon pi . swift notes . R Ċ import Ġorg . hamcrest . Core Matchers . all Of Ċ import Ġorg . hamcrest . Core Matchers . instance Of Ċ import Ġru . t ink off . all ure . android . device Screenshot Ċ Ċ class ĠEdit Note Screen ( ĊĠĠĠ Ġprivate Ġval Ġnote Title : ĠInt Ġ= ĠR . id . title Edit , ĊĠĠĠ Ġprivate Ġval Ġnote Body : ĠInt Ġ= ĠR . id . body Edit Ċ ) Ġ: ĠBase Screen ( note Title , Ġnote Body ) Ġ{ ĊĊĠĠĠ Ġfun Ġgo Back (): ĠSave Dialog Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġup Button Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġon View ( all Of ( instance Of ( Image Button :: class . java ), Ġwith Parent ( with Id ( R . id . toolbar Edit )))) ĊĠĠĠĠĠĠĠ Ġup Button . perform ( click ()) ĊĠĠĠĠĠĠĠ Ġreturn ĠScreen Utils . waitFor Screen ( Save Dialog ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġassert Hints () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġall Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwith Id ( note Title ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġis Displayed () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ). check ( View Assertions . matches ( with Hint (" Title "))) ĊĠĠĠĠĠĠĠ Ġon View ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġall Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwith Id ( note Body ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġis Displayed () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ). check ( View Assertions . matches ( with Hint (" Note "))) ĊĠĠĠĠĠĠĠ Ġdevice Screenshot (" page _ display ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġenter Title ( title : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( note Title )). perform ( View Actions . type Text ( title )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġassert Title ( title : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( note Title )). check ( View Assertions . matches ( with Text ( title ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġenter Body ( body : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( note Body )). perform ( View Actions . type Text ( body )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġassert Body ( body : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( note Body )). check ( View Assertions . matches ( with Text ( body ))) ĊĠĠĠ Ġ} Ċ }