-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Remove ignore from field list test #6170
Conversation
* https://stackoverflow.com/a/39756832 | ||
* | ||
*/ | ||
@Deprecated("this matcher is stateful and will cause problems if used more than once") |
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 problems with this are actually mentioned in a comment on the SO answer, but for some reason the answer has stayed up. I've flagged it, so others don't run into the same problems.
To be clear, I'm not sure if it actually broke anything for us, but while experimenting with different ways of scrolling and clicking I ended up running into problems caused by the state here.
} | ||
|
||
override fun matchesSafely(item: View): Boolean { | ||
return if (item is QuestionWidget) { |
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'm not a big fan of UI tests that know this much about the view hierarchy, but I've tried to keep this as general as possible: QuestionWidget
is a pretty fundamental view type and there just needs to be a text_label
somewhere within it for this to work (the actual structure doesn't matter).
Closes #5996
Why is this the best possible solution? Were any other approaches considered?
I was only able to get this to fail once, only on Test Lab and not since 40148aa. The main change I've made here is to deprecate
withIndex
due to it presenting subtle problems (because it's stateful). I suspect some of the other work we've done on UI tests recently has made this more stable, and I'm optimistic that the new method for scrolling to a question is more robust as well.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
This just changes tests, so there is nothing to verify.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest
(or./gradlew testLab
) and confirmed all checks still passDateFormatsTest