-
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 #678 : Landscape onBoarding workflow #698
Conversation
@rt4914 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.
app/src/main/java/org/oppia/app/onboarding/OnboadingSlideViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/onboarding/OnboadingSlideViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/onboarding/OnboadingSlideViewModel.kt
Outdated
Show resolved
Hide resolved
Actually, I wanted to discuss this with you. The thing here is that we have the constraint layout with the skip button and the dots at the bottom in the fragment and the slide gets loaded in the view pager above that. As the slides load in the view pager it can't be continued till the end because of the presence of the another constraint layout. |
@Sarthak2601 what you could do for that is that instead of constraining the bottom of the viewpager with the top of the bottom container, you could constraint it with the bottle of the parent. That would give it the necessary overlap required. |
Oh yes, found that. Thank you so much @PrarabdhGarg :-) |
Updated the positioning of the get started button in accordance with the mock. @rt4914 Kindly 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.
@Sarthak2601 Looks good, thanks.
Update the title of this PR: Fix #678: Landscape onBoarding workflow
Also, now we can focus on test cases.
Check OnboardingFragmentTest
in this you will find a lot of test cases for portrait mode. In this file you will need add following test cases for orientation mode.
- Rotate to orientation mode, check slide_0 title, if this is correct or not.
- In portrait mode, move to slide_1 , change to landscape mode and now check if the title is correct or not.
- In portrait mode, click on skip, change to landscape mode and now check the title is same as last slide title or not.
Regarding how to change to orientation landscape in a test case, you can see test cases in AdminAuthActivityTest
Okay, I will work on it 👍 |
-Added test cases @rt4914, 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.
Some small changes suggested.
app/src/sharedTest/java/org/oppia/app/onboarding/OnboardingFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/app/onboarding/OnboardingFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/app/onboarding/OnboardingFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/app/onboarding/OnboardingFragmentTest.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.
These 3 test cases are failing.
Update them as following:
@Test
fun testOnboardingFragment_slide0title_inlandscape_iscorrectornot() {
launch(OnboardingActivity::class.java).use {
onView(isRoot()).perform(orientationLandscape())
onView(
allOf(
withId(R.id.slide_title_text_view),
isCompletelyDisplayed()
)
).check(matches(withText(R.string.onboarding_slide_0_title)))
}
}
@Test
fun testOnboardingFragment_movetoslide1_changeorientation_checktitle() {
launch(OnboardingActivity::class.java).use {
onView(withId(R.id.onboarding_slide_view_pager)).perform(scrollToPage(1))
onView(isRoot()).perform(orientationLandscape())
onView(
allOf(
withId(R.id.slide_title_text_view),
isCompletelyDisplayed()
)
).check(matches(withText(R.string.onboarding_slide_1_title)))
}
}
@Test
fun testOnboardingFragment_clickonskip_changeorientation_checktitle() {
launch(OnboardingActivity::class.java).use {
onView(withId(R.id.skip_text_view)).perform(click())
onView(isRoot()).perform(orientationLandscape())
onView(
allOf(
withId(R.id.slide_title_text_view),
isCompletelyDisplayed()
)
).check(matches(withText(R.string.onboarding_slide_3_title)))
}
}
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.
Thank you so much ! |
No worries. I will mostly assign you some new tasks to work on tomorrow. |
Sounds great ! |
Explanation
Screenshots -
Checklist