Merge pull request #7856 from vector-im/feature/bca/fix_ui_tests

FIx UI Tests
This commit is contained in:
Valere 2022-12-29 14:27:34 +01:00 committed by GitHub
commit ebd0f8a5db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 13 deletions

View file

@ -89,7 +89,7 @@ fun getString(@StringRes id: Int): String {
return EspressoHelper.getCurrentActivity()!!.resources.getString(id)
}
fun waitForView(viewMatcher: Matcher<View>, timeout: Long = 10_000, waitForDisplayed: Boolean = true): ViewAction {
fun waitForView(viewMatcher: Matcher<View>, timeout: Long = 20_000, waitForDisplayed: Boolean = true): ViewAction {
return object : ViewAction {
private val clock = DefaultClock()

View file

@ -28,7 +28,6 @@ import im.vector.app.espresso.tools.ScreenshotFailureRule
import im.vector.app.features.MainActivity
import im.vector.app.getString
import im.vector.app.ui.robot.ElementRobot
import im.vector.app.ui.robot.settings.labs.LabFeature
import im.vector.app.ui.robot.settings.labs.LabFeaturesPreferences
import im.vector.app.ui.robot.withDeveloperMode
import org.junit.Rule
@ -133,6 +132,10 @@ class UiAllScreensSanityTest {
}
}
// Some instability with the bottomsheet
// not sure what's the source, maybe the expanded state?
Thread.sleep(10_000)
elementRobot.space { selectSpace(spaceName) }
elementRobot.layoutPreferences {
@ -175,7 +178,6 @@ class UiAllScreensSanityTest {
* Testing multiple threads screens
*/
private fun testThreadScreens() {
elementRobot.toggleLabFeature(LabFeature.THREAD_MESSAGES)
elementRobot.newRoom {
createNewRoom {
crawl()
@ -189,6 +191,5 @@ class UiAllScreensSanityTest {
}
}
}
elementRobot.toggleLabFeature(LabFeature.THREAD_MESSAGES)
}
}

View file

@ -28,7 +28,6 @@ import androidx.test.espresso.matcher.ViewMatchers.withText
import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
import im.vector.app.R
import im.vector.app.espresso.tools.waitUntilActivityVisible
import im.vector.app.espresso.tools.waitUntilDialogVisible
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.home.HomeActivity
import im.vector.app.features.home.room.detail.RoomDetailActivity
@ -86,14 +85,17 @@ class SpaceCreateRobot {
clickOn(R.id.nextButton)
waitUntilViewVisible(withId(R.id.recyclerView))
clickOn(R.id.nextButton)
// waitUntilActivityVisible<RoomDetailActivity> {
// waitUntilDialogVisible(withId(R.id.inviteByMxidButton))
// }
// // close invite dialog
// pressBack()
waitUntilActivityVisible<RoomDetailActivity> {
waitUntilDialogVisible(withId(R.id.inviteByMxidButton))
pressBack()
}
// close invite dialog
pressBack()
waitUntilViewVisible(withId(R.id.timelineRecyclerView))
// waitUntilViewVisible(withId(R.id.timelineRecyclerView))
// close room
pressBack()
// pressBack()
waitUntilViewVisible(withId(R.id.roomListContainer))
}
}

View file

@ -89,9 +89,8 @@ class SpaceMenuRobot {
clickOnSheet(R.id.leaveSpace)
waitUntilActivityVisible<SpaceLeaveAdvancedActivity> {
waitUntilViewVisible(ViewMatchers.withId(R.id.roomList))
clickOn(R.id.spaceLeaveSelectAll)
clickOn(R.id.spaceLeaveButton)
}
clickOn(R.id.spaceLeaveSelectAll)
clickOn(R.id.spaceLeaveButton)
waitUntilViewVisible(ViewMatchers.withId(R.id.groupListView))
}
}