package Ġcom . gmail . uia 0 5 9 4 6 6 . autom ator uis ample . screenshots . screen Ċ Ċ import Ġandroidx . annotation . String Res Ċ import Ġandroidx . test . espress o . Esp ress o Ċ 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 . matcher . View Matchers Ċ import Ġandroidx . test . espress o . matcher . View Matchers . with Id Ċ import Ġandroidx . test . uia utom ator . By Ċ import Ġandroidx . test . uia utom ator . Search Condition Ċ import Ġandroidx . test . uia utom ator . Ui Device Ċ import Ġandroidx . test . uia utom ator . Ui Object 2 Ċ import Ġandroidx . test . uia utom ator . Until Ċ import Ġcom . gmail . uia 0 5 9 4 6 6 . autom ator uis ample . R Ċ import Ġcom . gmail . uia 0 5 9 4 6 6 . autom ator uis ample . screenshots . Base Screen Ċ import Ġcom . gmail . uia 0 5 9 4 6 6 . autom ator uis ample . screenshots . has TextInput Layout Hint Text Ċ Ċ class ĠSign In Screen ( on : ĠUi Device ) Ġ: ĠBase Screen ( on ) Ġ{ ĊĠĠĠĠĊĠĠĠ Ġoverride Ġval Ġcontent Layout : ĠInt = R . id . email _ sign _ in _ layout ĊĠĠĠĠĊĠĠĠ Ġprivate Ġval Ġenter Button = R . id . button _ enter ĊĠĠĠ Ġprivate Ġval Ġemail Et = R . id . email ĊĠĠĠ Ġprivate Ġval Ġemail Tl = R . id . email _ layout ĊĠĠĠ Ġprivate Ġval Ġpassword Tl = R . id . password _ layout ĊĠĠĠ Ġprivate Ġval Ġpassword Et = R . id . password ĊĠĠĠ Ġprivate Ġval Ġreset Password Tv = R . id . password _ reset _ tv ĊĠĠĠ Ġprivate Ġval Ġsign In Tv = R . id . create _ account _ tv ĊĠĠĠĠĊĠĠĠ Ġfun Ġinput Email ( email : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( email Et )). perform ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠView Actions . replace Text ( email ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠView Actions . close Soft Keyboard () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġfun Ġenter (): ĠAccount Screen Ġ{ ĊĠĠĠĠĠĠĠ ĠE sp ress o . on View ( View Matchers . with Id ( enter Button )). perform ( View Actions . click ()) ĊĠĠĠĠĠĠĠ Ġval Ġnew = Account Screen ( device ) ĊĠĠĠĠĠĠĠ Ġnew . waitFor Screen ToBe Displayed () ĊĠĠĠĠĠĠĠ Ġreturn Ġnew ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġfun Ġinput Password ( password : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( password Et )). perform ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠView Actions . replace Text ( password ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠView Actions . close Soft Keyboard ()) ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġfun Ġlogin As ( email : ĠString , Ġpassword : ĠString ): ĠAccount Screen Ġ{ ĊĠĠĠĠĠĠĠ Ġinput Email ( email ) ĊĠĠĠĠĠĠĠ Ġinput Password ( password ) ĊĠĠĠĠĠĠĠ Ġreturn Ġenter () ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġfun Ġnavigate To Reset Password (): ĠReset Password Screen Ġ{ ĊĠĠĠĠĠĠĠ ĠE sp ress o . on View ( View Matchers . with Id ( reset Password Tv )). perform ( View Actions . click ()) ĊĠĠĠĠĠĠĠ Ġval Ġnew = Reset Password Screen ( device ) ĊĠĠĠĠĠĠĠ Ġnew . waitFor Screen ToBe Displayed () ĊĠĠĠĠĠĠĠ Ġreturn Ġnew ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġfun Ġnavigate To SignUp (): ĠSign Up Screen Ġ{ ĊĠĠĠĠĠĠĠ ĠE sp ress o . on View ( View Matchers . with Id ( signIn Tv )). perform ( View Actions . click ()) ĊĠĠĠĠĠĠĠ Ġval Ġnew = SignUp Screen ( device ) ĊĠĠĠĠĠĠĠ Ġnew . waitFor Screen ToBe Displayed () ĊĠĠĠĠĠĠĠ Ġreturn Ġnew ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Hint Email (@ String Res Ġerror : Ġ ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( email Tl )). check ( ĊĠĠĠĠĠĠĠ Ġmatches ( has TextInput Layout Hint Text ( string ( error )))) ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġfun Ġcheck Hint Password (@ String Res Ġerror : Ġ ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( password Tl )). check ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmatches ( has TextInput Layout Hint Text ( string ( error )))) ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġfun Ġcheck Sn ackBar (@ String Res Ġerror : Ġ ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( com . google . android . material . R . id . sn ackbar _ text )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( View Matchers . with Text ( error ))) ĊĠĠĠ Ġ} ĊĠĠĠ Ġoverride Ġfun Ġcheck Default Layout () Ġ{ ĊĠĠĠĠĠĠĠ Ġcheck View Displayed ( content Layout ) ĊĠĠĠĠĠĠĠ Ġcheck View Displayed ( enter Button ) ĊĠĠĠĠĠĠĠ Ġcheck View Displayed ( email Et ) ĊĠĠĠĠĠĠĠ Ġcheck View Displayed ( password Et ) ĊĠĠĠĠĠĠĠ Ġcheck View Displayed ( reset Password Tv ) ĊĠĠĠĠĠĠĠ Ġcheck View Displayed ( signIn Tv ) ĊĠĠĠ Ġ} Ċ } Ċ