relying on createRoom to close itself rather than the newRoom flow

This commit is contained in:
Adam Brown 2021-11-05 15:35:57 +00:00
parent 0405c2df8d
commit b1397aee51
3 changed files with 12 additions and 5 deletions

View file

@ -16,7 +16,7 @@
package im.vector.app.ui.robot
import androidx.test.espresso.Espresso
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.matcher.ViewMatchers.withId
import com.adevinta.android.barista.assertion.BaristaListAssertions
import com.adevinta.android.barista.interaction.BaristaClickInteractions
@ -38,11 +38,12 @@ class CreateNewRoomRobot(
waitUntilViewVisible(withId(R.id.composerEditText))
}
block(RoomDetailRobot())
pressBack()
}
fun crawl() {
// Room access bottom sheet
BaristaClickInteractions.clickOn(R.string.room_settings_room_access_private_title)
Espresso.pressBack()
pressBack()
}
}

View file

@ -20,12 +20,15 @@ import androidx.test.espresso.Espresso
import com.adevinta.android.barista.interaction.BaristaClickInteractions
import im.vector.app.R
class NewRoomRobot {
class NewRoomRobot(
var createdRoom: Boolean = false
) {
fun createNewRoom(block: CreateNewRoomRobot.() -> Unit) {
BaristaClickInteractions.clickOn(R.string.create_new_room)
val createNewRoomRobot = CreateNewRoomRobot()
block(createNewRoomRobot)
createdRoom = createNewRoomRobot.createdRoom
if (!createNewRoomRobot.createdRoom) {
Espresso.pressBack()
}

View file

@ -45,7 +45,10 @@ class RoomListRobot {
waitUntilActivityVisible<RoomDirectoryActivity> {
BaristaVisibilityAssertions.assertDisplayed(R.id.publicRoomsList)
}
block(NewRoomRobot())
Espresso.pressBack()
val newRoomRobot = NewRoomRobot()
block(newRoomRobot)
if (!newRoomRobot.createdRoom) {
Espresso.pressBack()
}
}
}