mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 01:45:52 +03:00
relying on createRoom to close itself rather than the newRoom flow
This commit is contained in:
parent
0405c2df8d
commit
b1397aee51
3 changed files with 12 additions and 5 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue