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

Refactored test cases, added system test watcher to prevent ANR

Open gouri-panda opened this issue 3 years ago • 9 comments

Fixes #2928

gouri-panda avatar Aug 04 '22 15:08 gouri-panda

Codecov Report

Merging #2937 (d261150) into develop (5ae578a) will decrease coverage by 10.83%. The diff coverage is 0.00%.

:exclamation: Current head d261150 differs from pull request most recent head 0aeba46. Consider uploading reports for the commit 0aeba46 to get more accurate results

@@              Coverage Diff               @@
##             develop    #2937       +/-   ##
==============================================
- Coverage      44.70%   33.87%   -10.84%     
  Complexity        25       25               
==============================================
  Files            299      299               
  Lines           9496     9498        +2     
  Branches         972      974        +2     
==============================================
- Hits            4245     3217     -1028     
- Misses          4836     5967     +1131     
+ Partials         415      314      -101     
Impacted Files Coverage Δ
...kiwix/kiwixmobile/core/utils/dialog/KiwixDialog.kt 26.06% <0.00%> (ø)
...va/org/kiwix/kiwixmobile/help/KiwixHelpFragment.kt 0.00% <0.00%> (-100.00%) :arrow_down:
...ava/org/kiwix/kiwixmobile/core/help/HelpAdapter.kt 0.00% <0.00%> (-100.00%) :arrow_down:
...va/org/kiwix/kiwixmobile/core/utils/UpdateUtils.kt 0.00% <0.00%> (-100.00%) :arrow_down:
.../org/kiwix/kiwixmobile/di/modules/ServiceModule.kt 0.00% <0.00%> (-100.00%) :arrow_down:
.../kiwix/kiwixmobile/core/search/SearchSuggestion.kt 0.00% <0.00%> (-100.00%) :arrow_down:
...kiwix/kiwixmobile/core/extensions/UriExtensions.kt 0.00% <0.00%> (-100.00%) :arrow_down:
...ix/kiwixmobile/language/adapter/LanguageAdapter.kt 0.00% <0.00%> (-100.00%) :arrow_down:
...x/kiwixmobile/core/page/history/HistoryFragment.kt 0.00% <0.00%> (-100.00%) :arrow_down:
...x/kiwixmobile/core/search/adapter/SearchAdapter.kt 0.00% <0.00%> (-100.00%) :arrow_down:
... and 82 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 04 '22 16:08 codecov[bot]

hi @gouri-panda , is this PR is ready for review ?

MohitMaliFtechiz avatar Aug 05 '22 06:08 MohitMaliFtechiz

@MohitMaliFtechiz Yes :)

gouri-panda avatar Aug 05 '22 07:08 gouri-panda

hi @gouri-panda , coverage reporting is failing on both can you please take a look at it.

MohitMaliFtechiz avatar Aug 05 '22 09:08 MohitMaliFtechiz

@MohitMaliFtechiz After #2933 i hope it will stable.

gouri-panda avatar Aug 05 '22 09:08 gouri-panda

Hi @gouri-panda , Test failing reason is you forgot to paas drawer id and gravity to openDrawer() Method. https://github.com/kiwix/kiwix-android/blob/bb661551134b38de3a6ce712a2c6dfe22c42f168/app/src/androidTest/java/org/kiwix/kiwixmobile/main/TopLevelDestinationRobot.kt#L74

As you change parameters here. https://github.com/kiwix/kiwix-android/blob/bb661551134b38de3a6ce712a2c6dfe22c42f168/app/src/androidTest/java/org/kiwix/kiwixmobile/utils/StandardActions.java#L46

MohitMaliFtechiz avatar Aug 05 '22 10:08 MohitMaliFtechiz

hi @gouri-panda ,

There were 19 test which were executed before this implementation now only 14 test are running , some of test like TopLevelDestination and other are not executing can you look at it.

MohitMaliFtechiz avatar Aug 08 '22 09:08 MohitMaliFtechiz

@MohitMaliFtechiz Some network tests are skipping because in our CI no cellular provider there.

gouri-panda avatar Aug 08 '22 11:08 gouri-panda

@MohitMaliFtechiz Some network tests are skipping because in our CI no cellular provider there.

hi @gouri-panda , All test which are extended by BaseActivityTest is not running so this might not due to network issue. Please check and if you comment

fun setUpBeforeClass() {
    uiDevice = UiDevice.getInstance(getInstrumentation())
    registerANRWatcher()
  } 

this function's all test were running , please take a look at it.

MohitMaliFtechiz avatar Aug 08 '22 12:08 MohitMaliFtechiz

@MohitMaliFtechiz Can you please review again this PR?

kelson42 avatar Aug 12 '22 07:08 kelson42

hi @gouri-panda please fix the coverage reporting , i think you are still working on this please mark it as draft.

MohitMaliFtechiz avatar Aug 12 '22 09:08 MohitMaliFtechiz

I'm closing this issue. It's better to have two PRs.

gouri-panda avatar Aug 23 '22 13:08 gouri-panda