Home | History | Annotate | Download | only in helpers
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.platform.test.helpers;
     18 
     19 import android.app.Instrumentation;
     20 import android.support.test.uiautomator.Direction;
     21 
     22 public abstract class AbstractGoogleMessengerHelper extends AbstractStandardAppHelper {
     23 
     24     public AbstractGoogleMessengerHelper(Instrumentation instr) {
     25         super(instr);
     26     }
     27 
     28     /*
     29      * Setup expectations: Google Messenger app is open.
     30      *
     31      * This method brings the Messenger app to the home page.
     32      */
     33     public abstract void goToHomePage();
     34 
     35     /*
     36      * Setup expectation: Google Messenger app is on the home page.
     37      *
     38      * This method brings up the new conversation page.
     39      */
     40     public abstract void goToNewConversationPage();
     41 
     42     /*
     43      * Setup expectations: Google Messenger app is on the new conversation page.
     44      *
     45      * This method moves the Google Messenger app to messages page with the specified contacts.
     46      */
     47     public abstract void goToMessagesPage();
     48 
     49     /**
     50      * Setup expectations: Google Messenger app is on the messages page.
     51      *
     52      * This method scrolls through the messages on the messages page.
     53      *
     54      * @param direction Direction to scroll, must be UP or DOWN.
     55      */
     56     public abstract void scrollMessages(Direction direction);
     57 
     58     /**
     59      * Setup expectations: Google Messenger app is on the messages page.
     60      *
     61      * This method clicks the "send message" textbox on the messages page.
     62      */
     63     public abstract void clickComposeMessageText();
     64 
     65     /**
     66      * Setup expectations:
     67      *   1. Google Messenger app is on the messages page
     68      *   2. New message textbox is not empty.
     69      */
     70     public abstract void clickSendMessageButton();
     71 
     72     /**
     73      * Setup expectations: Google Messenger app is on the messages page.
     74      *
     75      * This method clicks the "attach media" button and attaches the media file with the given
     76      * index in the device media gallery view.
     77      */
     78     public abstract void attachMediaFromDevice(int index);
     79 }
     80