7389 Commits

Author SHA1 Message Date
MohitMaliFtechiz
29287df550 Improved ObjectBoxToLibkiwixMigratorTest and clearing the application data before running the test cases. 2024-03-19 20:57:26 +05:30
MohitMaliFtechiz
39930b844e Fixed the WebView using from more than one process at once with the same data directory is not supported. 2024-03-18 20:20:54 +05:30
MohitMaliFtechiz
2a0b392b13 Fixed the WebView using from more than one process at once with the same data directory is not supported. 2024-03-18 18:39:32 +05:30
MohitMaliFtechiz
3ae2793949 Added the 'testDirectory' to our scanning process, as on API level 33, the app-specific path is occasionally treated as READ_ONLY. Additionally, for certain test cases where we need to load the zim file in the LocalLibraryScreen, we've included the test directory in our scanning process, as it will be automatically handled by the OS. 2024-03-18 16:43:56 +05:30
MohitMaliFtechiz
efb1d8e2e3 Changed the Timeout to 20 second instead of 40 seconds.
* Improved the functionality of closing dialog where any system dialog is visible on the window.
2024-03-18 15:42:04 +05:30
MohitMaliFtechiz
52159608e5 Added timeout for waiting for the idle state of emulator since by default it has 10 second but the API level 33 emulator is heavy and takes more time to become idle so we have increased the timeout to properly come in the idle state. 2024-03-18 13:25:56 +05:30
MohitMaliFtechiz
9d79e4b515 Improved the filePath for creating temp files in our test cases since sometimes the emulator treats app-specific directory as READ_ONLY_FILESYSTEM. 2024-03-18 13:18:18 +05:30
MohitMaliFtechiz
e1c69aa259 Restricting testExtractDocumentId and testDocumentProviderContentQuery test cases on API level 33 since numerous security updates have been included, preventing us from modifying the default behavior of ContentResolver. So running the test case on this APi level leads to test failure. 2024-03-16 20:06:30 +05:30
MohitMaliFtechiz
dbbd02b08b Re-enabling the CI on API level 24 and 30 2024-03-16 19:47:18 +05:30
MohitMaliFtechiz
9107c4a10d Added buildToolVersion 33.0.1 for better emulator performance on CI. 2024-03-15 23:33:12 +05:30
MohitMaliFtechiz
df59ed19a3 Improved the ObjectBoxToLibkiwixMigratorTest test case, as it occasionally crashes during testing on API level 33 due to emulator lag on google_apis. The extensive data migration exacerbates the emulator's performance issues, leading to crashes during subsequent test processes. To address this issue, we have reduced the migration volume from 10K to 1K.
* Increased the disk size of API level 33 emulator since emulator is crashing on this api level while performing the test cases so it might require more resource to run smoothly.
* Clearing the previous installed application data when launching the test cases for the first time to properly run the test cases.
* Removed the enabling wifi for adb as it is unused now because sometimes API level 33 emulator does not have the wifi, and we have introduced this for API level 33 emulator.
* Removed the APK sharing in test cases since if a text case fails it crashed all the test cases even we re-run that test case in second run.
2024-03-15 23:27:52 +05:30
MohitMaliFtechiz
0d6d76b5db Increased retry count to 5 for flaky test cases on API level 33, where failures occurred multiple times due to the heavy google_apis. so to address this we have increased it to 5 to properly run the test cases.
* We are removing the `ZimHostFragment` test from the API level 33 because, most of the time, the emulator does not have WiFi service. Running this test on this emulator is not worthwhile, as we are testing this code on WiFi.
2024-03-15 12:19:16 +05:30
MohitMaliFtechiz
f0eb680d21 Added Notification permission in our test cases for API level 33.
* Improved our `ZimHostFragmentTest` test to boost the test case speed. It was running in 2 minutes, but after this change, it now completes in 27 seconds.
2024-03-15 12:19:09 +05:30
MohitMaliFtechiz
bfdf5c6e88 Improved ObjectBoxToLibkiwixMigratorTest for clearing the previous saved bookmarks.
* Refresh the data before checking the loaded data in DownloadTest.
* Increasing the Retry count for loading data and downloading start to properly work with low internet connection.
2024-03-15 12:19:01 +05:30
MohitMaliFtechiz
91b9f955d8 Using uiDevice.waitForIdle() method instead of BaristaSleepInteractions.sleep in our test cases. Because BaristaSleepInteractions.sleep runs everytime even the view is displaying on the screen which takes the extra time to run the test case, but now we are using uiDevice.waitForIdle() method which perform the further operation if desired view is already displaying otherwise wait for that view.
* Improved the deleting of zim files in localibrary, since we already pause for a second to check if the delete dialog is displayed or not, and again we are waiting before clicking on it. The same issue for while clicking on the PlayStoreRestrictionDialogTest where we are first waiting for the dialog to visible and then waiting for clicking on it. So we have removed the second wait since this dialog is displaying in both test cases.
* Improved the TopLevelDestinationTest. Because we were testing the drawer options fragments (Settings, Bookmarks etc) from the download screen and when we pressed the back button it came to the download screen and refreshed its data due to this our next functionality had to wait to finish this. Now we are testing all the navigation screens from the LocalLibraryScreen which makes this test case faster.
2024-03-15 12:18:54 +05:30
MohitMaliFtechiz
2808d5d63a Fixed: Speed up Automated Tests by sharing apks.
* Improved our CI to generate the test apk, we are using this in our all test cases.
* Added apk to `testInstrumentationRunnerArguments` option which takes the test apk when running the test cases.
2024-03-15 12:18:31 +05:30
Kelson
f7a34c1b42
Merge pull request #3743 from kiwix/Fix#3741
Fixed: After restoring the tab it hides a few area of the article from the top.
2024-03-14 07:25:00 +01:00
MohitMaliFtechiz
060e41096e Fixed: After restoring the tab it hides a few area of the article from the top.
* It was showing with the top margin we have set in `TabsAdapter` for not showing the top margin in tabs, and `tempWebViewForUndo` saved with that margin, so when we are showing this in our reader, it was showing with that margin. So to fix this we are removing this margin from the `tempWebViewForUndo` if `tabSwitcher` is not showing, for properly showing the webView content. If the tab switcher is showing it will work as before.
* Used the `safelyAddWebView` method when we were selecting the tab as this method is doing the same that we are doing in `selectTab` method so to reduce duplicate code we used this method.
2024-03-14 07:24:22 +01:00
Kelson
341ce65f7b
Merge pull request #3748 from kiwix/Fix#3746
Fixed: ZIM file is not deleting from LocalLibraryFragment if we do not have the storage permission in non-playstore variant, which is fine but it should ask permission.
2024-03-14 07:24:01 +01:00
MohitMaliFtechiz
b680b1afce Fixed: ZIM file is not deleting from LocalLibraryFragment if we do not have the storage permission in non-playstore variant, which is fine but it should ask permission.
* Added permission check when selecting the ZIM file to delete or share, which fixes this problem.
2024-03-14 07:23:25 +01:00
Kelson
c9f7b89d66
Merge pull request #3745 from Sagar0-0/develop
[Fix]: Read aloud will stop on close tab
2024-03-14 07:23:00 +01:00
Sagar
749530650c #3740 Read aloud will stop in closed tab 2024-03-13 21:25:33 +05:30
Sagar
cdf4a01b7d #3740 Read aloud will stop in closed tab 2024-03-12 20:21:19 +05:30
Sagar
e9768c69a7
Merge branch 'kiwix:main' into develop 2024-03-12 12:35:32 +05:30
Sagar
a1a03b2d57 #3740 Read aloud will stop in closed tab 2024-03-12 12:34:45 +05:30
Kelson
08face55e1
Merge pull request #3735 from kiwix/Fix#3734
Fixed: PlayStore reported an error for Encyclopédie médicale WikiMed app.
2024-03-11 07:45:43 +01:00
MohitMaliFtechiz
4169a79eaf Fixed: PlayStore reported an error for Encyclopédie médicale WikiMed app.
* Fixed where restarting app was not working on Android 11 and above.
2024-03-11 07:44:48 +01:00
Kelson
b678e69e9d
Merge pull request #3721 from kiwix/Fix#1270
Fixed: Lint Issue - Unconditional Logging.
2024-03-11 07:37:42 +01:00
MohitMaliFtechiz
8828a8b917 Fixed: Lint Issue - Unconditional Logging.
* Re-enabled the `LogConditional` lint check.
* Introduced a `Log` class that exclusively handles logging operations in the debug variant.
* Removed unnecessary `if (BuildConfig.DEBUG)` conditions from the project.
2024-03-11 11:46:17 +05:30
Kelson
fd20568841
Merge pull request #3733 from kiwix/Fix#3732
Fixed: Test cases are frequently failing on API level 33.
2024-03-10 17:44:36 +01:00
MohitMaliFtechiz
10e1022865 Improved the LibkiwixBookmarkTest, we are now opening the Bookmark screen via the navigation drawer instead of long clicking on the bottom_toolbar_bookmark button because sometimes the screen scrolls down and this button hides and our test case fails on API level 33.
* Improved the NoteFragmentTest. Sometimes it didn't find the `overFlowOptionMenu` since we immediately clicked on that menu while opening the readerFragment, and sometimes this menu was not shown, because it was preparing its data to show.
2024-03-09 19:39:13 +05:30
MohitMaliFtechiz
9fb5adb37a Added an condition for checking if any system dialog is visible method to handle all the dialog shown by the system. 2024-03-09 19:39:05 +05:30
MohitMaliFtechiz
606bea4405 Improved our instrumentation.sh bash script, if our test fails then after restarting the emulator if our application is installed we clear its cache data so that test cases will perform properly. We have made this change to fix a scenario that comes locally after testing so many times where downloading is stuck due to lag of emulator.
* * Improved the LibkiwixBookmarkTest. In this, before performing the test case we are removing the existing bookmarks if any so that the saved bookmark will not go outside the screen(We faced an occurrence of this type locally).
* Improved the ZIM file path in many scenarios so that the created ZIM file will show in the LocalLibraryScreen and we can delete it so that we can free up the memory.
2024-03-09 19:38:58 +05:30
MohitMaliFtechiz
d5305b6856 Improved the SearchFragmentTest that are sometimes failing on API level 30. 2024-03-09 19:38:51 +05:30
MohitMaliFtechiz
afaf1a487a Improved DownloadTest, InitialDownloadTest and ZimHostFragmentTest.
* Remove all the ZIM files showing in the LocalLibrary screen before performing the test operation, this will free up the memory and unwanted behaviour like if the any other ZIM file already contains in this screen then it can affect our these test cases.
2024-03-09 19:38:44 +05:30
MohitMaliFtechiz
291a063747 Fixed: Test cases are frequently failing on API level 33.
* Refreshed the ZIM files list before deleting/checking for downloaded ZIM files in `DownloadTest` and `InitialDownloadTest` because sometimes data doesn't show on the `LocalLibraryScreen` after downloading the ZIM file, leading to test failures.
* Hiding the `Storage Restriction` dialog in `LibkiwixBookTest` and `MimeTypeTest` to not show this dialog in these test cases.
* Improved the temporary ZIM file path in `NoteFragmentTest` to properly display the ZIM file in the LocalLibrary screen so that it can be deleted in our test case.
* Enhanced the loading of ZIM files in `LocalLibraryTest`.
2024-03-09 19:38:35 +05:30
Kelson
28945412f3
Merge pull request #3720 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2024-03-07 21:07:29 +01:00
translatewiki.net
4f5d66dbd7 Localisation updates from https://translatewiki.net. 2024-03-07 13:07:14 +01:00
Kelson
ec3d916508
Merge pull request #3713 from kiwix/Fix#3596
Added test cases for the search functionality.
2024-03-05 14:30:36 +01:00
MohitMaliFtechiz
49e7116781 Updated the ZIM file url for downloading the ZIM file.
* Refactored the search test according to this new ZIM file.
2024-03-05 13:47:04 +01:00
MohitMaliFtechiz
63acf5768a Added test cases for the search functionality.
* In this updated test case, we have addressed scenarios involving fast typing/deleting for search queries. Additionally, we implemented a test case where the user types with both short and long delays to ensure the following:
 1. Short delay: Properly tests the cancellation of the previously searching task.
 2. Long delay: Properly executes the search query letter by letter and ensures that there is no crash during the search.
