ManageAccountsActivityIT.java 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  21. */
  22. package com.owncloud.android.ui.activity;
  23. import android.app.Activity;
  24. import com.facebook.testing.screenshot.Screenshot;
  25. import com.nextcloud.client.account.User;
  26. import com.owncloud.android.AbstractIT;
  27. import com.owncloud.android.utils.ScreenshotTest;
  28. import org.junit.Rule;
  29. import org.junit.Test;
  30. import androidx.test.espresso.intent.rule.IntentsTestRule;
  31. public class ManageAccountsActivityIT extends AbstractIT {
  32. @Rule
  33. public IntentsTestRule<ManageAccountsActivity> activityRule = new IntentsTestRule<>(ManageAccountsActivity.class,
  34. true,
  35. false);
  36. @Test
  37. @ScreenshotTest
  38. public void open() {
  39. Activity sut = activityRule.launchActivity(null);
  40. shortSleep();
  41. Screenshot.snapActivity(sut).record();
  42. }
  43. @Test
  44. @ScreenshotTest
  45. public void userInfoDetail() {
  46. ManageAccountsActivity sut = activityRule.launchActivity(null);
  47. User user = sut.accountManager.getUser();
  48. sut.onAccountClicked(user);
  49. shortSleep();
  50. Screenshot.snapActivity(getCurrentActivity()).record();
  51. }
  52. }