mirror of
https://github.com/nextcloud/android.git
synced 2024-12-18 15:01:57 +03:00
add another test
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
586a9b8010
commit
1294a67376
3 changed files with 24 additions and 4 deletions
Binary file not shown.
After Width: | Height: | Size: 7.4 KiB |
|
@ -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();
|
||||||
|
|
|
@ -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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue