package Ġm ba as . com . n if cloud . android segment user app Ċ Ċ import Ġandroidx . test . espress o . Esp ress o . on View Ċ import Ġandroidx . test . espress o . View Interaction Ċ 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 . ext . junit . rules . Activity Scenario Rule Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġandroidx . test . filters . Large Test Ċ import Ġm ba as . com . n if cloud . android segment user app . Utils . waitFor Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ @ Large Test Ċ class ĠSegment User UIT est Ġ{ ĊĠĠĠ Ġvar Ġiv Logo : ĠView Interaction ? Ġ= Ġnull ĊĠĠĠ Ġvar Ġed t Name : ĠView Interaction ? Ġ= Ġnull ĊĠĠĠ Ġvar Ġed t Pass : ĠView Interaction ? Ġ= Ġnull ĊĠĠĠ Ġvar Ġbtn Login : ĠView Interaction ? Ġ= Ġnull ĊĠĠĠ Ġvar Ġed t New Key : ĠView Interaction ? Ġ= Ġnull ĊĠĠĠ Ġvar Ġed t NewValue : ĠView Interaction ? Ġ= Ġnull ĊĠĠĠ Ġvar Ġbtn Update : ĠView Interaction ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġval Ġactivity Rule Ġ= ĠActivity Scenario Rule ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠMainActivity :: class . java ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠĠĠĠĠ Ġiv Logo Ġ= Ġon View ( with Id ( R . id . iv _ logo )) ĊĠĠĠĠĠĠĠ Ġed t Name Ġ= Ġon View ( with Id ( R . id . input _ name )) ĊĠĠĠĠĠĠĠ Ġed t Pass Ġ= Ġon View ( with Id ( R . id . input _ password )) ĊĠĠĠĠĠĠĠ Ġbtn Login Ġ= Ġon View ( with Id ( R . id . btn _ login )) ĊĠĠĠĠĠĠĠ Ġed t New Key Ġ= Ġon View ( with Id ( R . id . txt New Key )) ĊĠĠĠĠĠĠĠ Ġed t NewValue Ġ= Ġon View ( with Id ( R . id . txt NewValue )) ĊĠĠĠĠĠĠĠ Ġbtn Update Ġ= Ġon View ( with Id ( R . id . btn Update )) ĊĊĠĠĠĠĠĠĠ Ġed t Name !!. perform ( type Text (" AN TH OD ")) ĊĠĠĠĠĠĠĠ Ġed t Pass !!. perform ( type Text (" 1 2 3 4 5 6 "), Ġclose Soft Keyboard ()) ĊĠĠĠĠĠĠĠ Ġbtn Login !!. perform ( scrollTo ()). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( is Root ()). perform ( waitFor ( 5 0 0 0 )) ĊĠĠĠĠĠĠĠ Ġon View ( with Text (" ãĥŃãĤ° ãĤ¤ãĥ³ ãģ« æĪĲåĬŁ ãģĹãģ¾ãģĹãģŁ ãĢĤ ")). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġvalidate _ empty _ key () Ġ{ ĊĠĠĠĠĠĠĠ Ġed t New Key !!. perform ( type Text (""), Ġclose Soft Keyboard ()) ĊĠĠĠĠĠĠĠ Ġed t NewValue !!. perform ( type Text (" values "), Ġclose Soft Keyboard ()) ĊĠĠĠĠĠĠĠ Ġbtn Update !!. check ( matches ( is Displayed ())). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( is Root ()). perform ( waitFor ( 5 0 0 0 )) ĊĠĠĠĠĠĠĠ Ġon View ( with Text (" æĸ° è¦ı key åĢ¤ ãĤĴ åħ¥åĬĽ ãģıãģłãģķãģĦ ! ")). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġvalidate _ special _ key () Ġ{ ĊĠĠĠĠĠĠĠ Ġed t New Key !!. perform ( type Text (" key Ġkey "), Ġclose Soft Keyboard ()) ĊĠĠĠĠĠĠĠ Ġed t NewValue !!. perform ( type Text (" values "), Ġclose Soft Keyboard ()) ĊĠĠĠĠĠĠĠ Ġbtn Update !!. check ( matches ( is Displayed ())). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( is Root ()). perform ( waitFor ( 5 0 0 0 )) ĊĠĠĠĠĠĠĠ Ġon View ( with Text (" key åĢ¤ ãģ¯ åįĬ è§Ĵ èĭ± æķ°åŃĹ ãģ® ãģ¿ ãģ§ãģĻ ! ")). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġvalidate _ same _ default _ key () Ġ{ ĊĠĠĠĠĠĠĠ Ġed t New Key !!. perform ( type Text (" acl "), Ġclose Soft Keyboard ()) ĊĠĠĠĠĠĠĠ Ġed t NewValue !!. perform ( type Text (" values "), Ġclose Soft Keyboard ()) ĊĠĠĠĠĠĠĠ Ġbtn Update !!. check ( matches ( is Displayed ())). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( is Root ()). perform ( waitFor ( 5 0 0 0 )) ĊĠĠĠĠĠĠĠ Ġon View ( with Text (" key åĢ¤ ãģ¯ æĽ´æĸ° å¯¾è±¡ åĲį ãģ§ãģ¯ ãģĤãĤĬ ãģ¾ãģĽãĤĵ ! ")). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġupdate Success () Ġ{ ĊĠĠĠĠĠĠĠ Ġed t New Key !!. perform ( type Text (" key Name "), Ġclose Soft Keyboard ()) ĊĠĠĠĠĠĠĠ Ġed t NewValue !!. perform ( type Text (" values "), Ġclose Soft Keyboard ()) ĊĠĠĠĠĠĠĠ Ġbtn Update !!. check ( matches ( is Displayed ())). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( is Root ()). perform ( waitFor ( 5 0 0 0 )) ĊĠĠĠĠĠĠĠ Ġon View ( with Text (" æĽ´æĸ° ãģ« æĪĲåĬŁ ãģĹãģ¾ãģĹãģŁ ãĢĤ ")). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} Ċ }