oppia-android icon indicating copy to clipboard operation
oppia-android copied to clipboard

Refactor previous code for testing orientation changes with the custom function written for it [Blocked on Landscape mode]

Open PrarabdhGarg opened this issue 5 years ago • 24 comments

There are a lot of test files that use the espresso methods directly to change orientation while testing the app, even though a custom method exists for the same. Basically there are different types of orientation change related test cases, which have bee implemented in different ways. But we need all of them to be consistent and all of them should use only orientationLandscape() function to do orientation change.

The file that needs refactoring are:

  • [x] TopicPracticeFragmentTest.kt
  • [ ] InputInteractionViewTestActivity.kt
  • [x] StateFragmentTest.kt
  • [x] AudioFragmentTest.kt
  • [x] ConceptCardFragmentTest.kt
  • [x] TopicLessonsFragmentTest.kt
  • [x] TopicReviewFragmentTest.kt
  • [x] TopicInfoFragmentTest.kt

PrarabdhGarg avatar Feb 21 '20 12:02 PrarabdhGarg

@rt4914 can I work on this after my current issue is solved?

PrarabdhGarg avatar Feb 21 '20 12:02 PrarabdhGarg

@PrarabdhGarg Nice pick. You can definitely work on this. But I have an alternate proposal too. Because you know this solution very well, can we assign this task to someone new and you can guide them to finish this, similar to what you and me are doing right now. How does this sound?

rt4914 avatar Feb 21 '20 12:02 rt4914

Perfect. I would love to do that

PrarabdhGarg avatar Feb 21 '20 13:02 PrarabdhGarg

Perfect. I would love to do that

Great. Then we will assign it to someone new.

rt4914 avatar Feb 21 '20 13:02 rt4914

@PrarabdhGarg Nice pick. You can definitely work on this. But I have an alternate proposal too. Because you know this solution very well, can we assign this task to someone new and you can guide them to finish this, similar to what you and me are doing right now. How does this sound?

cc @seanlip

rt4914 avatar Feb 21 '20 16:02 rt4914

@PrarabdhGarg @rt4914 what exactly should we do in this?? i would like to work on this

chrk2205 avatar Mar 04 '20 18:03 chrk2205

@PrarabdhGarg @rt4914 what exactly should we do in this?? i would like to work on this

Currently we cannot work on this as the title suggests that it is blocked on landscape mode.

rt4914 avatar Mar 05 '20 07:03 rt4914

@PrarabdhGarg @rt4914 what exactly should we do in this?? i would like to work on this

Also, checkout our wiki first. This will help you in setting up the project and once you sign the CLA and fill the survey form we can assign you issues to work on.

rt4914 avatar Mar 05 '20 07:03 rt4914

@rt4914
I already signed the CLA and set my project up.

chrk2205 avatar Mar 05 '20 07:03 chrk2205

@rt4914 I already signed the CLA and set my project up.

You haven't filled the survey form. Please fill that too.

rt4914 avatar Mar 05 '20 07:03 rt4914

Sorry, Done. @rt4914

chrk2205 avatar Mar 05 '20 08:03 chrk2205

Assigned to @chrk2205

rt4914 avatar Mar 05 '20 08:03 rt4914

@chrk2205 has your doubt been resolved, or do you still have some doubt in this issue?

PrarabdhGarg avatar Mar 05 '20 09:03 PrarabdhGarg

@PrarabdhGarg All I have to do is override Oncofiguration method and call orientation landscape method . Is it? Did I miss something ?? Thanks

chrk2205 avatar Mar 05 '20 09:03 chrk2205

@chrk2205 you don't have to override anything. You have to replace activityScenario.onActivity { activity -> activity.requestedOrientation = Configuration.ORIENTATION_LANDSCAPE } code with the custom defined orientationLandscape() function, as used in ConceptCardFragmentTest.kt

PrarabdhGarg avatar Mar 05 '20 09:03 PrarabdhGarg

@chrk2205 I think this PR will create issues for you based on the other PRs which are in progress right now. I will be assigning you one new issue to get started.

rt4914 avatar Mar 05 '20 10:03 rt4914

@rt491 okay.

chrk2205 avatar Mar 05 '20 10:03 chrk2205

@rt4914 my first PR just got accepted and merged.

Can I work on this as my second?

misterjedu avatar Oct 12 '20 19:10 misterjedu

@rt4914 my first PR just got accepted and merged.

Can I work on this as my second?

@misterjedu Assigned.

rt4914 avatar Oct 13 '20 06:10 rt4914

@rt4914 and @BenHenning , I just checked all the files listed above and it seems they've already been fixed a long time ago. The orientationLandscape() function is already being used to change orientation while testing the app.

misterjedu avatar Oct 16 '20 20:10 misterjedu

@rt4914 and @BenHenning , I just checked all the files listed above and it seems they've already been fixed a long time ago. The orientationLandscape() function is already being used to change orientation while testing the app.

@misterjedu Thanks for checking. I think only InputInteractionViewTestActivity file needs changes for this issue to get completed. But all those test cases are ignored as of now.

Also, it has been mentioned in the title that it is blocked on landscape mode. I will deassign this issue as of now. Thanks.

rt4914 avatar Oct 19 '20 09:10 rt4914

@rt4914, what does it mean for this issue to be blocked on landscape mode? It has been a while; has the status changed, and can we now assign someone to work on this?

adhiamboperes avatar Mar 13 '23 14:03 adhiamboperes

@adhiamboperes it's been a while since I've thought about this issue, but I suspect it's at least blocked by #2572 (and in fact it appears that PR was planned to address this issue). It's a bit tough to wrap up that work which is why I haven't been able to get back to it.

BenHenning avatar Mar 24 '23 02:03 BenHenning

Thanks @BenHenning. We'll leave this in the backlog for now.

adhiamboperes avatar Mar 24 '23 11:03 adhiamboperes