A sample library_zim.xml is available at
https://github.com/kiwix/testfiles/blob/master/libraryfiles/one_item_in_library/library_zim.xml
The bug seems to have been introduced inadvertently in
b9930252e1
which returned a null to `getView(...)`
I've left a key log statement as this was one clue (after checking
various other areas of the codebase) that indicated there might be a
problem related to the number of entries rather than the attributes of
the item. I aim to revise the format of the log message as part of a
wider update on logging.
* zim_manager: Replace RelativeLayout with SwipeRefreshLayout
Signed-off-by: David Sn <divad.nnamtdeis@gmail.com>
* Replace refresh button with swipe gesture
Signed-off-by: David Sn <divad.nnamtdeis@gmail.com>
* Remove "progress bar" in favor of swipe animation
Signed-off-by: David Sn <divad.nnamtdeis@gmail.com>
* Fix not refreshing list if user has swiped to refresh
Signed-off-by: David Sn <divad.nnamtdeis@gmail.com>
* Fix "no files found" after downloading a file
Signed-off-by: David Sn <divad.nnamtdeis@gmail.com>
* Remove menu_rescan_fs from tests and replace click with swipeDown
Signed-off-by: David Sn <divad.nnamtdeis@gmail.com>
* Add refresh on swipe for online content
Signed-off-by: David Sn <divad.nnamtdeis@gmail.com>
* Disable swipe to refresh if no network connection
Prevents the user from requesting a refresh when the list isn't loaded yet.
* Rename swiperefresh to seperate id for both tabs
Signed-off-by: David Sn <divad.nnamtdeis@gmail.com>
current logging used in the DownloadService. Hopefully the extra log
messages will help us debug problems when tests fail, particularly
remotely e.g. on BitBar's TestDroid service.
The logs are local to the device and don't contain any sensitive
additional information. The extra information helps diagnose
network issues when they occur during testing.
Once we are happy with using Spoon we can add code that automatically
takes a screenshot when tests fail. This may help us debug some of the
problems we encounter running the tests on various devices. Using Spoon
exposed a limitation/key behaviour of ActivityTestRule that references
the intended Activity under test. To account for this behaviour I
restructured DownloadTest so it simply tests the download, rather than
reading the contents of the file.
I also discovered that the tests would fail on wide-screens as the Home
menu option moves from the overflow menu to the main menu. I've modified
one test to cope. Again, once we're happy with this approach (which
involves a little extra code) we can revise all the tests so they can
run equally competently on various screen sizes.
Javscript-Bridge tests don't pass on pre-KITKAT, probably as the runtime
predates the Google Chrome engine added in KITKAT. I've implemented a
way to 'pass' the test for now, in future I hope to be able to control
which tests run at runtime.
Android Test Support Library 1.0 adds the ability to approve permissions
as part of the test. I've implemented two calls to apply the
permissions; it's hard to tell if these work especially as the dialog
still appears in the GUI on my Galaxy S6 running Android 6.0.1 however
the tests generally complete OK and the app does have access to the
SDCARD to read and write as far as I can tell. We may want to revisit
the application logic that asks-for and checks the permissions at some
point.
I needed to update the versions of Espresso and several testing
libraries. These exposed a problem which has been addressed in the app's
build.gradle. With future releases of the libraries and/or the Android
testing frameworks this workaround might not be needed in future.