mirror of
https://github.com/oxen-io/session-android.git
synced 2025-05-07 09:39:28 +00:00
refactor: instrumentation for clipboard test was failing on smaller screen devices running the tests
This commit is contained in:
parent
873fb6b578
commit
7c3dc7e7bc
@ -55,11 +55,15 @@ class HomeActivityTests {
|
|||||||
onView(newConversationButtonWithDrawable(R.drawable.ic_plus)).perform(ViewActions.click())
|
onView(newConversationButtonWithDrawable(R.drawable.ic_plus)).perform(ViewActions.click())
|
||||||
onView(newConversationButtonWithDrawable(R.drawable.ic_message)).perform(ViewActions.click())
|
onView(newConversationButtonWithDrawable(R.drawable.ic_message)).perform(ViewActions.click())
|
||||||
// new chat
|
// new chat
|
||||||
|
onView(withId(R.id.publicKeyEditText)).perform(ViewActions.closeSoftKeyboard())
|
||||||
onView(withId(R.id.copyButton)).perform(ViewActions.click())
|
onView(withId(R.id.copyButton)).perform(ViewActions.click())
|
||||||
val context = InstrumentationRegistry.getInstrumentation().targetContext
|
val context = InstrumentationRegistry.getInstrumentation().targetContext
|
||||||
val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
lateinit var copied: String
|
||||||
val copied = clipboardManager.primaryClip!!.getItemAt(0).text
|
InstrumentationRegistry.getInstrumentation().runOnMainSync {
|
||||||
onView(withId(R.id.publicKeyEditText)).perform(ViewActions.typeText(copied.toString()))
|
val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||||
|
copied = clipboardManager.primaryClip!!.getItemAt(0).text.toString()
|
||||||
|
}
|
||||||
|
onView(withId(R.id.publicKeyEditText)).perform(ViewActions.typeText(copied))
|
||||||
onView(withId(R.id.createPrivateChatButton)).perform(ViewActions.click())
|
onView(withId(R.id.createPrivateChatButton)).perform(ViewActions.click())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user