From c4e61c6a8f383c2d68d4afeb7ebf13ea06bf6c5f Mon Sep 17 00:00:00 2001 From: DenBond7 Date: Thu, 1 Apr 2021 14:28:09 +0300 Subject: [PATCH] Modified SearchMessagesActivityTest.| #1116 --- .../ui/activity/SearchMessagesActivityTest.kt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/SearchMessagesActivityTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/SearchMessagesActivityTest.kt index e40e141469..bf5c899b60 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/SearchMessagesActivityTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/SearchMessagesActivityTest.kt @@ -72,7 +72,7 @@ class SearchMessagesActivityTest : BaseEmailListActivityTest() { @Before fun waitData() { - // Need to improve this code after espresso updates + //todo-denbond7 Need to improve this code after espresso updates Thread.sleep(2000) } @@ -98,6 +98,8 @@ class SearchMessagesActivityTest : BaseEmailListActivityTest() { onView(isAssignableFrom(EditText::class.java)) .check(matches(withText(DEFAULT_QUERY_TEXT))) .perform(clearText(), typeText(SECOND_QUERY_TEXT), pressImeActionButton()) + //todo-denbond7 Need to improve this code + Thread.sleep(2000) onView(withId(R.id.rVMsgs)) .check(matches(withRecyclerViewItemCount(2))).check(matches(isDisplayed())) } @@ -110,6 +112,8 @@ class SearchMessagesActivityTest : BaseEmailListActivityTest() { onView(isAssignableFrom(EditText::class.java)) .check(matches(withText(DEFAULT_QUERY_TEXT))) .perform(clearText(), typeText(QUERY_TEXT_FOR_SUBJECT_BODY_FROM), pressImeActionButton()) + //todo-denbond7 Need to improve this code + Thread.sleep(2000) onView(withId(R.id.rVMsgs)) .check(matches(withRecyclerViewItemCount(4))).check(matches(isDisplayed())) } @@ -137,8 +141,13 @@ class SearchMessagesActivityTest : BaseEmailListActivityTest() { .check(matches(isDisplayed())) .perform(click()) onView(isAssignableFrom(EditText::class.java)) - .perform(clearText(), typeText("The string with no results"), pressImeActionButton()) - onView(withId(R.id.emptyView)) + .perform( + clearText(), + typeText("The string with no results"), + pressImeActionButton()) + //todo-denbond7 Need to improve this code + Thread.sleep(2000) + onView(withId(R.id.tVEmpty)) .check(matches(isDisplayed())) }