-
Notifications
You must be signed in to change notification settings - Fork 550
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 #2536: Add central testing utility for RecyclerView #2965
Fix #2536: Add central testing utility for RecyclerView #2965
Conversation
@anandwana001 Changes done as per the discussion. PTAL. |
Looks like as the file is no more in the app module, we need some update around BUILD files. Line 655 in 75c25b8
|
@anandwana001 PTAL. |
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.
will review again, once the below-mentioned comments completed.
testing/src/main/java/org/oppia/android/testing/RecyclerViewTesting.kt
Outdated
Show resolved
Hide resolved
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.
As we had shifted the RecyclerViewMatcher
from app module to Testing module, we can remove the companion object
and use it as we are using other functions in the testing module.
testing/src/main/java/org/oppia/android/testing/RecyclerViewTesting.kt
Outdated
Show resolved
Hide resolved
For doing this, I have to inject RecyclerViewMatcher in all the files, that were earlier using it as a |
Yes |
Done |
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.
Our function verifyItemDisplayedOnRecyclerView
is using atPositionOnView
and there is also one function atPositionOnView
.
Could you check what's the difference between them and when to use which function?
testing/src/main/java/org/oppia/android/testing/RecyclerViewMatcher.kt
Outdated
Show resolved
Hide resolved
testing/src/main/java/org/oppia/android/testing/RecyclerViewMatcher.kt
Outdated
Show resolved
Hide resolved
The purpose of The two I hope that I got the question correctly, if you think that there is some misinterpretation here, then please let me know. |
I Will take a look at this tomorrow, might look into some concise solution. |
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, @Sparsh1212
This is something cleaning up by shifting the RecyclerViewMatcher
to the testing module.
Earlier I suggested, we can drop using companion object because I thought we might need context or testCoroutineDispatchers
to inject in the class, but now as I looked more closely at it, I think we don't need any of them.
So, what I suggest here that we can use the companion object
back. Sorry for this extra trouble, but I think this will going to be much cleaner.
Let me know your thoughts on this.
@@ -56,6 +55,7 @@ import org.oppia.android.domain.oppialogger.loguploader.LogUploadWorkerModule | |||
import org.oppia.android.domain.oppialogger.loguploader.WorkManagerConfigurationModule | |||
import org.oppia.android.domain.question.QuestionModule | |||
import org.oppia.android.domain.topic.PrimeTopicAssetsControllerModule | |||
import org.oppia.android.testing.RecyclerViewMatcher.Companion.atPositionOnView |
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.
This is causing the failure. Please check my above comment. I think I missed something earlier and need revert.
No worries Sir, I will revert back the changes made for the companion object. But just for the sake of knowledge can you please let me know, why we won't be requiring |
We cannot confirm whether we will be requiring this in future or not, but as it seems, currently there is no requirement of |
Explanation
Fixes #2536:
RecyclerViewMatcher
to testing module and update the corresponding imports.Checklist