apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Failure of uploadCancelledAfterLocationPickedTest and testBetaSkipButton

Open nicolas-raoul opened this issue 2 years ago β€’ 9 comments

Not too sure what it is, but I see some unit tests failing in CI:

https://github.com/commons-app/apps-android-commons/actions/runs/6582881080/job/17885059535#step:8:458

fr.free.nrw.commons.UploadCancelledTest > uploadCancelledAfterLocationPickedTest[test(AVD) - 7.0] FAILED 
	androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (view.getId() is <2131296394/fr.free.nrw.commons.beta:id/caption_item_edit_text> and Child at position 0 in parent Child at position 0 in parent view.getId() is <2131296395> and (view has effective visibility <VISIBLE> and view.getGlobalVisibleRect() to return non-empty rectangle))
	
fr.free.nrw.commons.UploadTest > testUploadWithMultilingualDescription[test(AVD) - 7.0] SKIPPED 

fr.free.nrw.commons.UploadTest > testUploadWithoutDescription[test(AVD) - 7.0] SKIPPED 

fr.free.nrw.commons.UploadTest > testUploadWithDescription[test(AVD) - 7.0] SKIPPED 

fr.free.nrw.commons.WelcomeActivityTest > testBetaSkipButton[test(AVD) - 7.0] FAILED 
	java.lang.AssertionError: Assertion failed
	at fr.free.nrw.commons.WelcomeActivityTest.testBetaSkipButton(WelcomeActivityTest.kt:64)
Tests on test(AVD) - 7.0 failed: There was 2 failure(s).

https://github.com/commons-app/apps-android-commons/pull/5354/files might be a source of inspiration to fix these tests.

nicolas-raoul avatar Oct 20 '23 04:10 nicolas-raoul

Can I have a try on it?

MatheuMa avatar Oct 20 '23 10:10 MatheuMa

@MatheuMa It is yours, thanks! πŸ™‚

nicolas-raoul avatar Oct 20 '23 11:10 nicolas-raoul

@MatheuMa Any progress to share? :-)

nicolas-raoul avatar Jan 13 '24 13:01 nicolas-raoul

It's been long, but I'm finally able to run these tests after factory resetting my phone. testBetaSkipButton is running fine on my device, uploadCancelledAfterLocationPickedTest is getting affected by #5461. The list does not open on tapping the list icon at the top-right corner of Nearby.

RitikaPahwa4444 avatar Jan 21 '24 13:01 RitikaPahwa4444

With the PR for #5461, I'm able to reproduce this issue for uploadCancelledAfterLocationPickedTest. I would like to give this a try if no one is currently working on it.

RitikaPahwa4444 avatar Feb 03 '24 04:02 RitikaPahwa4444

With the PR for #5461, I'm able to reproduce this issue for uploadCancelledAfterLocationPickedTest. I would like to give this a try if no one is currently working on it.

You could feel free to proceed, Ritika πŸ™‚

sivaraam avatar Feb 03 '24 11:02 sivaraam

@RitikaPahwa4444 Do you know the status of this? Thanks a lot! :-)

nicolas-raoul avatar Aug 20 '24 07:08 nicolas-raoul

Hey @nicolas-raoul, sorry for keeping this pending for such a long timeπŸ˜” I was waiting for another PR to get merged (the one on which my PR is dependent) but when I got back to it and checked the CI, many more similar instrumentation tests were failing. I was expecting the ones in this issue to get fixed after including location permission and dialog checks for Nearby's picker but now I feel this requires deeper analysis to figure out the root cause (these are very much dependent on the device - they run fine on one of my devices but not the other). I'm bit busy this week and might not find enough time to take a look. I'll remove my assignment for now

RitikaPahwa4444 avatar Aug 20 '24 14:08 RitikaPahwa4444

More details about the tests that are failing now on the latest main branch:

fr.free.nrw.commons.MainActivityTest > testExplore[test(AVD) - 7.0] FAILED 
	androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (Child at position 2 in parent Child at position 0 in parent view.getId() is <2131296627/fr.free.nrw.commons.beta:id/fragment_main_nav_tab_layout> and (view has effective visibility <VISIBLE> and view.getGlobalVisibleRect() to return non-empty rectangle))
	

fr.free.nrw.commons.MainActivityTest > testBookmarks[test(AVD) - 7.0] FAILED 
	androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (Child at position 3 in parent Child at position 0 in parent view.getId() is <2131296627/fr.free.nrw.commons.beta:id/fragment_main_nav_tab_layout> and (view has effective visibility <VISIBLE> and view.getGlobalVisibleRect() to return non-empty rectangle))
	

fr.free.nrw.commons.MainActivityTest > testNotifications[test(AVD) - 7.0] FAILED 
	androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (view.getId() is <2131296957/fr.free.nrw.commons.beta:id/notifications> and Child at position 1 in parent Child at position 1 in parent view.getId() is <2131297216> and (view has effective visibility <VISIBLE> and view.getGlobalVisibleRect() to return non-empty rectangle))
	

fr.free.nrw.commons.MainActivityTest > testNearby[test(AVD) - 7.0] FAILED 
	androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (Child at position 1 in parent Child at position 0 in parent view.getId() is <2131296627/fr.free.nrw.commons.beta:id/fragment_main_nav_tab_layout> and (view has effective visibility <VISIBLE> and view.getGlobalVisibleRect() to return non-empty rectangle))
	

fr.free.nrw.commons.MainActivityTest > testContributions[test(AVD) - 7.0] FAILED 
	androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (Child at position 0 in parent Child at position 0 in parent view.getId() is <2131296627/fr.free.nrw.commons.beta:id/fragment_main_nav_tab_layout> and (view has effective visibility <VISIBLE> and view.getGlobalVisibleRect() to return non-empty rectangle))
	

fr.free.nrw.commons.ProfileActivityTest > testProfile[test(AVD) - 7.0] FAILED 
	androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (view.getContentDescription() is "More" and Child at position 4 in parent Child at position 0 in parent view.getId() is <2131296627> and (view has effective visibility <VISIBLE> and view.getGlobalVisibleRect() to return non-empty rectangle))
	

fr.free.nrw.commons.ReviewActivityTest > orientationChange[test(AVD) - 7.0] FAILED 
	java.lang.NullPointerException: Attempt to read from field 'androidx.appcompat.widget.Toolbar fr.free.nrw.commons.databinding.ToolbarBinding.toolbar' on a null object reference
	at fr.free.nrw.commons.review.ReviewActivity.onCreate(ReviewActivity.java:89)
Tests on test(AVD) - 7.0 failed: There was 7 failure(s).
Test run failed to complete. Instrumentation run failed due to Process crashed.

> Task :app:connectedBetaDebugAndroidTest FAILED

RitikaPahwa4444 avatar Sep 14 '24 06:09 RitikaPahwa4444