Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/screenShotTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
matrix:
scheme: [ Light ]
color: [ blue ]
api-level: [ 28 ]
api-level: [ 36 ]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
arch: x86
arch: x86_64
sdcard-path-or-size: 100M
target: google_apis
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
arch: x86
arch: x86_64
sdcard-path-or-size: 100M
target: google_apis
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.test.espresso.contrib.NavigationViewActions
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.GrantPermissionRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
Expand All @@ -27,13 +28,14 @@ import com.owncloud.android.utils.ScreenshotTest
import org.junit.Assert
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class FileDisplayActivityScreenshotIT : AbstractIT() {
private val testClassName = "com.nextcloud.client.FileDisplayActivityScreenshotIT"

@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class SyncedFoldersActivityIT : AbstractIT() {
}
}

// @ScreenshotTest
@Test
@ScreenshotTest
fun testSyncedFolderDialog() {
val item = SyncedFolderDisplayItem(
1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class SetOnlineStatusBottomSheetIT : AbstractIT() {

@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import org.junit.Test
class SetStatusMessageBottomSheetIT : AbstractIT() {
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class ScreenshotsIT : AbstractIT() {

@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)

Expand Down Expand Up @@ -65,7 +64,6 @@ class ScreenshotsIT : AbstractIT() {
OCFile(path).apply {
storageManager.saveFile(this)
}
onView(withId(R.id.list_root)).perform(click())

onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("02_listView")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class DrawerActivityIT : AbstractIT() {

@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class ManageAccountsActivityIT : AbstractIT() {
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))

scenario.onActivity {
screenshotViaName(getCurrentActivity(), screenShotName)
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@ import com.owncloud.android.utils.ScreenshotTest
import org.junit.Test

class ReceiveExternalFilesActivityIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.activity.ReceiveExternalFilesActivityIT"

@Test
@ScreenshotTest
fun open() {
launchActivity<ReceiveExternalFilesActivity>().use { scenario ->
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))

scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
screenshot(sut)
}
}
}
Expand All @@ -37,7 +34,16 @@ class ReceiveExternalFilesActivityIT : AbstractIT() {
@ScreenshotTest
fun openMultiAccount() {
val secondAccount = createAccount("secondtest@https://nextcloud.localhost")
open()

launchActivity<ReceiveExternalFilesActivity>().use { scenario ->
// val screenShotName = createName(testClassName + "_" + "open_second_account", "")
onView(isRoot()).check(matches(isDisplayed()))

scenario.onActivity { sut ->
screenshot(sut)
}
}

removeAccount(secondAccount)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class DialogFragmentIT : AbstractIT() {

@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class SyncFileNotEnoughSpaceDialogFragmentTest : AbstractIT() {

@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,10 @@ class FileDetailFragmentStaticServerIT : AbstractIT() {
var activity: TestActivity? = null
scenario.onActivity { sut ->
activity = sut
val fragment = ImageDetailFragment.newInstance(oCFile, user).apply {
hideMap()
}
val fragment = ImageDetailFragment.newInstance(oCFile, user)
sut.addFragment(fragment)
sut.supportFragmentManager.executePendingTransactions()
fragment.hideMap()
}

val screenShotName = createName(testClassName + "_" + "showFileDetailDetailsFragment", "")
Expand Down Expand Up @@ -152,10 +151,10 @@ class FileDetailFragmentStaticServerIT : AbstractIT() {
var activity: TestActivity? = null
scenario.onActivity { sut ->
activity = sut
val fragment = FileDetailFragment.newInstance(oCFile, user, 0)
val fragment = FileDetailActivitiesFragment.newInstance(oCFile, user)
sut.addFragment(fragment)
sut.supportFragmentManager.executePendingTransactions()
fragment.fileDetailActivitiesFragment.populateList(activities as List<Any>?, true)
fragment.populateList(activities as List<Any>?, true)
}

val screenShotName = createName(testClassName + "_" + "showDetailsActivities", "")
Expand All @@ -171,10 +170,10 @@ class FileDetailFragmentStaticServerIT : AbstractIT() {
var activity: TestActivity? = null
scenario.onActivity { sut ->
activity = sut
val fragment = FileDetailFragment.newInstance(oCFile, user, 0)
val fragment = FileDetailActivitiesFragment.newInstance(oCFile, user)
sut.addFragment(fragment)
activity.supportFragmentManager.executePendingTransactions()
fragment.fileDetailActivitiesFragment.populateList(emptyList(), true)
fragment.populateList(emptyList(), true)
}

val screenShotName = createName(testClassName + "_" + "showDetailsActivitiesNone", "")
Expand All @@ -190,11 +189,11 @@ class FileDetailFragmentStaticServerIT : AbstractIT() {
var activity: TestActivity? = null
scenario.onActivity { sut ->
activity = sut
val fragment = FileDetailFragment.newInstance(oCFile, user, 0)
val fragment = FileDetailActivitiesFragment.newInstance(oCFile, user)
sut.addFragment(fragment)
sut.supportFragmentManager.executePendingTransactions()
fragment.fileDetailActivitiesFragment.disableLoadingActivities()
fragment.fileDetailActivitiesFragment.setErrorContent(
fragment.disableLoadingActivities()
fragment.setErrorContent(
targetContext.resources.getString(R.string.file_detail_activity_error)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class PreviewTextFileFragmentTest : AbstractIT() {

@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)

Expand Down
Loading