Test case added

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
A117870935 2023-04-12 19:48:55 +05:30 committed by Andy Scherzinger
parent 3db2c7db04
commit 6a6e8335c8
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 59 additions and 1 deletions

View file

@ -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,

View file

@ -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/"
}
}