From ed4f26de8150afdba2eee59bf7c17224015ade22 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Thu, 4 Nov 2021 12:35:03 +0000 Subject: [PATCH] adding login timeouts to reduce flakyness during login --- vector/src/androidTest/java/im/vector/app/ui/UiTestBase.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vector/src/androidTest/java/im/vector/app/ui/UiTestBase.kt b/vector/src/androidTest/java/im/vector/app/ui/UiTestBase.kt index 2cef326501..076c1a5b51 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/UiTestBase.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/UiTestBase.kt @@ -29,8 +29,10 @@ import im.vector.app.R import im.vector.app.espresso.tools.waitUntilActivityVisible import im.vector.app.features.home.HomeActivity import im.vector.app.waitForView +import java.lang.Thread.sleep class UiTestBase { + fun createAccount(userId: String, password: String = "password", homeServerUrl: String = "http://10.0.2.2:8080") { initSession(true, userId, password, homeServerUrl) } @@ -52,6 +54,7 @@ class UiTestBase { writeTo(R.id.loginServerUrlFormHomeServerUrl, homeServerUrl) assertEnabled(R.id.loginServerUrlFormSubmit) closeSoftKeyboard() + sleep(500) clickOn(R.id.loginServerUrlFormSubmit) onView(isRoot()).perform(waitForView(withId(R.id.loginSignupSigninSubmit))) @@ -75,6 +78,7 @@ class UiTestBase { assertEnabled(R.id.loginSubmit) closeSoftKeyboard() + sleep(500) clickOn(R.id.loginSubmit) // Wait