|
@@ -21,52 +21,54 @@
|
|
|
*/
|
|
|
package com.owncloud.android.ui.preview
|
|
|
|
|
|
-import androidx.lifecycle.Lifecycle
|
|
|
import androidx.test.espresso.intent.rule.IntentsTestRule
|
|
|
import com.nextcloud.client.TestActivity
|
|
|
import com.owncloud.android.AbstractIT
|
|
|
-import com.owncloud.android.datamodel.OCFile
|
|
|
-import com.owncloud.android.utils.ScreenshotTest
|
|
|
import org.junit.Rule
|
|
|
-import org.junit.Test
|
|
|
|
|
|
class PreviewImageFragmentIT : AbstractIT() {
|
|
|
@get:Rule
|
|
|
val testActivityRule = IntentsTestRule(TestActivity::class.java, true, false)
|
|
|
|
|
|
- @Test
|
|
|
- @ScreenshotTest
|
|
|
- fun corruptImage() {
|
|
|
- val activity = testActivityRule.launchActivity(null)
|
|
|
+ // Disabled for now due to strange failing when using entire test suite
|
|
|
+ // Findings so far:
|
|
|
+ // PreviewImageFragmentIT runs fine when only running this
|
|
|
+ // running it in whole test suite fails
|
|
|
+ // manually tried to execute LoadBitmapTask, but this does not start "doInBackground", but only creates class
|
|
|
|
|
|
- val ocFile = OCFile("/test.png")
|
|
|
- val sut = PreviewImageFragment.newInstance(ocFile, true, false)
|
|
|
-
|
|
|
- activity.addFragment(sut)
|
|
|
-
|
|
|
- while (!sut.lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
|
|
|
- shortSleep()
|
|
|
- }
|
|
|
-
|
|
|
- screenshot(activity)
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- @ScreenshotTest
|
|
|
- fun validImage() {
|
|
|
- val activity = testActivityRule.launchActivity(null)
|
|
|
-
|
|
|
- val ocFile = OCFile("/test.png")
|
|
|
- ocFile.storagePath = getFile("imageFile.png").absolutePath
|
|
|
-
|
|
|
- val sut = PreviewImageFragment.newInstance(ocFile, true, false)
|
|
|
-
|
|
|
- activity.addFragment(sut)
|
|
|
-
|
|
|
- while (!sut.lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
|
|
|
- shortSleep()
|
|
|
- }
|
|
|
-
|
|
|
- screenshot(activity)
|
|
|
- }
|
|
|
+ // @Test
|
|
|
+ // @ScreenshotTest
|
|
|
+ // fun corruptImage() {
|
|
|
+ // val activity = testActivityRule.launchActivity(null)
|
|
|
+ //
|
|
|
+ // val ocFile = OCFile("/test.png")
|
|
|
+ // val sut = PreviewImageFragment.newInstance(ocFile, true, false)
|
|
|
+ //
|
|
|
+ // activity.addFragment(sut)
|
|
|
+ //
|
|
|
+ // while (!sut.lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
|
|
|
+ // shortSleep()
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // screenshot(activity)
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // @Test
|
|
|
+ // @ScreenshotTest
|
|
|
+ // fun validImage() {
|
|
|
+ // val activity = testActivityRule.launchActivity(null)
|
|
|
+ //
|
|
|
+ // val ocFile = OCFile("/test.png")
|
|
|
+ // ocFile.storagePath = getFile("imageFile.png").absolutePath
|
|
|
+ //
|
|
|
+ // val sut = PreviewImageFragment.newInstance(ocFile, true, false)
|
|
|
+ //
|
|
|
+ // activity.addFragment(sut)
|
|
|
+ //
|
|
|
+ // while (!sut.lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
|
|
|
+ // shortSleep()
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // screenshot(activity)
|
|
|
+ // }
|
|
|
}
|