mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
Merge pull request #10117 from nextcloud/chore/screenshot-test-reliability
Screenshot tests reliability improvements
This commit is contained in:
commit
c81c1c83aa
4 changed files with 14 additions and 4 deletions
|
@ -185,12 +185,15 @@ class ActivitiesActivityIT : AbstractIT() {
|
|||
fun error() {
|
||||
val sut: ActivitiesActivity = activityRule.launchActivity(null)
|
||||
|
||||
shortSleep()
|
||||
|
||||
sut.runOnUiThread {
|
||||
sut.showEmptyContent("Error", "Error! Please try again later!")
|
||||
sut.setProgressIndicatorState(false)
|
||||
sut.dismissSnackbar()
|
||||
}
|
||||
|
||||
shortSleep()
|
||||
shortSleep()
|
||||
waitForIdleSync()
|
||||
|
||||
|
|
|
@ -42,6 +42,8 @@ class PassCodeActivityIT : AbstractIT() {
|
|||
|
||||
sut.runOnUiThread { sut.binding.txt0.clearFocus() }
|
||||
Espresso.closeSoftKeyboard()
|
||||
shortSleep()
|
||||
waitForIdleSync()
|
||||
|
||||
screenshot(sut)
|
||||
}
|
||||
|
@ -55,6 +57,8 @@ class PassCodeActivityIT : AbstractIT() {
|
|||
|
||||
sut.runOnUiThread { sut.binding.txt0.clearFocus() }
|
||||
Espresso.closeSoftKeyboard()
|
||||
shortSleep()
|
||||
waitForIdleSync()
|
||||
|
||||
screenshot(sut)
|
||||
}
|
||||
|
@ -68,6 +72,8 @@ class PassCodeActivityIT : AbstractIT() {
|
|||
|
||||
sut.runOnUiThread { sut.binding.txt0.clearFocus() }
|
||||
Espresso.closeSoftKeyboard()
|
||||
shortSleep()
|
||||
waitForIdleSync()
|
||||
|
||||
screenshot(sut)
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
*/
|
||||
package com.owncloud.android.ui.dialog
|
||||
|
||||
import android.view.Window
|
||||
import androidx.test.espresso.intent.rule.IntentsTestRule
|
||||
import androidx.test.internal.runner.junit4.statement.UiThreadStatement.runOnUiThread
|
||||
import com.nextcloud.client.TestActivity
|
||||
|
@ -29,7 +28,6 @@ import com.owncloud.android.AbstractIT
|
|||
import com.owncloud.android.utils.ScreenshotTest
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import java.util.Objects
|
||||
|
||||
class SetupEncryptionDialogFragmentIT : AbstractIT() {
|
||||
@get:Rule
|
||||
|
@ -69,7 +67,7 @@ class SetupEncryptionDialogFragmentIT : AbstractIT() {
|
|||
|
||||
waitForIdleSync()
|
||||
|
||||
screenshot(Objects.requireNonNull<Window>(sut.requireDialog().window).decorView)
|
||||
screenshot(sut.requireDialog().window!!.decorView)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -87,8 +85,9 @@ class SetupEncryptionDialogFragmentIT : AbstractIT() {
|
|||
sut.errorSavingKeys()
|
||||
}
|
||||
|
||||
shortSleep()
|
||||
waitForIdleSync()
|
||||
|
||||
screenshot(Objects.requireNonNull<Window>(sut.requireDialog().window).decorView)
|
||||
screenshot(sut.requireDialog().window!!.decorView)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,6 +86,8 @@ class TrashbinActivityIT : AbstractIT() {
|
|||
sut.runOnUiThread { sut.loadFolder() }
|
||||
|
||||
shortSleep()
|
||||
shortSleep()
|
||||
waitForIdleSync()
|
||||
|
||||
screenshot(sut)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue