mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 20:06:51 +03:00
naming the threads room creation to avoid multiple rooms with empty room as the name, causing ambiguous assertion errors
This commit is contained in:
parent
a5bf25f2b4
commit
8db704f3b9
2 changed files with 15 additions and 2 deletions
|
@ -159,7 +159,7 @@ class UiAllScreensSanityTest {
|
|||
elementRobot.newRoom {
|
||||
createNewRoom {
|
||||
crawl()
|
||||
createRoom {
|
||||
createRoom(roomName = "thread room") {
|
||||
val message = "Hello This message will be a thread!"
|
||||
postMessage(message)
|
||||
replyToThread(message)
|
||||
|
|
|
@ -16,8 +16,15 @@
|
|||
|
||||
package im.vector.app.ui.robot
|
||||
|
||||
import androidx.test.espresso.Espresso.closeSoftKeyboard
|
||||
import androidx.test.espresso.Espresso.onData
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.Espresso.pressBack
|
||||
import androidx.test.espresso.action.ViewActions.replaceText
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withHint
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||
import com.adevinta.android.barista.assertion.BaristaListAssertions
|
||||
import com.adevinta.android.barista.interaction.BaristaClickInteractions
|
||||
import com.adevinta.android.barista.interaction.BaristaListInteractions
|
||||
|
@ -25,14 +32,20 @@ import im.vector.app.R
|
|||
import im.vector.app.espresso.tools.waitUntilActivityVisible
|
||||
import im.vector.app.espresso.tools.waitUntilViewVisible
|
||||
import im.vector.app.features.home.room.detail.RoomDetailActivity
|
||||
import org.hamcrest.CoreMatchers.allOf
|
||||
|
||||
class CreateNewRoomRobot(
|
||||
var createdRoom: Boolean = false
|
||||
) {
|
||||
|
||||
fun createRoom(block: RoomDetailRobot.() -> Unit) {
|
||||
fun createRoom(roomName: String? = null, block: RoomDetailRobot.() -> Unit) {
|
||||
createdRoom = true
|
||||
BaristaListAssertions.assertListItemCount(R.id.createRoomForm, 12)
|
||||
roomName?.let {
|
||||
onView(allOf(withId(R.id.formTextInputTextInputEditText), withHint(R.string.create_room_name_hint)))
|
||||
.perform(replaceText(roomName))
|
||||
closeSoftKeyboard()
|
||||
}
|
||||
BaristaListInteractions.clickListItemChild(R.id.createRoomForm, 11, R.id.form_submit_button)
|
||||
waitUntilActivityVisible<RoomDetailActivity> {
|
||||
waitUntilViewVisible(withId(R.id.composerEditText))
|
||||
|
|
Loading…
Reference in a new issue