From d7a9e9323a153ec57f54c6697e6acfe1c239444c Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Tue, 11 Apr 2023 13:05:26 +0530 Subject: [PATCH] Removed unused files As we are already testing the downloads in DownloadTest, InitialDownloadTest and this test files are unused now so we are removing these. --- .../zimManager/ZimManageActivityTest.kt | 101 ----------------- .../kiwixmobile/zimManager/ZimManageRobot.kt | 106 ------------------ 2 files changed, 207 deletions(-) delete mode 100644 app/src/androidTest/java/org/kiwix/kiwixmobile/zimManager/ZimManageActivityTest.kt delete mode 100644 app/src/androidTest/java/org/kiwix/kiwixmobile/zimManager/ZimManageRobot.kt diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/zimManager/ZimManageActivityTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/zimManager/ZimManageActivityTest.kt deleted file mode 100644 index 128cde601..000000000 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/zimManager/ZimManageActivityTest.kt +++ /dev/null @@ -1,101 +0,0 @@ -// /* -// * Kiwix Android -// * Copyright (c) 2019 Kiwix -// * This program is free software: you can redistribute it and/or modify -// * it under the terms of the GNU General Public License as published by -// * the Free Software Foundation, either version 3 of the License, or -// * (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have received a copy of the GNU General Public License -// * along with this program. If not, see . -// * -// */ -// -package org.kiwix.kiwixmobile.zimManager -// -// import androidx.test.filters.SdkSuppress -// import attempt -// import okhttp3.mockwebserver.MockResponse -// import org.junit.Ignore -// import org.junit.Test -// import org.kiwix.kiwixmobile.BaseActivityTest -// import org.kiwix.kiwixmobile.KiwixMockServer -// import org.kiwix.kiwixmobile.core.CoreApp -// import org.kiwix.kiwixmobile.core.data.remote.KiwixService.LIBRARY_NETWORK_PATH -// import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity -// import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil -// import org.kiwix.sharedFunctions.book -// import org.kiwix.sharedFunctions.libraryNetworkEntity -// import org.kiwix.sharedFunctions.metaLinkNetworkEntity -// import java.util.concurrent.TimeUnit.SECONDS -// -// class ZimManageActivityTest : BaseActivityTest() { -// -// override var activityRule = activityTestRule { -// CoreApp.coreComponent = testComponent() -// } -// private val book = book() -// -// private val mockServer = KiwixMockServer().apply { -// map( -// LIBRARY_NETWORK_PATH to libraryNetworkEntity(listOf(book)), -// book.networkPath to metaLinkNetworkEntity() -// ) -// } -// -// @Test -// @Ignore("Ignored due to flakiness on nightly build") -// fun testZimManageDataFlow() { -// SharedPreferenceUtil(activityRule.activity).putPrefWifiOnly(false) -// zimManage { -// clickOnOnline { -// clickOnSearch() -// searchFor(book(title = "zzzzz")) -// waitForEmptyView() -// searchFor(book) -// pressBack() -// pressBack() -// forceResponse("012345678901234567890123456789012345678901234567890123456789012345678") -// attempt(10) { -// clickOn(book) -// clickStop() -// clickNegativeDialogButton() -// clickStop() -// clickPositiveDialogButton() -// } -// forceResponse("01234") -// clickOn(book) -// waitForEmptyView() -// } -// clickOnDevice { -// longClickOn(book) -// clickCloseActionMode() -// longClickOn(book) -// clickDelete() -// clickNegativeDialogButton() -// longClickOn(book) -// clickDelete() -// clickPositiveDialogButton() -// waitForEmptyView() -// } -// clickOnOnline { -// } clickOnLanguageIcon { } -// } -// } -// -// private fun forceResponse(body: String) { -// mockServer.forceResponse( -// MockResponse() -// .setBody(body) -// .throttleBody(1L, 1L, SECONDS) -// ) -// } -// -// private val LibraryNetworkEntity.Book.networkPath -// get() = "/${url.substringAfterLast("/")}" -// } diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/zimManager/ZimManageRobot.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/zimManager/ZimManageRobot.kt deleted file mode 100644 index 79725a869..000000000 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/zimManager/ZimManageRobot.kt +++ /dev/null @@ -1,106 +0,0 @@ -// /* -// * Kiwix Android -// * Copyright (c) 2019 Kiwix -// * This program is free software: you can redistribute it and/or modify -// * it under the terms of the GNU General Public License as published by -// * the Free Software Foundation, either version 3 of the License, or -// * (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have received a copy of the GNU General Public License -// * along with this program. If not, see . -// * -// */ -package org.kiwix.kiwixmobile.zimManager -// -// import applyWithViewHierarchyPrinting -// import org.kiwix.kiwixmobile.BaseRobot -// import org.kiwix.kiwixmobile.Findable.StringId.TextId -// import org.kiwix.kiwixmobile.Findable.Text -// import org.kiwix.kiwixmobile.Findable.ViewId -// import org.kiwix.kiwixmobile.LONG_WAIT -// import org.kiwix.kiwixmobile.R -// import org.kiwix.kiwixmobile.VERY_LONG_WAIT -// import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book -// import org.kiwix.kiwixmobile.language.LanguageRobot -// import org.kiwix.kiwixmobile.language.language -// -// fun zimManage(func: ZimManageRobot.() -> Unit) = -// ZimManageRobot().applyWithViewHierarchyPrinting(func) -// -// class ZimManageRobot : BaseRobot() { -// init { -// isVisible(ViewId(R.id.manageViewPager), VERY_LONG_WAIT) -// } -// -// fun clickOnOnline(func: LibraryRobot.() -> Unit): LibraryRobot { -// clickOnTab(R.string.remote_zims) -// return library(func) -// } -// -// fun clickOnDevice(func: DeviceRobot.() -> Unit): DeviceRobot { -// clickOnTab(R.string.local_zims) -// return device(func) -// } -// -// private fun library(func: LibraryRobot.() -> Unit) = LibraryRobot().apply(func) -// inner class LibraryRobot : BaseRobot() { -// init { -// isVisible(ViewId(R.id.libraryList)) -// } -// -// fun clickOn(book: Book) { -// clickOn(Text(book.title)) -// } -// -// fun clickOnSearch() { -// clickOn(ViewId(R.id.action_search), LONG_WAIT) -// } -// -// fun searchFor(book: Book) { -// isVisible(ViewId(R.id.search_src_text)).text = book.title -// } -// -// fun waitForEmptyView() { -// isVisible(ViewId(R.id.libraryErrorText), VERY_LONG_WAIT) -// } -// -// fun clickStop() { -// clickOn(ViewId(R.id.stop), LONG_WAIT) -// } -// -// infix fun clickOnLanguageIcon(function: LanguageRobot.() -> Unit): LanguageRobot { -// TextId(R.string.remote_zims) -// clickOn(ViewId(R.id.select_language)) -// return language(function) -// } -// } -// -// private fun device(func: DeviceRobot.() -> Unit) = DeviceRobot().apply(func) -// inner class DeviceRobot : BaseRobot() { -// init { -// isVisible(ViewId(R.id.zimfilelist)) -// } -// -// fun longClickOn(book: Book) { -// longClickOn(Text(book.title)) -// } -// -// fun clickCloseActionMode() { -// clickOn(ViewId(R.id.action_mode_close_button)) -// } -// -// fun clickDelete() { -// clickOn(ViewId(R.id.zim_file_delete_item)) -// } -// -// fun waitForEmptyView() { -// isVisible(ViewId(R.id.file_management_no_files)) -// isVisible(ViewId(R.id.go_to_downloads_button_no_files)) -// } -// } -// }