mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-19 19:18:27 +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_message)).perform(ViewActions.click())
|
||||
// new chat
|
||||
onView(withId(R.id.publicKeyEditText)).perform(ViewActions.closeSoftKeyboard())
|
||||
onView(withId(R.id.copyButton)).perform(ViewActions.click())
|
||||
val context = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val copied = clipboardManager.primaryClip!!.getItemAt(0).text
|
||||
onView(withId(R.id.publicKeyEditText)).perform(ViewActions.typeText(copied.toString()))
|
||||
lateinit var copied: String
|
||||
InstrumentationRegistry.getInstrumentation().runOnMainSync {
|
||||
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())
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user