FileDetailFragmentStaticServerIT.kt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. *
  3. * Nextcloud Android client application
  4. *
  5. * @author Tobias Kaminsky
  6. * Copyright (C) 2020 Tobias Kaminsky
  7. * Copyright (C) 2020 Nextcloud GmbH
  8. * Copyright (C) 2020 Chris Narkiewicz <hello@ezaquarii.com>
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as published by
  12. * the Free Software Foundation, either version 3 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  22. */
  23. package com.owncloud.android.ui.fragment
  24. import androidx.test.espresso.intent.rule.IntentsTestRule
  25. import com.nextcloud.client.TestActivity
  26. import com.owncloud.android.AbstractIT
  27. import com.owncloud.android.datamodel.OCFile
  28. import com.owncloud.android.utils.ScreenshotTest
  29. import org.junit.Rule
  30. import org.junit.Test
  31. class FileDetailFragmentStaticServerIT : AbstractIT() {
  32. @get:Rule
  33. val testActivityRule = IntentsTestRule(TestActivity::class.java, true, false)
  34. val file = OCFile("/", "00000001")
  35. @Test
  36. @ScreenshotTest
  37. fun showFileDetailActivitiesFragment() {
  38. val sut = testActivityRule.launchActivity(null)
  39. sut.addFragment(FileDetailActivitiesFragment.newInstance(file, user))
  40. waitForIdleSync()
  41. screenshot(sut)
  42. }
  43. @Test
  44. @ScreenshotTest
  45. fun showFileDetailSharingFragment() {
  46. val sut = testActivityRule.launchActivity(null)
  47. sut.addFragment(FileDetailSharingFragment.newInstance(file, user))
  48. waitForIdleSync()
  49. screenshot(sut)
  50. }
  51. @Test
  52. @ScreenshotTest
  53. fun showDetails_Activities() {
  54. val sut = testActivityRule.launchActivity(null)
  55. sut.addFragment(FileDetailFragment.newInstance(file, user, 0))
  56. waitForIdleSync()
  57. screenshot(sut)
  58. }
  59. @Test
  60. @ScreenshotTest
  61. fun showDetails_Sharing() {
  62. val sut = testActivityRule.launchActivity(null)
  63. sut.addFragment(FileDetailFragment.newInstance(file, user, 1))
  64. waitForIdleSync()
  65. screenshot(sut)
  66. }
  67. }