// Path: app/src/androidTest/java/com/pushapp/press/ElapsedTimeIdlingResource.java
// public class ElapsedTimeIdlingResource implements IdlingResource {
//     private final long startTime;
//     private final long waitingTime;
//     private ResourceCallback resourceCallback;
// 
//     public ElapsedTimeIdlingResource(long waitingTime) {
//         this.startTime = System.currentTimeMillis();
//         this.waitingTime = waitingTime;
//     }
// 
//     @Override
//     public String getName() {
//         return ElapsedTimeIdlingResource.class.getName() + ":" + waitingTime;
//     }
// 
//     @Override
//     public boolean isIdleNow() {
//         long elapsed = System.currentTimeMillis() - startTime;
//         boolean idle = (elapsed >= waitingTime);
//         if (idle) {
//             resourceCallback.onTransitionToIdle();
//         }
//         return idle;
//     }
// 
//     @Override
//     public void registerIdleTransitionCallback(ResourceCallback resourceCallback) {
//         this.resourceCallback = resourceCallback;
//     }
// }
// 
// Path: app/src/androidTest/java/com/pushapp/press/ScreengrabHelper.java
// public class ScreengrabHelper {
// 
//     private static ScreengrabHelper instance;
//     private static final long INIT_DELAY = 2000;
// 
//     private long delay;
//     private boolean screenShotTaken;
// 
//     public ScreengrabHelper() {
//         this.delay = INIT_DELAY;
//     }
// 
//     public static void delayScreenshot(String name) {
//         ensureInstance();
//         instance.takeDelayScreenshot(name);
//     }
// 
//     private static void ensureInstance() {
//         if (instance == null) {
//             instance = new ScreengrabHelper();
//         }
//     }
// 
//     private void takeDelayScreenshot(String name) {
//         screenShotTaken = false;
// 
//         new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
//             @Override
//             public void run() {
//                 screenShotTaken = true;
//             }
//         }, delay);
// 
//         new Wait(new Wait.Condition() {
//             @Override
//             public boolean check() {
//                 return screenShotTaken;
//             }
//         }).waitForIt();
// 
//         Screengrab.screenshot(name);
//     }
// 
//     public static void setDelay(long delay) {
//         ensureInstance();
//         instance.changeDelay(delay);
//     }
//     
//     public void changeDelay(long delay) {
//         this.delay = delay;
//     }
// }


import android.support.test.espresso.Espresso;
import android.support.test.espresso.IdlingPolicies;
import android.support.test.espresso.IdlingResource;
import android.support.test.espresso.PerformException;
import android.support.test.espresso.UiController;
import android.support.test.espresso.ViewAction;
import android.support.test.espresso.action.ViewActions;
import android.support.test.espresso.matcher.ViewMatchers;
import android.support.test.espresso.util.HumanReadables;
import android.support.test.espresso.util.TreeIterables;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.view.View;
import com.pushapp.press.ElapsedTimeIdlingResource;
import org.hamcrest.Matcher;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.runner.RunWith;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import com.pushapp.press.ScreengrabHelper;
import java.util.concurrent.TimeUnit;
package com.pushapp.press;





//import tools.fastlane.screengrab.Screengrab;
//import tools.fastlane.screengrab.locale.LocaleTestRule;



@RunWith(AndroidJUnit4.class)
public class