* We are downloading the "stack exchange" ZIM file in our test case because this ZIM file yields many search results. Therefore, we download and perform all search operations on this file to simulate a real-world scenario, as our test ZIM file only contains three search results.
* The temporary ZIM file is deleted after performing the test to free up device storage.
2024-03-05 13:47:04 +01:00
Kelson
a1eae97278
Merge pull request #3729 from kiwix/Fix#3728
Fixed: The WiFi hotspot no longer starts automatically after granting notification permission in Android 13 and above.
2024-03-05 13:46:30 +01:00
MohitMaliFtechiz
b5c99ca583 Fixed: The WiFi hotspot no longer starts automatically after granting notification permission in Android 13 and above.
* We implemented the `registerForActivityResult` method to handle notification permission, ensuring the hotspot starts seamlessly upon permission grant.
* Improved the permission-asking scenario. Before it ask once for notification permission and at the second time it shows the custom dialog that shows why we need this permission. But we can ask permission twice in our application so we have improved the asking of permission. If the user denies this permission then we show the custom dialog with message why we need this permission.
2024-03-05 08:24:57 +01:00
Kelson
f483ff1392
Merge pull request #3725 from kiwix/Fix#2795
Fixed: [Bug] Pop-up Function does not work correctly (fails to automatically “detect” headword and show results).
2024-03-05 08:20:00 +01:00
MohitMaliFtechiz
0a8735cbb1 Fixed: [Bug] Pop-up Function does not work correctly (fails to automatically “detect” headword and show results).
* Fixed the scenario where "Search kiwix" on any text does not show the expected result. Because we were passing the activity's intent instead of the actual intent we are getting to open the search, which leads to unexpected results. So now we are passing the actual intent to process the request that fixes this issue.
*  Fixed one more scenario that occurred after placing this fix, where one more instance is created of the search screen because the activity has the intent with this type, and we are processing this intent in our `onViewCreated` for the scenario where our application launched(it is not running in the background). So when we close the search screen for then our `onViewCreated` method is called, and the activity has the intent so it creates one more search instance. So to fix this issue we are setting both intents as null after using them.
2024-03-05 08:19:28 +01:00
Kelson
a53e86e027
Merge pull request #3731 from kiwix/Fix#3730
Upgraded many dependencies of our project.
2024-03-05 08:18:01 +01:00
MohitMaliFtechiz
f2e44e02c4 Upgraded many dependencies of our project.
* Upgraded test cases and project dependencies.
* Refactor test cases and project code according to the new changes in dependencies.
2024-03-04 21:18:04 +05:30
Kelson
98671f17d4
Merge pull request #3711 from kiwix/Fix#3710
Add test cases for getLocalFilePathByUri() method.
2024-03-01 07:07:38 +01:00
MohitMaliFtechiz
7671a3be7b Added necessary comments and removed unnecessary logs. 2024-03-01 07:07:15 +01:00
MohitMaliFtechiz
58b423b06d Fixed code formatting issue. 2024-03-01 07:07:15 +01:00