Don't let the doze dialog make the tests fail

This commit is contained in:
Hocuri 2021-10-01 13:31:38 +02:00
parent b495b847f4
commit dfb13ca7a4
No known key found for this signature in database
GPG key ID: 0D45AD9007D18DCD
2 changed files with 17 additions and 13 deletions

View file

@ -1,8 +1,6 @@
package com.b44t.messenger.uitests.online;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import androidx.test.ext.junit.rules.ActivityScenarioRule;
@ -18,7 +16,6 @@ import org.junit.runner.RunWith;
import org.thoughtcrime.securesms.BuildConfig;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.WelcomeActivity;
import org.thoughtcrime.securesms.connect.AccountManager;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
@ -28,19 +25,12 @@ import static androidx.test.espresso.matcher.ViewMatchers.isClickable;
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
import static androidx.test.espresso.matcher.ViewMatchers.withHint;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class OnboardingTest {
@Rule
public ActivityScenarioRule<WelcomeActivity> activityRule = new ActivityScenarioRule<>(getIntent());
private Intent getIntent() {
Context context = getInstrumentation().getTargetContext();
AccountManager.getInstance().beginAccountCreation(context);
return new Intent(getInstrumentation().getTargetContext(), WelcomeActivity.class);
}
public ActivityScenarioRule<WelcomeActivity> activityRule = TestUtils.getOnlineActivityRule(WelcomeActivity.class);
@Test
public void testAccountCreation() {