-
Notifications
You must be signed in to change notification settings - Fork 511
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 #935: Optimised test cases for HDPI devices #942
Conversation
app/src/sharedTest/java/org/oppia/app/settings/profile/ProfileEditActivityTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/app/settings/profile/ProfileEditActivityTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/app/topic/revision/TopicRevisionFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/app/topic/revision/TopicRevisionFragmentTest.kt
Outdated
Show resolved
Hide resolved
@rt4914 I have just added the comments so as to bring them to your attention. Otherwise, all the test are completely compatible now with |
@NullByte08 I ran all test cases at once. And here are some details regarding to that.
This issue is sort of a mini project as it was known that it will have multiple changes. Thanks a lot for working on this as it is an important issue. |
…pi-compatible-testing
@rt4914 Please review. I have run all the test files individually and all at once also. All tests are successful. |
@NullByte08 Please don'e forget to assign it to correct reviewer, because the assign section was containing your name, I though that you are still working on this. |
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.
There are still some test cases which are failing and we never use SystemClock.sleep(1000)
.
Actually the best approach to finish this PR soon is to split this PR into 3-4 different PRs and making sure that 4-5 packages are fixed in each PR.
@@ -86,4 +86,8 @@ class ProfileEditActivityPresenter @Inject constructor( | |||
private fun getProfileEditViewModel(): ProfileEditViewModel { | |||
return viewModelProvider.getForActivity(activity, ProfileEditViewModel::class.java) | |||
} | |||
|
|||
fun handleOnRestoreSavedInstanceState(){ | |||
activity.title=editViewModel.profileName |
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.
Nit: activity.title = editViewModel.profileName
@@ -161,6 +161,8 @@ class HomeActivityTest { | |||
getApplicationDependencies() | |||
oppiaClock.setCurrentTimeMs(MORNING_TIMESTAMP) | |||
launch<HomeActivity>(createHomeActivityIntent(internalProfileId)).use { | |||
onView(withId(R.id.home_recycler_view)).perform(scrollToPosition<RecyclerView.ViewHolder>(0)) | |||
|
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.
Remove this blank line
@@ -117,7 +120,8 @@ class PinPasswordActivityTest { | |||
userId | |||
) | |||
).use { | |||
onView(withId(R.id.input_pin)).perform(typeText("123")) | |||
onView(withId(R.id.input_pin)).perform(typeText("123"), closeSoftKeyboard()) | |||
SystemClock.sleep(1000) |
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.
We never use this because this sleep can actually hide the actual issue that might be happening in PR.
@@ -283,6 +289,7 @@ class PinPasswordActivityTest { | |||
onView(withText(context.getString(R.string.admin_settings_submit))).perform(click()) | |||
onView(withText(context.getString(R.string.pin_password_close))).perform(click()) | |||
onView(withId(R.id.input_pin)).perform(typeText("321")) | |||
SystemClock.sleep(1000) |
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. Remove this.
Explanation
Fix #935All the test cases except for
player
package now run and pass successfully on HDPI devices too as required by the issue. I used theNexus S
emulator.Checklist