Merge pull request #10117 from nextcloud/chore/screenshot-test-reliability

Screenshot tests reliability improvements
This commit is contained in:
Álvaro Brey 2022-04-28 14:05:23 +02:00 committed by GitHub
commit c81c1c83aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions

View file

@ -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()

View file

@ -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)
}

View file

@ -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)
}
}

View file

@ -86,6 +86,8 @@ class TrashbinActivityIT : AbstractIT() {
sut.runOnUiThread { sut.loadFolder() }
shortSleep()
shortSleep()
waitForIdleSync()
screenshot(sut)
}