-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sanity tests robot pattern and reliability refactor #4420
Conversation
- will allow reuse of navigating around the app (eg enabling develop options and go back to previous locations)
- improves the flakyness around the bottom sheets and dialogs
…moved the flakyness when running the tests on my emulator
- also makes waitForActivity stronger by also waiting for child views
@@ -70,6 +73,8 @@ fun waitForView(viewMatcher: Matcher<View>, timeout: Long = 10_000, waitForDispl | |||
val endTime = startTime + timeout | |||
val visibleMatcher = isDisplayed() | |||
|
|||
uiController.loopMainThreadForAtLeast(100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really wanted to avoid this but this single change made the biggest difference for me when it came to reliability.
Dialogs and bottomsheets would be visible
but not interactable, back actions or button presses would be ignored half the time~.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this nice rework.
A few feedbacks
// Disable until the "you don't have a session for id %d" sign out bug is fixed | ||
// elementRobot.signout() | ||
//// Login again on the same account | ||
// elementRobot.login(userId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not test regular login then... This is a bit annoying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed! I'd like to look into the bug and reenable this ASAP
import im.vector.app.features.home.room.detail.RoomDetailActivity | ||
|
||
class CreateNewRoomRobot( | ||
var createdRoom: Boolean = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the goal of this boolean? (I do not know the Robot pattern)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's to avoid a pressBack
if we create a new room as navigating to the new room finishes the current room creation activity (I hope that makes sense? 😅 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see. But this test should always create a room, so this is still strange to me.
BaristaClickInteractions.clickOn(R.string.create_new_room) | ||
val createNewRoomRobot = CreateNewRoomRobot() | ||
block(createNewRoomRobot) | ||
if (!createNewRoomRobot.createdRoom) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test should fail in this case, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without this the next steps will fail as every robot assumes the start and end position are the same
in the case of creating a new room the room creation screen is automatically finished so there's no need to press back, if we did then we'd exit the app as the RoomDetails
// move to room list tab and press #+
elementRobot.newRoom {
// press create new room launches CreateRoomActivity
createNewRoom {
// press create, navigates to the RoomDetailsActivity, CreateRoomActivity automatically closes
createRoom {
// goes through all the room detail checks
crawl()
// on createRoom finish pressBack to take us back to root activity
}
// avoid pressing back because we created a room
}
// avoid pressing back because we created a room
}
some observations during my testing
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update.
I'll trust your judgment for the boolean var in the room creation robot.
ktlint issues fixed on develop in 2b58c0e |
robot
pattern (extracting the UI navigation and manipulation to dedicated classes which return themselves back to the original state), this enables fine grain reusable navigation