add another test

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2024-06-05 10:48:54 +02:00
parent 586a9b8010
commit 1294a67376
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
3 changed files with 24 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View file

@ -17,7 +17,6 @@ import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.NetworkOnMainThreadException;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
@ -469,6 +468,12 @@ public abstract class AbstractIT {
} }
} }
protected void screenshotViaName(View view, String name) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
Screenshot.snap(view).setName(name).record();
}
}
protected void screenshot(View view, String prefix) { protected void screenshot(View view, String prefix) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
Screenshot.snap(view).setName(createName(prefix)).record(); Screenshot.snap(view).setName(createName(prefix)).record();

View file

@ -134,11 +134,26 @@ class UploadFilesActivityIT : AbstractIT() {
} }
} }
fun fileSelected() { @Test
@ScreenshotTest
fun selectAll() {
val sut: UploadFilesActivity = activityRule.launchActivity(null) val sut: UploadFilesActivity = activityRule.launchActivity(null)
// TODO select one sut.runOnUiThread {
sut.fileListFragment.setFiles(
listOf(
File("1.txt"),
File("2.pdf"),
File("3.mp3")
)
)
screenshot(sut) sut.fileListFragment.selectAllFiles(true)
}
onIdleSync {
val screenShotName = createName(testClassName + "_" + "selectAll", "")
screenshotViaName(sut.fileListFragment.binding.listRoot, screenShotName)
}
} }
} }