mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-10 16:02:05 -04:00
Fixed CopyMoveFileHandlerTest UI test
This commit is contained in:
parent
828f736eb5
commit
bfb7ad2fd5
@ -44,10 +44,6 @@ fun copyMoveFileHandler(func: CopyMoveFileHandlerRobot.() -> Unit) =
|
|||||||
|
|
||||||
class CopyMoveFileHandlerRobot : BaseRobot() {
|
class CopyMoveFileHandlerRobot : BaseRobot() {
|
||||||
|
|
||||||
fun assertCopyMovePermissionDialogDisplayed() {
|
|
||||||
isVisible(TextId(R.string.move_files_permission_dialog_title))
|
|
||||||
}
|
|
||||||
|
|
||||||
fun assertCopyMoveDialogDisplayed() {
|
fun assertCopyMoveDialogDisplayed() {
|
||||||
isVisible(TextId(R.string.copy_move_files_dialog_description))
|
isVisible(TextId(R.string.copy_move_files_dialog_description))
|
||||||
}
|
}
|
||||||
|
@ -113,12 +113,14 @@ class CopyMoveFileHandlerTest : BaseActivityTest() {
|
|||||||
}
|
}
|
||||||
copyMoveFileHandler(CopyMoveFileHandlerRobot::pauseForBetterTestPerformance)
|
copyMoveFileHandler(CopyMoveFileHandlerRobot::pauseForBetterTestPerformance)
|
||||||
// test with first launch
|
// test with first launch
|
||||||
sharedPreferenceUtil.copyMoveZimFilePermissionDialog = false
|
sharedPreferenceUtil.shouldShowStorageSelectionDialog = true
|
||||||
showMoveFileToPublicDirectoryDialog()
|
showMoveFileToPublicDirectoryDialog()
|
||||||
// should show the permission dialog.
|
// should show the permission dialog.
|
||||||
copyMoveFileHandler {
|
copyMoveFileHandler {
|
||||||
assertCopyMovePermissionDialogDisplayed()
|
assertCopyMoveDialogDisplayed()
|
||||||
clickOnCopy()
|
clickOnCopy()
|
||||||
|
assertStorageSelectionDialogDisplayed()
|
||||||
|
clickOnInternalStorage()
|
||||||
assertZimFileCopiedAndShowingIntoTheReader()
|
assertZimFileCopiedAndShowingIntoTheReader()
|
||||||
}
|
}
|
||||||
assertZimFileAddedInTheLocalLibrary()
|
assertZimFileAddedInTheLocalLibrary()
|
||||||
@ -150,12 +152,14 @@ class CopyMoveFileHandlerTest : BaseActivityTest() {
|
|||||||
}
|
}
|
||||||
copyMoveFileHandler(CopyMoveFileHandlerRobot::pauseForBetterTestPerformance)
|
copyMoveFileHandler(CopyMoveFileHandlerRobot::pauseForBetterTestPerformance)
|
||||||
// test with first launch
|
// test with first launch
|
||||||
sharedPreferenceUtil.copyMoveZimFilePermissionDialog = false
|
sharedPreferenceUtil.shouldShowStorageSelectionDialog = true
|
||||||
showMoveFileToPublicDirectoryDialog()
|
showMoveFileToPublicDirectoryDialog()
|
||||||
// should show the permission dialog.
|
// should show the permission dialog.
|
||||||
copyMoveFileHandler {
|
copyMoveFileHandler {
|
||||||
assertCopyMovePermissionDialogDisplayed()
|
assertCopyMoveDialogDisplayed()
|
||||||
clickOnMove()
|
clickOnMove()
|
||||||
|
assertStorageSelectionDialogDisplayed()
|
||||||
|
clickOnInternalStorage()
|
||||||
assertZimFileCopiedAndShowingIntoTheReader()
|
assertZimFileCopiedAndShowingIntoTheReader()
|
||||||
}
|
}
|
||||||
assertZimFileAddedInTheLocalLibrary()
|
assertZimFileAddedInTheLocalLibrary()
|
||||||
@ -198,7 +202,8 @@ class CopyMoveFileHandlerTest : BaseActivityTest() {
|
|||||||
navHostFragment.childFragmentManager.fragments[0] as LocalLibraryFragment
|
navHostFragment.childFragmentManager.fragments[0] as LocalLibraryFragment
|
||||||
localLibraryFragment.copyMoveFileHandler?.showMoveFileToPublicDirectoryDialog(
|
localLibraryFragment.copyMoveFileHandler?.showMoveFileToPublicDirectoryDialog(
|
||||||
Uri.fromFile(selectedFile),
|
Uri.fromFile(selectedFile),
|
||||||
DocumentFile.fromFile(selectedFile)
|
DocumentFile.fromFile(selectedFile),
|
||||||
|
fragmentManager = localLibraryFragment.parentFragmentManager
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -307,7 +312,7 @@ class CopyMoveFileHandlerTest : BaseActivityTest() {
|
|||||||
}
|
}
|
||||||
copyMoveFileHandler(CopyMoveFileHandlerRobot::pauseForBetterTestPerformance)
|
copyMoveFileHandler(CopyMoveFileHandlerRobot::pauseForBetterTestPerformance)
|
||||||
sharedPreferenceUtil.apply {
|
sharedPreferenceUtil.apply {
|
||||||
copyMoveZimFilePermissionDialog = true
|
shouldShowStorageSelectionDialog = false
|
||||||
setIsPlayStoreBuildType(true)
|
setIsPlayStoreBuildType(true)
|
||||||
}
|
}
|
||||||
// test opening images
|
// test opening images
|
||||||
|
Loading…
x
Reference in New Issue
Block a user