-
Notifications
You must be signed in to change notification settings - Fork 527
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 #138: Topic train fragment Low-fi UI (Part 4) #204
Conversation
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.
LGTM
Thanks @veena14cs |
app/src/sharedTest/java/org/oppia/app/topic/train/TopicTrainFragmentTest.kt
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.
Please include KDoc for test cases
app/src/sharedTest/java/org/oppia/app/topic/train/TopicTrainFragmentTest.kt
Show resolved
Hide resolved
fun testTopicTrainFragment_loadFragment_textIsDisplayed() { | ||
ActivityScenario.launch(TopicActivity::class.java).use { | ||
onView(withId(R.id.dummy_text_view)).check(matches(withText("This is dummy TextView for testing"))) | ||
fun testTopicTrainFragment_loadFragment_selectSkills_submitButtonIsActivated() { |
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.
Other cases worth testing:
- Verifying that when no skills are selected, the button is not clickable
- Verifying that the button's clickable state becomes disabled after selecting & deselecting skills
- Verifying that clicking the submit button properly forwards the list of skills to an outgoing activity
- Verifying that the list of selected skills stay selected upon a configuration change
- Verifying that the submit button activation status stays correct for both enabled/disabled cases upon a configuration change
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.
Added all these working test-cases
@BenHenning PTAL at updated test cases. |
@BenHenning Regarding RecyclerViewMatcher -> I have removed that file and implemented those methods inside BindableTestAdapter. I was getting stuck at two points.
So, I have added two methods inside |
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 @rt4914. I ran out of time to deep dive this PR, but could you move the test utilities you're using in BindableAdapterTest to a shared location for all tests to use? Prefer not having one test depend on another.
app/src/main/java/org/oppia/app/topic/questionplayer/QuestionPlayerActivity.kt
Outdated
Show resolved
Hide resolved
Please reassign to me once the requested refactor is completed. |
@BenHenning I am actually confused what you mean here? My interpretation: I should move the If this is the case, I had actually done that only earlier by introducing the RecyclerViewMatcher file. oppia-android/app/src/sharedTest/java/org/oppia/app/recyclerview/RecyclerViewMatcher.kt Line 11 in f863f6e
|
@BenHenning I tried using Because of these reasons, I have created one new file which we can use for recyclerview testing, i.e., |
@BenHenning This PR is ready for your review. |
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 @rt4914! If the tests are passing, this looks reasonable to me. I found one potential issue with some of the new tests around configuration changes, but other than that the PR LGTM. Feel free to submit once the comments are resolved.
app/src/sharedTest/java/org/oppia/app/topic/train/TopicTrainFragmentTest.kt
Outdated
Show resolved
Hide resolved
fun testTopicTrainFragment_loadFragment_selectSkills_configurationChange_skillsAreSelected() { | ||
activityTestRule.launchActivity(null) | ||
onView(atPosition(R.id.skill_recycler_view,0)).perform(click()) | ||
activityTestRule.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE |
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 don't believe this is sufficient for a configuration change. Suggest instead: ActivityScenario.recreate()
Ditto elsewhere for configuration changes.
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 means I have add this or do I have to remove the current line and replace this one?
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.
Using both and merge code for now, because the test-cases passes in all possible combinations, using current code only, using your code only and using both.
Merging this code after making all suggested changes. |
Explanation
Replicated from #197
Part 1: #200
Part 2: #202
Part 3: #203
Part 4: Contains test case for TopicTrainFragment
Mock: https://xd.adobe.com/spec/e2239cf4-9cde-4c08-5296-25316c1f0a14-9412/screen/f403add1-079a-4202-9975-efe04c076290/Home-Page-1-Start-Learning-Pre-Scroll-6
Checklist