Skip to content
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

Fix flaky FieldListUpdateTest test #6077

Closed
wants to merge 1 commit into from

Conversation

seadowg
Copy link
Member

@seadowg seadowg commented Apr 10, 2024

Closes #5996

This test actually failed locally using API 34 which made it much easer to find the problem (trying to scroll while the keyboard is up). The test still passes running in API 30.

@seadowg seadowg changed the title Fix flaky test Fix flaky FieldListUpdateTest test Apr 10, 2024
@seadowg seadowg marked this pull request as ready for review April 10, 2024 16:29
@seadowg seadowg requested a review from grzesiek2010 April 10, 2024 16:29
@@ -557,6 +557,17 @@ abstract class Page<T : Page<T>> {
return destination
}

fun selectTextField(label: String, index: Int = 0): T {
closeSoftKeyboard()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you close the keyboard before clicking on another text field then this test does not cover the original scenario anymore and doesn't make sense.
The original issue was that:

  1. There was a long list of questions.
  2. The first question was a text question.
  3. The last question was a numeric question (so that the keyboard type is different and will trigger calling onLayoutChange on odkview once you switch from the first one to the last one).
  4. You add an answer to the first one (so that the text keyboard is open)
  5. Then you click on the last question (and the keyboard needs to be updated which as I said above calls onLayoutChange on odkview).

If you close the keyboard between steps 4 and 5 then onLayoutChange (what was the cause of the issue) will never be called.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right! Well this is not a good solution then 😆. Back to the drawing board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix FieldListUpdateTest#listOfQuestionsShouldNotBeScrolledToTheLastEditedQuestionAfterClickingOnAQuestion
2 participants