mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
Merge pull request #7856 from vector-im/feature/bca/fix_ui_tests
FIx UI Tests
This commit is contained in:
commit
ebd0f8a5db
4 changed files with 15 additions and 13 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue