package Ġcom . nk up pan . g iphy browser . ui . fragment Ċ Ċ import Ġandroidx . test . espress o . Esp ress o . on View Ċ import Ġandroidx . test . espress o . action . View Actions Ċ import Ġandroidx . test . espress o . action . View Actions . click Ċ import Ġandroidx . test . espress o . action . View Actions . press I me ActionButton Ċ import Ġandroidx . test . espress o . assertion . View Assertions . matches Ċ import Ġandroidx . test . espress o . matcher . View Matchers . is Displayed Ċ import Ġandroidx . test . espress o . matcher . View Matchers . with Id Ċ 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 Ġcom . nk up pan . g iphy browser . R Ċ import Ġcom . nk up pan . g iphy browser . browser . util . Matcher Util . child At Position Ċ import Ġcom . nk up pan . g iphy browser . presentation . MainActivity Ċ import Ġorg . hamcrest . Matchers . all Of Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ Large Test Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠG iphy Search Workflow Test Ġ{ ĊĊĠĠĠ Ġ@ Rule ĊĠĠĠ Ġ@ Jvm Field ĊĠĠĠ Ġvar Ġactivity Test Rule Ġ= ĠActivity Scenario Rule ( MainActivity :: class . java ) ĊĊĠĠĠ Ġprivate Ġfun Ġfind Search Container Add Text And Submit ( a QueryString : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġapp Compat EditText Ġ= Ġon View ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġall Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwith Id ( R . id . query ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġchild At Position ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġchild At Position ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwith Id ( R . id . search _ container ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 0 ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 0 ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġis Displayed () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġapp Compat EditText . perform ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠView Actions . replace Text ( a QueryString ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠView Actions . close Soft Keyboard () ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ ĠThread . sleep ( 1 0 0 0 ) ĊĊĠĠĠĠĠĠĠ Ġapp Compat EditText . perform ( press I me ActionButton ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Is Search Container Available () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . search _ container )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Is Query EditText Available () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . query )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Is Gif RadioButton Exist () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . gif )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Is St icker RadioButton Exist () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . stick ers )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest With EmptyString Search () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . query )). check ( matches ( is Displayed ())) ĊĊĠĠĠĠĠĠĠ Ġfind Search Container Add Text And Submit (" Ġ Ġ") ĊĊĠĠĠĠĠĠĠ Ġ// ĠShould Ġnot Ġnavigate Ġto Ġthe Ġnext Ġpage Ġwithout Ġquery Ġtext ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . g iphy _ bottom _ logo )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Launch G iphy B rows Page From Search Fragment With Gif Search () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . gif )). check ( matches ( is Displayed ())) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . gif )). perform ( click ()) ĊĊĠĠĠĠĠĠĠ Ġfind Search Container Add Text And Submit (" Android ") ĊĊĠĠĠĠĠĠĠ Ġ// ĠChecking Ġquery Ġfield Ġpresent Ġin Ġthe Ġg iphy Ġbrowser Ġlist Ġscreen ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . loader )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Launch G iphy B rows Page From Search Fragment With St icker Search () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . stick ers )). check ( matches ( is Displayed ())) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . stick ers )). perform ( click ()) ĊĊĠĠĠĠĠĠĠ Ġfind Search Container Add Text And Submit (" Android ") ĊĊĠĠĠĠĠĠĠ Ġ// ĠChecking Ġquery Ġfield Ġpresent Ġin Ġthe Ġg iphy Ġbrowser Ġlist Ġscreen ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . loader )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} Ċ } Ċ