BasicTest {
//    @ClassRule
//    public static final TestRule classRule = new LocaleTestRule();

    @Rule
    public final ActivityTestRule<HomeActivity> activityTestRule = new ActivityTestRule<>(HomeActivity.class);


    @Test
    public void takeScreenshot() throws Exception {
        //onView(withId(R.id.mHomeLayout)).perform(ViewActions.swipeDown());

        //onView(withId(R.id.mHomeLayout))
        //        .perform(withCustomConstraints(ViewActions.swipeDown(), ViewMatchers.isDisplayingAtLeast(10)));


        //
        // Make sure Espresso does not time out
        int waitingTime = 10000;
        IdlingPolicies.setMasterPolicyTimeout(waitingTime * 2, TimeUnit.MILLISECONDS);
        IdlingPolicies.setIdlingResourceTimeout(waitingTime * 2, TimeUnit.MILLISECONDS);

        // Now we wait
// Path: app/src/androidTest/java/com/pushapp/press/ElapsedTimeIdlingResource.java
// public class ElapsedTimeIdlingResource implements IdlingResource {
//     private final long startTime;
//     private final long waitingTime;
//     private ResourceCallback resourceCallback;
// 
//     public ElapsedTimeIdlingResource(long waitingTime) {
//         this.startTime = System.currentTimeMillis();
//         this.waitingTime = waitingTime;
//     }
// 
//     @Override
//     public String getName() {
//         return ElapsedTimeIdlingResource.class.getName() + ":" + waitingTime;
//     }
// 
//     @Override
//     public boolean isIdleNow() {
//         long elapsed = System.currentTimeMillis() - startTime;
//         boolean idle = (elapsed >= waitingTime);
//         if (idle) {
//             resourceCallback.onTransitionToIdle();
//         }
//         return idle;
//     }
// 
//     @Override
//     public void registerIdleTransitionCallback(ResourceCallback resourceCallback) {
//         this.resourceCallback = resourceCallback;
//     }
// }
// 
// Path: app/src/androidTest/java/com/pushapp/press/ScreengrabHelper.java
// public class ScreengrabHelper {
// 
//     private static ScreengrabHelper instance;
//     private static final long INIT_DELAY = 2000;
// 
//     private long delay;
//     private boolean screenShotTaken;
// 
//     public ScreengrabHelper() {
//         this.delay = INIT_DELAY;
//     }
// 
//     public static void delayScreenshot(String name) {
//         ensureInstance();
//         instance.takeDelayScreenshot(name);
//     }
// 
//     private static void ensureInstance() {
//         if (instance == null) {
//             instance = new ScreengrabHelper();
//         }
//     }
// 
//     private void takeDelayScreenshot(String name) {
//         screenShotTaken = false;
// 
//         new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
//             @Override
//             public void run() {
//                 screenShotTaken = true;
//             }
//         }, delay);
// 
//         new Wait(new Wait.Condition() {
//             @Override
//             public boolean check() {
//                 return screenShotTaken;
//             }
//         }).waitForIt();
// 
//         Screengrab.screenshot(name);
//     }
// 
//     public static void setDelay(long delay) {
//         ensureInstance();
//         instance.changeDelay(delay);
//     }
//     
//     public void changeDelay(long delay) {
//         this.delay = delay;
//     }
// }


// Path: app/src/androidTest/java/com/pushapp/press/BasicTest.java
import android.support.test.espresso.Espresso;
import android.support.test.espresso.IdlingPolicies;
import android.support.test.espresso.IdlingResource;
import android.support.test.espresso.PerformException;
import android.support.test.espresso.UiController;
import android.support.test.espresso.ViewAction;
import android.support.test.espresso.action.ViewActions;
import android.support.test.espresso.matcher.ViewMatchers;
import android.support.test.espresso.util.HumanReadables;
import android.support.test.espresso.util.TreeIterables;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.view.View;
import com.pushapp.press.ElapsedTimeIdlingResource;
import org.hamcrest.Matcher;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.runner.RunWith;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import com.pushapp.press.ScreengrabHelper;
import java.util.concurrent.TimeUnit;

package com.pushapp.press;





//import tools.fastlane.screengrab.Screengrab;
//import tools.fastlane.screengrab.locale.LocaleTestRule;



@RunWith(AndroidJUnit4.class)
public class

BasicTest {
//    @ClassRule
//    public static final TestRule classRule = new LocaleTestRule();

    @Rule
    public final ActivityTestRule<HomeActivity> activityTestRule = new ActivityTestRule<>(HomeActivity.class);


    @Test
    public void takeScreenshot() throws Exception {
        //onView(withId(R.id.mHomeLayout)).perform(ViewActions.swipeDown());

        //onView(withId(R.id.mHomeLayout))
        //        .perform(withCustomConstraints(ViewActions.swipeDown(), ViewMatchers.isDisplayingAtLeast(10)));


        //
        // Make sure Espresso does not time out
        int waitingTime = 10000;
        IdlingPolicies.setMasterPolicyTimeout(waitingTime * 2, TimeUnit.MILLISECONDS);
        IdlingPolicies.setIdlingResourceTimeout(waitingTime * 2, TimeUnit.MILLISECONDS);

        // Now we wait
        IdlingResource idlingResource = new ElapsedTimeIdlingResource(waitingTime);