Closed adhiamboperes closed 2 months ago
@BenHenning, PTAL.
@adhiamboperes is it possible to add tests for any of the discovered user-facing problems?
@adhiamboperes is it possible to add tests for any of the discovered user-facing problems?
@BenHenning, I have added some UI tests and updated the PR description.
@BenHenning, PTAL.
Hi @adhiamboperes, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks!
Resolved all comments as fixed and enabling auto merge.
Explanation
I found out during testing that there is an underlying gating DataProvider update behavior that occurs because of the way I initially designed the survey popup behaviour:
I mitigated this by removing the observer once the initial gating result has been received and processed.
Tests
I added tests that test survey gating based on changes in the time criterion, while other gating criteria remains constant/fulfilled. Exhaustive gating tests were added in the SurveyGatingController.
I also made a change in the
StateFragmentTest
that unregisters the idling resource after initializing profiles instead of at the end of the test runs. Previously,StateFragmentTest
would not run locally and fail with the error:This was caused by registering an idling resource before test begins, then when the activity starts, the main thread becomes busy. Generally, the test will continue when the main thread becomes idle, but the idling resource now blocks it and does not call onTransitionToIdle(). So it will always time out. Unregistering the idling resource before the activity starts frees up the main thread.
Disabled running on Robolectric due to known issue with Drag and Drop interaction.
Espresso Run Screenshot![Screenshot 2024-03-13 at 19 35 12](https://github.com/oppia/oppia-android/assets/59600948/72d8aee9-f39d-4d26-92a9-72fb0919d46c)
Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then: