Skip to content

Commit 251a676

Browse files
committed
wip
1 parent 222783a commit 251a676

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

FlowCrypt/src/androidTest/java/com/flowcrypt/email/base/BaseTest.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ abstract class BaseTest : BaseActivityTestImplementation {
403403
}
404404
}
405405
406+
protected fun getIdentifierByName(name: String): Int {
407+
return getTargetContext()
408+
.resources
409+
.getIdentifier(name, "id", getTargetContext().packageName)
410+
}
411+
406412
companion object{
407413
const val NOTIFICATION_RESOURCES_NAME =
408414
"com.android.systemui:id/expandableNotificationRow"

FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/RecipientsListFlowTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class RecipientsListFlowTest : BaseRecipientsListTest() {
129129
onView(withId(R.id.menuSearch))
130130
.check(matches(isDisplayed()))
131131
.perform(click())
132-
onView(withId(com.google.android.material.R.id.search_src_text))
132+
onView(withId(getIdentifierByName("search_src_text")))
133133
.perform(clearText(), replaceText("00"))
134134
.perform(pressKey(KeyEvent.KEYCODE_ENTER))
135135
closeSoftKeyboard()

FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/SelectRecipientsFragmentFlowTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
3-
* Contributors: DenBond7
3+
* Contributors: denbond7
44
*/
55

66
package com.flowcrypt.email.ui
@@ -115,15 +115,15 @@ class SelectRecipientsFragmentFlowTest : BaseTest() {
115115
onView(withId(R.id.menuSearch))
116116
.check(matches(isDisplayed()))
117117
.perform(click())
118-
onView(withId(com.google.android.material.R.id.search_src_text))
118+
onView(withId(getIdentifierByName("search_src_text")))
119119
.perform(clearText(), typeText("some email"))
120120
closeSoftKeyboard()
121121
onView(withId(R.id.tVEmpty))
122122
.check(matches(isDisplayed())).check(matches(withText(R.string.no_results)))
123123
}
124124

125125
private fun checkIsTypedUserFound(viewId: Int, viewText: String) {
126-
onView(withId(com.google.android.material.R.id.search_src_text))
126+
onView(withId(getIdentifierByName("search_src_text")))
127127
.perform(clearText(), typeText(viewText))
128128
closeSoftKeyboard()
129129
onView(withId(viewId))

FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/SearchMessagesGmailApiFlowTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class SearchMessagesGmailApiFlowTest : BaseGmailApiTest() {
9797
onView(withId(R.id.menuSearch))
9898
.check(matches(isDisplayed()))
9999
.perform(click())
100-
onView(withId(com.google.android.material.R.id.search_src_text))
100+
onView(withId(getIdentifierByName("search_src_text")))
101101
.perform(click(), clearText(), replaceText(SUBJECT_EXISTING_STANDARD))
102102
.perform(pressKey(KeyEvent.KEYCODE_ENTER))
103103

@@ -114,4 +114,4 @@ class SearchMessagesGmailApiFlowTest : BaseGmailApiTest() {
114114
)
115115
)
116116
}
117-
}
117+
}

0 commit comments

Comments
 (0)