Skip to content
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 OnboardingFragmentTest for Robolectric #1873

Closed
Sarthak2601 opened this issue Sep 23, 2020 · 4 comments · Fixed by #2482
Closed

Fix OnboardingFragmentTest for Robolectric #1873

Sarthak2601 opened this issue Sep 23, 2020 · 4 comments · Fixed by #2482
Assignees
Labels
Priority: Essential This work item must be completed for its milestone. Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@Sarthak2601
Copy link
Contributor

Sarthak2601 commented Sep 23, 2020

Currently, the tests in OnboardingFragmentTest are passing on Espresso but they should also pass on Robolectric. Fix this file to make sure that the tests pass on Robolectric.

You can run robolectric tests by following these steps: https://github.com/oppia/oppia-android/wiki/Oppia-Android-Testing#running-roboelectric-tests

Fixing test cases will need to introduce TextApplicationComponent. This can be seen here.

@Sarthak2601 Sarthak2601 added Priority: Essential This work item must be completed for its milestone. SLoP 2020 labels Sep 23, 2020
@Sarthak2601 Sarthak2601 added this to the Beta milestone Sep 23, 2020
@BenHenning
Copy link
Member

@Sarthak2601 & @rt4914 I suggest splitting these to be per-test for better parallelization. Also, please make the titles consistent with the work being done--at the moment it's a bit difficult to find specifics about the issue from the title itself.

@Sarthak2601 Sarthak2601 changed the title Fix app module tests for Robolectric Fix OnboardingFragmentTest for Robolectric Sep 24, 2020
@Sarthak2601
Copy link
Contributor Author

@Sarthak2601 & @rt4914 I suggest splitting these to be per-test for better parallelization. Also, please make the titles consistent with the work being done--at the moment it's a bit difficult to find specifics about the issue from the title itself.

Done.

@prayutsu
Copy link
Contributor

prayutsu commented Oct 8, 2020

@MohamedMedhat1998 I want to work on this

@prayutsu
Copy link
Contributor

prayutsu commented Jan 13, 2021

@anandwana001 Actually, I was working on the PR and I was waiting for your or @rt4914 response on it. I was a bit stucked so can you please help me here?

rt4914 pushed a commit that referenced this issue Feb 3, 2021
* fixed one test

* fix 4 remaining tests

* try fixing tests bu introducing scrollview

* tried adding scrollview

* fix AndroidManifest.xml

* fix nit

* fix basic set of tests

* fixed 3 failing tests

* removed extra changes

* removed extra changes

* try fixing tests with testCoroutineDispatchers

* try advancedUntilIdle()

* tried migrating to viewpager2

* tried implementing new methods

* Replace ViewPager with ViewPager2

* Add ignore annotations

* fix lint

* add dependencies to BUILD.bazel

* remove unnecessary ignore annotations

* fix lint

* fix lint

* fix lint

* fix lint error

* remove redundant lines

* Fix Viewpager2 regressions

* Fix lint errors.

* Remove comments

* Fix all test cases on Robolectric

* Try fixing flakiness in espresso

* Revert "Try fixing flakiness in espresso"

This reverts commit 2151c45

* Replace isDisplayed() with isCompletelyDisplayed()

* Fix suggested changes

* Try fixing test cases by using isADescendantOf()

* Revert changes

* Try stabilizing ttion est cases by changing configuration

* Revert last commit to remove unwanted configuration changes

* Fix ktlint error

* Try adding custom ViewMatcher

* Add custom ViewMatcher

* Add custom ViewAction for scrolling ViewPager pages

* Disable smooth scrolling to fix test cases

* Remove holder.setIsRecycleable(false) and optimise perform()

* Remove unnecessary id of constraintLayout in onboarding_slide.xml

* Replace advancedUntilIdle bu runCurrent wherever applicable

* Remove unnecessary delay

* Add argument comment for smoothScroll

* Add a space after argument comment

* Fix suggested changes.
@BenHenning BenHenning added the Z-ibt Temporary label for Ben to keep track of issues he's triaged. label Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Essential This work item must be completed for its milestone. Z-ibt Temporary label for Ben to keep track of issues he's triaged.
4 participants