mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 21:25:35 +03:00
Test case added
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
3db2c7db04
commit
6a6e8335c8
2 changed files with 59 additions and 1 deletions
|
@ -60,7 +60,7 @@ public class SyncedFoldersActivityIT extends AbstractIT {
|
|||
public void testSyncedFolderDialog() {
|
||||
SyncedFolderDisplayItem item = new SyncedFolderDisplayItem(1,
|
||||
"/sdcard/DCIM/",
|
||||
"/Camera-Media/",
|
||||
"/InstantUpload/",
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
package com.nmc.android.ui
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.UiController
|
||||
import androidx.test.espresso.ViewAction
|
||||
import androidx.test.espresso.action.ViewActions.click
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.contrib.RecyclerViewActions
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||
import androidx.test.ext.junit.rules.ActivityScenarioRule
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.owncloud.android.AbstractIT
|
||||
import com.owncloud.android.R
|
||||
import com.owncloud.android.ui.activity.SyncedFoldersActivity
|
||||
import org.hamcrest.Matcher
|
||||
import org.hamcrest.Matchers.startsWith
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class SyncedFoldersActivityIT : AbstractIT() {
|
||||
|
||||
@get:Rule
|
||||
val activityRule = ActivityScenarioRule(SyncedFoldersActivity::class.java)
|
||||
|
||||
@Test
|
||||
fun syncedFolderDialogWithCameraMediaPath() {
|
||||
InstrumentationRegistry.getInstrumentation().waitForIdleSync()
|
||||
shortSleep()
|
||||
|
||||
onView(withId(android.R.id.list))
|
||||
.perform(RecyclerViewActions.actionOnItemAtPosition<RecyclerView.ViewHolder>(0, object : ViewAction {
|
||||
|
||||
override fun getDescription(): String {
|
||||
return "Click on specific button"
|
||||
}
|
||||
|
||||
override fun getConstraints(): Matcher<View>? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun perform(uiController: UiController, view: View) {
|
||||
val button = view.findViewById<View>(R.id.settingsButton)
|
||||
button.performClick()
|
||||
}
|
||||
}))
|
||||
|
||||
onView(withText("Configure")).perform(click())
|
||||
|
||||
onView(withId(R.id.remote_folder_summary)).check(matches(withText(startsWith(AUTO_UPLOAD_PATH))))
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val AUTO_UPLOAD_PATH = "/Camera-Media/"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue