-
Notifications
You must be signed in to change notification settings - Fork 529
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: Introduce a central utility for matching item in RecyclerView #2957
Conversation
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.assertion.ViewAssertions.matches | ||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
import org.oppia.android.app.recyclerview.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.
@anandwana001 I am facing trouble while importing this. Please guide me on what changes should I make in build.gradle
file so that the RecyclerViewMatcher
could be imported. I tried adding the app
module to the testing
module, but that doesn't seem to work.
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 guess we can shift RecyclerViewMatcher
to the testing module.
Waiting for @rt4914 confirmation.
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.
Okay will do that after the confirmation.
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 talked to him, yes we are good to shift it.
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.
Shall I update the overall codebase to use this new central utility of RecyclerViewTest or only update the AdministratorControlsActivityTest
?
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 think it will require updating all the files which are using RecyclerViewMatcher
, as the import path will going to change for all.
Check all the files using it and try to have a successful Gradle build.
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.assertion.ViewAssertions.matches | ||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
import org.oppia.android.app.recyclerview.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.
I guess we can shift RecyclerViewMatcher
to the testing module.
Waiting for @rt4914 confirmation.
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
import org.oppia.android.app.recyclerview.RecyclerViewMatcher.Companion.atPositionOnView | ||
|
||
class VerifyItemDisplayedInRecyclerView { |
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.
Check EditTextInputAction
for reference.
We can make this class all about RecyclerView
testing. So, it's not only about testing item at the position. In future, we can have things like item string checking or anything that comes up we can use this class as a central utility for all types of testing for RecyclerView.
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.
Ditto here.
Closing this PR, as the discussion is completed. |
Explanation
Fixes #2536: Introduce a central utility for matching item in RecyclerView
Checklist