diff --git a/.travis.yml b/.travis.yml index 1b9a4e050..d8a490614 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,8 +41,9 @@ script: echo no | android create avd --force --name test --target $ANDROID_TARGET --abi $ANDROID_ABI; emulator -avd test -no-skin -no-audio -no-window & android-wait-for-emulator; - adb devices; + sleep 10; adb shell svc power stayon true; + sleep 5; adb shell input keyevent 82; ./gradlew --stacktrace connectedFdroidDebugAndroidTest -i; fi diff --git a/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/remote/OpenPgpServiceTest.java b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/remote/OpenPgpServiceTest.java index 89968ad96..d12fc6333 100644 --- a/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/remote/OpenPgpServiceTest.java +++ b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/remote/OpenPgpServiceTest.java @@ -40,7 +40,7 @@ import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withKeyItem @LargeTest public class OpenPgpServiceTest { - public static final int ACTIVITY_WAIT_TIME = 2; + public static final int ACTIVITY_WAIT_TIME = 2 * 1000; @Rule public final ServiceTestRule mServiceRule = new ServiceTestRule(); @@ -81,7 +81,7 @@ public class OpenPgpServiceTest { PendingIntent pi = result.getParcelableExtra(OpenPgpApi.RESULT_INTENT); pi.send(); - Thread.sleep(ACTIVITY_WAIT_TIME * 1000); // Wait for activity to start + Thread.sleep(ACTIVITY_WAIT_TIME); // Wait for activity to start onView(withText(R.string.api_register_allow)).perform(click()); } @@ -120,7 +120,7 @@ public class OpenPgpServiceTest { PendingIntent pi = result.getParcelableExtra(OpenPgpApi.RESULT_INTENT); pi.send(); - Thread.sleep(ACTIVITY_WAIT_TIME * 1000); // Wait for activity to start + Thread.sleep(ACTIVITY_WAIT_TIME); // Wait for activity to start onData(withKeyItemId(0x9D604D2F310716A3L)) .inAdapterView(isAssignableFrom(AdapterView.class)) .perform(click()); @@ -143,7 +143,7 @@ public class OpenPgpServiceTest { PendingIntent pi = result.getParcelableExtra(OpenPgpApi.RESULT_INTENT); pi.send(); - Thread.sleep(ACTIVITY_WAIT_TIME * 1000); // Wait for activity to start + Thread.sleep(ACTIVITY_WAIT_TIME); // Wait for activity to start onView(withId(R.id.passphrase_passphrase)).perform(typeText("x")); // Needed to correctly execute test on Travis