package Ġbr . com . z up . be agle . autom ated Tests . cucumber . steps Ċ Ċ import Ġandroidx . test . rule . Activity Test Rule Ċ import Ġbr . com . z up . be agle . autom ated Tests . activity . MainActivity Ċ import Ġbr . com . z up . be agle . autom ated Tests . cucumber . elements .* Ċ import Ġbr . com . z up . be agle . autom ated Tests . cucumber . robots . Screen Robot Ċ import Ġbr . com . z up . be agle . autom ated Tests . utils . Activity Finish er Ċ import Ġbr . com . z up . be agle . autom ated Tests . utils . TestUtils Ċ import Ġc ucumber . api . java . After Ċ import Ġc ucumber . api . java . Before Ċ import Ġc ucumber . api . java . en .* Ċ import Ġorg . junit . Rule Ċ Ċ const Ġval ĠS IMP LE _ FORM _ SCREEN _ B FF _ URL Ġ= Ġ" http :// 1 0 . 0 . 2 . 2 : 8 0 8 0 / simple form " Ċ Ċ class ĠSimple Form Screen Steps Ġ{ ĊĊĠĠĠ Ġ@ Rule ĊĠĠĠ Ġvar Ġactivity Test Rule Ġ= ĠActivity Test Rule ( MainActivity :: class . java ) ĊĊĠĠĠ Ġ@ Before ("@ simple form ") ĊĠĠĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠĠĠĠĠ ĠTestUtils . startActivity ( activity Test Rule , ĠS IMP LE _ FORM _ SCREEN _ B FF _ URL ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ After ("@ simple form ") ĊĠĠĠ Ġfun ĠtearDown () Ġ{ ĊĠĠĠĠĠĠĠ ĠActivity Finish er . finish Open Activities () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Given ("^ that ĠI 'm Ġon Ġthe Ġsimple Ġform Ġscreen $ ") ĊĠĠĠ Ġfun Ġcheck Tab View Screen () Ġ{ ĊĠĠĠĠĠĠĠ ĠScreen Robot () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check View Contains Text ( SIMPLE _ FORM _ SCREEN _ HEADER , Ġtrue ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Then ("^ all Ġmy Ġsimple Ġform Ġcomponents Ġshould Ġrender Ġtheir Ġrespective Ġtext Ġattributes Ġcorrectly $ ") ĊĠĠĠ Ġfun Ġcheck Tab View R enders Tabs () Ġ{ ĊĠĠĠĠĠĠĠ ĠScreen Robot () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check View Contains Text ( SIMPLE _ FORM _ TITLE ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check View Contains Hint ( STRE ET _ FIELD ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check View Contains Hint ( ZIP _ FIELD ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ And ("^ insert Ġtext Ġ( .* )$ ") ĊĠĠĠ Ġfun Ġinsert Text ( text : ĠString ?) Ġ{ ĊĠĠĠĠĠĠĠ ĠScreen Robot () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. type Into TextField ( 0 , Ġ 1 , Ġtext ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Then ("^ confirm Ġpopup Ġshould Ġappear Ġcorrectly $ ") ĊĠĠĠ Ġfun Ġconfirm Pop Up () Ġ{ ĊĠĠĠĠĠĠĠ ĠScreen Robot () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check View Contains Text ( OK _ BUTTON ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check View Contains Text ( CANCEL _ BUTTON ) ĊĠĠĠ Ġ} Ċ }