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

Add thorough tests for the question player

Open BenHenning opened this issue 5 years ago • 8 comments

Similar to #388 we need thorough tests for the question player once these can be written in a reliable way for both Espresso & Robolectric.

Test reference: https://github.com/oppia/oppia-android/blob/develop/app/src/sharedTest/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerActivityTest.kt

BenHenning avatar Dec 02 '19 00:12 BenHenning

Enough of #89 is now complete that this is no longer blocked.

BenHenning avatar Sep 24 '20 03:09 BenHenning

@anandwana001 I would like to work on this

chrk2205 avatar Feb 02 '21 07:02 chrk2205

@chrk2205 assigned to you. Few points to get start:

  1. Write down all the edges case which needs to get tested.
  2. Don't include end to end test, example like opening and activity and the checking any view. Robolectric doesn't support end to end test.
  3. All the test should pass on both espresso and robolectric

How you can send a pr for this:

  1. After writing all the points what we need to test, create a comment block in the test file and write the test names and send for review
  2. Once above reviewed, you can write test cases.

Let me know if you need any help in this.

anandwana001 avatar Feb 02 '21 07:02 anandwana001

there are some test cases already present in the QuestionPlayerActivityTest.kt Do I need to write test cases apart from them ?? @anandwana001 thanks

chrk2205 avatar Feb 03 '21 16:02 chrk2205

@anandwana001 for test cases should I include this??

  • OnBackPressed and its respective cases
  • toolbar title display

thanks

chrk2205 avatar Feb 03 '21 19:02 chrk2205

Yes, for both comments above

anandwana001 avatar Feb 03 '21 21:02 anandwana001

@anandwana001 Is this issue still needed to be fixed?

ayush0402 avatar Jan 11 '22 08:01 ayush0402

@ayush0402 yes. There's no dedicated test suite for questions currently. We have a few tests in QuestionPlayerActivityTest, but what we really need are QuestionPlayerFragmentLocalTest and QuestionPlayerFragmentTest akin to StateFragmentLocalTest and StateFragmentTest, respectively, that test various interaction & hint scenarios for questions.

BenHenning avatar Jan 14 '22 21:01 BenHenning