diff --git a/.drone.yml b/.drone.yml index ff739374e0..3502035822 100644 --- a/.drone.yml +++ b/.drone.yml @@ -29,7 +29,7 @@ steps: - ./gradlew installGplayDebugAndroidTest - scripts/wait_for_server.sh "server-stable" - ./gradlew createGplayDebugCoverageReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable-IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN - - ./gradlew executeScreenshotTests || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable-Screenshot" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN + - ./gradlew gplayDebugExecuteScreenshotTests -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable-Screenshot" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN - ./gradlew combinedTestReport - name: notify image: drillster/drone-email @@ -58,6 +58,7 @@ services: image: nextcloudci/server:server-17 # also change in updateScreenshots.sh commands: - BRANCH='stable18' /usr/local/bin/initnc.sh + - su www-data -c "echo 127.0.0.1 server >> /etc/hosts" - su www-data -c "OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1" - su www-data -c "OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2" - su www-data -c "OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3" @@ -109,7 +110,7 @@ steps: - ./gradlew installGplayDebugAndroidTest - scripts/wait_for_server.sh "server-master" - ./gradlew createGplayDebugCoverageReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master-IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN - - ./gradlew executeScreenshotTests || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master-Screenshot" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN + - ./gradlew gplayDebugExecuteScreenshotTests -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master-Screenshot" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN - ./gradlew combinedTestReport - curl -o codecov.sh https://codecov.io/bash - bash ./codecov.sh -t fc506ba4-33c3-43e4-a760-aada38c24fd5 @@ -140,7 +141,7 @@ services: image: nextcloudci/server:server-17 # also change in updateScreenshots.sh commands: - /usr/local/bin/initnc.sh - - su www-data -c "php /var/www/html/occ status" + - su www-data -c "echo 127.0.0.1 server >> /etc/hosts" - su www-data -c "OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1" - su www-data -c "OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2" - su www-data -c "OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f5099df87f..8b5c90dbd1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -272,7 +272,7 @@ Source code of app: #### UI tests We use [shot](https://github.com/Karumi/Shot) for taking screenshots and compare them -- check screenshots: ```./gradlew executeScreenshotTests ``` +- check screenshots: ```./gradlew gplayDebugExecuteScreenshotTests ``` - update/generate new screenshots: ```scripts/updateScreenshots.sh ``` - in this script are samples how to only execute a given class/test - this will fire up docker & emulator to ensure that screenshots look the same diff --git a/build.gradle b/build.gradle index 52df2c9e2c..ab5999f3c5 100644 --- a/build.gradle +++ b/build.gradle @@ -91,7 +91,7 @@ def versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable for (TaskExecutionRequest tr : getGradle().getStartParameter().getTaskRequests()) { for (String arg : tr.args) { // any gplay, but only exact "build", as e.g. buildGeneric shall not apply gplay.grade - if (arg.contains("Gplay") || arg.contains("lint") || arg.contains("executeScreenshot") || arg == "build") { + if (arg.contains("Gplay") || arg.contains("lint") || arg.contains("ExecuteScreenshot") || arg == "build") { apply from: 'gplay.gradle' System.console().println("Applying gplay.gradle") break @@ -103,11 +103,6 @@ spotbugs { toolVersion = '3.1.12' } -shot { - appId = 'com.nextcloud.client' - instrumentationTestTask = 'connectedGplayDebugAndroidTest' -} - android { lintOptions { abortOnError false diff --git a/screenshots/com.nextcloud.client.ActivitiesActivityIT_openDrawer.png b/screenshots/com.nextcloud.client.ActivitiesActivityIT_openDrawer.png deleted file mode 100644 index ca3a708f8a..0000000000 Binary files a/screenshots/com.nextcloud.client.ActivitiesActivityIT_openDrawer.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.ConflictsResolveActivityIT_test.png b/screenshots/com.nextcloud.client.ConflictsResolveActivityIT_test.png deleted file mode 100644 index 1f6a3ff78a..0000000000 Binary files a/screenshots/com.nextcloud.client.ConflictsResolveActivityIT_test.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.FileDisplayActivityIT_drawer.png b/screenshots/com.nextcloud.client.FileDisplayActivityIT_drawer.png deleted file mode 100644 index ef4da38ab1..0000000000 Binary files a/screenshots/com.nextcloud.client.FileDisplayActivityIT_drawer.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.FileDisplayActivityIT_open.png b/screenshots/com.nextcloud.client.FileDisplayActivityIT_open.png deleted file mode 100644 index 50a34a0062..0000000000 Binary files a/screenshots/com.nextcloud.client.FileDisplayActivityIT_open.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.FileDisplayActivityIT_overflowMenu.png b/screenshots/com.nextcloud.client.FileDisplayActivityIT_overflowMenu.png deleted file mode 100644 index ae69543675..0000000000 Binary files a/screenshots/com.nextcloud.client.FileDisplayActivityIT_overflowMenu.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.FileDisplayActivityIT_showAccounts.png b/screenshots/com.nextcloud.client.FileDisplayActivityIT_showAccounts.png deleted file mode 100644 index d710f34aa7..0000000000 Binary files a/screenshots/com.nextcloud.client.FileDisplayActivityIT_showAccounts.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.FileDisplayActivityIT_showShares.png b/screenshots/com.nextcloud.client.FileDisplayActivityIT_showShares.png deleted file mode 100644 index babd435cef..0000000000 Binary files a/screenshots/com.nextcloud.client.FileDisplayActivityIT_showShares.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.NotificationsActivityIT_openDrawer.png b/screenshots/com.nextcloud.client.NotificationsActivityIT_openDrawer.png deleted file mode 100644 index 06ae6d8961..0000000000 Binary files a/screenshots/com.nextcloud.client.NotificationsActivityIT_openDrawer.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.SettingsActivityIT_open.png b/screenshots/com.nextcloud.client.SettingsActivityIT_open.png deleted file mode 100644 index 9b497c4550..0000000000 Binary files a/screenshots/com.nextcloud.client.SettingsActivityIT_open.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.SyncedFoldersActivityIT_openDrawer.png b/screenshots/com.nextcloud.client.SyncedFoldersActivityIT_openDrawer.png deleted file mode 100644 index 9009d4c543..0000000000 Binary files a/screenshots/com.nextcloud.client.SyncedFoldersActivityIT_openDrawer.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.UploadListActivityActivityIT_openDrawer.png b/screenshots/com.nextcloud.client.UploadListActivityActivityIT_openDrawer.png deleted file mode 100644 index e92ec17efc..0000000000 Binary files a/screenshots/com.nextcloud.client.UploadListActivityActivityIT_openDrawer.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.etm.EtmActivityTest_accounts.png b/screenshots/com.nextcloud.client.etm.EtmActivityTest_accounts.png deleted file mode 100644 index 24d6c24726..0000000000 Binary files a/screenshots/com.nextcloud.client.etm.EtmActivityTest_accounts.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.etm.EtmActivityTest_overview.png b/screenshots/com.nextcloud.client.etm.EtmActivityTest_overview.png deleted file mode 100644 index 7c14813782..0000000000 Binary files a/screenshots/com.nextcloud.client.etm.EtmActivityTest_overview.png and /dev/null differ diff --git a/screenshots/com.nextcloud.client.etm.EtmActivityTest_preferences.png b/screenshots/com.nextcloud.client.etm.EtmActivityTest_preferences.png deleted file mode 100644 index 29dbcbd780..0000000000 Binary files a/screenshots/com.nextcloud.client.etm.EtmActivityTest_preferences.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_keepBoth.png b/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_keepBoth.png deleted file mode 100644 index 59fae25320..0000000000 Binary files a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_keepBoth.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_keepExisting.png b/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_keepExisting.png deleted file mode 100644 index 238267d295..0000000000 Binary files a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_keepExisting.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_keepNew.png b/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_keepNew.png deleted file mode 100644 index e289daff58..0000000000 Binary files a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_keepNew.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_screenshotImages.png b/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_screenshotImages.png deleted file mode 100644 index 40e77e15f2..0000000000 Binary files a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_screenshotImages.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_screenshotTextFiles.png b/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_screenshotTextFiles.png deleted file mode 100644 index 61c34b95e9..0000000000 Binary files a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_screenshotTextFiles.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_test.png b/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_test.png deleted file mode 100644 index 1f6a3ff78a..0000000000 Binary files a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_test.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_test2.png b/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_test2.png deleted file mode 100644 index 4ac14ed474..0000000000 Binary files a/screenshots/com.owncloud.android.ui.activity.ConflictsResolveActivityIT_test2.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.activity.ManageAccountsActivityIT_open.png b/screenshots/com.owncloud.android.ui.activity.ManageAccountsActivityIT_open.png deleted file mode 100644 index b0e8f2ea21..0000000000 Binary files a/screenshots/com.owncloud.android.ui.activity.ManageAccountsActivityIT_open.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.activity.ManageAccountsActivityIT_userInfoDetail.png b/screenshots/com.owncloud.android.ui.activity.ManageAccountsActivityIT_userInfoDetail.png deleted file mode 100644 index fbee87382d..0000000000 Binary files a/screenshots/com.owncloud.android.ui.activity.ManageAccountsActivityIT_userInfoDetail.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.dialog.SyncFileNotEnoughSpaceDialogFragmentTest_showNotEnoughSpaceDialogForFile.png b/screenshots/com.owncloud.android.ui.dialog.SyncFileNotEnoughSpaceDialogFragmentTest_showNotEnoughSpaceDialogForFile.png deleted file mode 100644 index 04f4b73955..0000000000 Binary files a/screenshots/com.owncloud.android.ui.dialog.SyncFileNotEnoughSpaceDialogFragmentTest_showNotEnoughSpaceDialogForFile.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.dialog.SyncFileNotEnoughSpaceDialogFragmentTest_showNotEnoughSpaceDialogForFolder.png b/screenshots/com.owncloud.android.ui.dialog.SyncFileNotEnoughSpaceDialogFragmentTest_showNotEnoughSpaceDialogForFolder.png deleted file mode 100644 index 7a00b145cc..0000000000 Binary files a/screenshots/com.owncloud.android.ui.dialog.SyncFileNotEnoughSpaceDialogFragmentTest_showNotEnoughSpaceDialogForFolder.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToCircle.png b/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToCircle.png deleted file mode 100644 index d846734141..0000000000 Binary files a/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToCircle.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToGroup.png b/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToGroup.png deleted file mode 100644 index efa4f3f131..0000000000 Binary files a/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToGroup.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToUser.png b/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToUser.png deleted file mode 100644 index 8e720454be..0000000000 Binary files a/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToUser.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareViaLink.png b/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareViaLink.png deleted file mode 100644 index 40d5d41853..0000000000 Binary files a/screenshots/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareViaLink.png and /dev/null differ diff --git a/screenshots/com.owncloud.android.ui.preview.PreviewTextFileFragmentTest_displayJavaSnippetFile.png b/screenshots/com.owncloud.android.ui.preview.PreviewTextFileFragmentTest_displayJavaSnippetFile.png deleted file mode 100644 index a7cacace5a..0000000000 Binary files a/screenshots/com.owncloud.android.ui.preview.PreviewTextFileFragmentTest_displayJavaSnippetFile.png and /dev/null differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.ActivitiesActivityIT_openDrawer.png b/screenshots/gplay/debug/com.nextcloud.client.ActivitiesActivityIT_openDrawer.png new file mode 100644 index 0000000000..3a33335f37 Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.ActivitiesActivityIT_openDrawer.png differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_drawer.png b/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_drawer.png new file mode 100644 index 0000000000..04a100f758 Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_drawer.png differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_open.png b/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_open.png new file mode 100644 index 0000000000..7d85e14b70 Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_open.png differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_shareToCircle.png b/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_shareToCircle.png new file mode 100644 index 0000000000..b2a4b29266 Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_shareToCircle.png differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_showAccounts.png b/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_showAccounts.png new file mode 100644 index 0000000000..4b6637faa6 Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_showAccounts.png differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_showShares.png b/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_showShares.png new file mode 100644 index 0000000000..ea052a1b16 Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.FileDisplayActivityIT_showShares.png differ diff --git a/screenshots/com.nextcloud.client.FirstRunActivityIT_open.png b/screenshots/gplay/debug/com.nextcloud.client.FirstRunActivityIT_open.png similarity index 100% rename from screenshots/com.nextcloud.client.FirstRunActivityIT_open.png rename to screenshots/gplay/debug/com.nextcloud.client.FirstRunActivityIT_open.png diff --git a/screenshots/gplay/debug/com.nextcloud.client.NotificationsActivityIT_openDrawer.png b/screenshots/gplay/debug/com.nextcloud.client.NotificationsActivityIT_openDrawer.png new file mode 100644 index 0000000000..db43df7920 Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.NotificationsActivityIT_openDrawer.png differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.SettingsActivityIT_open.png b/screenshots/gplay/debug/com.nextcloud.client.SettingsActivityIT_open.png new file mode 100644 index 0000000000..bc2175abe0 Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.SettingsActivityIT_open.png differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.SyncedFoldersActivityIT_openDrawer.png b/screenshots/gplay/debug/com.nextcloud.client.SyncedFoldersActivityIT_openDrawer.png new file mode 100644 index 0000000000..65c68f1b7c Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.SyncedFoldersActivityIT_openDrawer.png differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.UploadListActivityActivityIT_openDrawer.png b/screenshots/gplay/debug/com.nextcloud.client.UploadListActivityActivityIT_openDrawer.png new file mode 100644 index 0000000000..04a35cd208 Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.UploadListActivityActivityIT_openDrawer.png differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.etm.EtmActivityTest_accounts.png b/screenshots/gplay/debug/com.nextcloud.client.etm.EtmActivityTest_accounts.png new file mode 100644 index 0000000000..f72963bc87 Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.etm.EtmActivityTest_accounts.png differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.etm.EtmActivityTest_overview.png b/screenshots/gplay/debug/com.nextcloud.client.etm.EtmActivityTest_overview.png new file mode 100644 index 0000000000..2834f52dfe Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.etm.EtmActivityTest_overview.png differ diff --git a/screenshots/gplay/debug/com.nextcloud.client.etm.EtmActivityTest_preferences.png b/screenshots/gplay/debug/com.nextcloud.client.etm.EtmActivityTest_preferences.png new file mode 100644 index 0000000000..91e2334676 Binary files /dev/null and b/screenshots/gplay/debug/com.nextcloud.client.etm.EtmActivityTest_preferences.png differ diff --git a/screenshots/gplay/debug/com.owncloud.android.ui.activity.ManageAccountsActivityIT_open.png b/screenshots/gplay/debug/com.owncloud.android.ui.activity.ManageAccountsActivityIT_open.png new file mode 100644 index 0000000000..b9982aa062 Binary files /dev/null and b/screenshots/gplay/debug/com.owncloud.android.ui.activity.ManageAccountsActivityIT_open.png differ diff --git a/screenshots/gplay/debug/com.owncloud.android.ui.activity.ManageAccountsActivityIT_userInfoDetail.png b/screenshots/gplay/debug/com.owncloud.android.ui.activity.ManageAccountsActivityIT_userInfoDetail.png new file mode 100644 index 0000000000..dd0ca9f35a Binary files /dev/null and b/screenshots/gplay/debug/com.owncloud.android.ui.activity.ManageAccountsActivityIT_userInfoDetail.png differ diff --git a/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToCircle.png b/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToCircle.png new file mode 100644 index 0000000000..5f325fe862 Binary files /dev/null and b/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToCircle.png differ diff --git a/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToGroup.png b/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToGroup.png new file mode 100644 index 0000000000..6eee47a432 Binary files /dev/null and b/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToGroup.png differ diff --git a/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToUser.png b/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToUser.png new file mode 100644 index 0000000000..542b071865 Binary files /dev/null and b/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareToUser.png differ diff --git a/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareViaLink.png b/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareViaLink.png new file mode 100644 index 0000000000..dcad2c00d1 Binary files /dev/null and b/screenshots/gplay/debug/com.owncloud.android.ui.fragment.OCFileListFragmentIT_createAndShowShareViaLink.png differ diff --git a/screenshots/gplay/debug/com.owncloud.android.ui.preview.PreviewTextFileFragmentTest_displayJavaSnippetFile.png b/screenshots/gplay/debug/com.owncloud.android.ui.preview.PreviewTextFileFragmentTest_displayJavaSnippetFile.png new file mode 100644 index 0000000000..b19fe8c00f Binary files /dev/null and b/screenshots/gplay/debug/com.owncloud.android.ui.preview.PreviewTextFileFragmentTest_displayJavaSnippetFile.png differ diff --git a/screenshots/com.owncloud.android.ui.preview.PreviewTextFileFragmentTest_displaySimpleTextFile.png b/screenshots/gplay/debug/com.owncloud.android.ui.preview.PreviewTextFileFragmentTest_displaySimpleTextFile.png similarity index 100% rename from screenshots/com.owncloud.android.ui.preview.PreviewTextFileFragmentTest_displaySimpleTextFile.png rename to screenshots/gplay/debug/com.owncloud.android.ui.preview.PreviewTextFileFragmentTest_displaySimpleTextFile.png diff --git a/screenshots/gplay/debug/richworkspaces_dark.png b/screenshots/gplay/debug/richworkspaces_dark.png new file mode 100644 index 0000000000..63c268c11f Binary files /dev/null and b/screenshots/gplay/debug/richworkspaces_dark.png differ diff --git a/screenshots/gplay/debug/richworkspaces_light.png b/screenshots/gplay/debug/richworkspaces_light.png new file mode 100644 index 0000000000..61aa1828c7 Binary files /dev/null and b/screenshots/gplay/debug/richworkspaces_light.png differ diff --git a/screenshots/richworkspaces_dark.png b/screenshots/richworkspaces_dark.png deleted file mode 100644 index 064afd7e13..0000000000 Binary files a/screenshots/richworkspaces_dark.png and /dev/null differ diff --git a/screenshots/richworkspaces_light.png b/screenshots/richworkspaces_light.png deleted file mode 100644 index c271fa791f..0000000000 Binary files a/screenshots/richworkspaces_light.png and /dev/null differ diff --git a/scripts/updateScreenshots.sh b/scripts/updateScreenshots.sh index 0ef1c34089..adcb2c53de 100755 --- a/scripts/updateScreenshots.sh +++ b/scripts/updateScreenshots.sh @@ -1,22 +1,22 @@ #!/usr/bin/env bash -if ( [[ $(grep NC_TEST_SERVER_BASEURL ~/.gradle/gradle.properties | grep -v "#" -c) -gt 0 ]] ); then +if [[ $(grep NC_TEST_SERVER_BASEURL ~/.gradle/gradle.properties | grep -v "#" -c) -gt 0 ]]; then echo "This will not use server in docker. Please comment in .gradle/gradle.properties. Aborting!" exit 1 fi ## emulator -if ( [[ ! $(emulator -list-avds | grep uiComparison -c) -eq 0 ]] ); then +if [[ ! $(emulator -list-avds | grep uiComparison -c) -eq 0 ]]; then avdmanager delete avd -n uiComparison (sleep 5; echo "no") | avdmanager create avd -n uiComparison -c 100M -k "system-images;android-27;google_apis;x86" --abi "google_apis/x86" fi -if [ $1 == "debug" ]; then - emulator -avd uiComparison -no-snapshot -gpu swiftshader_indirect -no-audio -skin 500x833 1>/dev/null & +if [ "$1" == "debug" ]; then + emulator -writable-system -avd uiComparison -no-snapshot -gpu swiftshader_indirect -no-audio -skin 500x833 1>/dev/null & else - emulator -avd uiComparison -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 1>/dev/null & + emulator -writable-system -avd uiComparison -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 1>/dev/null & fi -PID=$(echo $!) +PID=$! ## server docker run --name=uiComparison nextcloudci/server --entrypoint '/usr/local/bin/initnc.sh' 1>/dev/null & @@ -29,14 +29,10 @@ if [[ $IP = "" ]]; then fi ## wait for server to finish -scripts/wait_for_server.sh $IP - -## run on server -cp gradle.properties gradle.properties_ -sed -i s"/server/$IP/" gradle.properties -scripts/wait_for_emulator.sh +scripts/wait_for_server.sh "$IP" # setup test server +docker exec uiComparison /bin/sh -c "echo $IP server >> /etc/hosts" docker exec uiComparison /bin/sh -c "su www-data -c \"OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1\"" docker exec uiComparison /bin/sh -c "su www-data -c \"OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2\"" docker exec uiComparison /bin/sh -c "su www-data -c \"OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3\"" @@ -44,40 +40,57 @@ docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ user docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ group:add users\"" docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ group:adduser users user1\"" docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ group:adduser users user2\"" +docker exec uiComparison /bin/sh -c "su www-data -c \"git clone -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/\"" +docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ app:enable activity\"" docker exec uiComparison /bin/sh -c "su www-data -c \"git clone -b master https://github.com/nextcloud/text.git /var/www/html/apps/text/\"" docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ app:enable text\"" -docker exec uiComparison /bin/sh -c "su www-data -c \"git clone -b master https://github.com/nextcloud/circles.git /var/www/html/apps/circles/\"" -docker exec uiComparison /bin/sh -c "apt-get update; apt-get -y install composer" -docker exec uiComparison /bin/sh -c "su www-data -c \"cd /var/www/html/apps/circles; composer install\"" -docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ app:enable -f circles\"" -docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ config:app:set circles --value 1 allow_non_ssl_links\"" -docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ config:app:set circles --value 1 local_is_non_ssl\"" -docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ config:system:set allow_local_remote_servers --value true --type bool\"" -docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ circles:manage:create test public publicCircle\"" +docker exec uiComparison /bin/sh -c "su www-data -c \"git clone -b master https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/\"" +docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ app:enable end_to_end_encryption\"" +#docker exec uiComparison /bin/sh -c "su www-data -c \"git clone -b master https://github.com/nextcloud/circles.git /var/www/html/apps/circles/\"" +#docker exec uiComparison /bin/sh -c "apt-get update; apt-get -y install composer" +#docker exec uiComparison /bin/sh -c "su www-data -c \"cd /var/www/html/apps/circles; composer install\"" +#docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ app:enable -f circles\"" +#docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ config:app:set circles --value 1 allow_non_ssl_links\"" +#docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ config:app:set circles --value 1 local_is_non_ssl\"" +#docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ config:system:set allow_local_remote_servers --value true --type bool\"" +#docker exec uiComparison /bin/sh -c "su www-data -c \"php /var/www/html/occ circles:manage:create test public publicCircle\"" docker exec uiComparison /bin/sh -c "/usr/local/bin/run.sh" +## wait for server to finish +scripts/wait_for_server.sh "$IP" + +scripts/wait_for_emulator.sh + +# change server to ip on emulator +adb root +sleep 2 +adb remount +sleep 2 +adb shell "mount -o remount,rw /system" +sleep 2 +adb shell "echo $IP server >> /system/etc/hosts" + ## update/create all screenshots -./gradlew executeScreenshotTests -Precord +./gradlew gplayDebugExecuteScreenshotTests -Precord \ +-Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest ## update screenshots in a class -#./gradlew executeScreenshotTests \ +#./gradlew gplayDebugExecuteScreenshotTests \ #-Precord \ #-Pandroid.testInstrumentationRunnerArguments.class=\ #com.owncloud.android.ui.dialog.SyncFileNotEnoughSpaceDialogFragmentTest ## update single screenshot within a class -#./gradlew executeScreenshotTests \ +#./gradlew gplayDebugExecuteScreenshotTests \ #-Precord \ #-Pandroid.testInstrumentationRunnerArguments.class=\ #com.owncloud.android.ui.dialog.SyncFileNotEnoughSpaceDialogFragmentTest#showNotEnoughSpaceDialogForFile -mv gradle.properties_ gradle.properties - -if [ $1 == "debug" ]; then +if [ "$1" == "debug" ]; then exit fi # tidy up -kill $PID +kill "$PID" docker stop uiComparison docker rm uiComparison diff --git a/scripts/wait_for_server.sh b/scripts/wait_for_server.sh index 789625b552..76e6a73973 100755 --- a/scripts/wait_for_server.sh +++ b/scripts/wait_for_server.sh @@ -10,7 +10,7 @@ until [[ $status = "false" ]]; do if [[ "$status" =~ "false" || "$status" = "" ]]; then let "counter += 1" - if [[ $counter -gt 30 ]]; then + if [[ $counter -gt 50 ]]; then echo "Failed to wait for server" exit 1 fi diff --git a/src/androidTest/java/com/nextcloud/client/ActivitiesActivityIT.java b/src/androidTest/java/com/nextcloud/client/ActivitiesActivityIT.java index 6e870b6918..ecbd74c8b1 100644 --- a/src/androidTest/java/com/nextcloud/client/ActivitiesActivityIT.java +++ b/src/androidTest/java/com/nextcloud/client/ActivitiesActivityIT.java @@ -26,6 +26,7 @@ import android.Manifest; import com.owncloud.android.AbstractIT; import com.owncloud.android.ui.activities.ActivitiesActivity; +import com.owncloud.android.utils.ScreenshotTest; import org.junit.Rule; import org.junit.Test; @@ -44,7 +45,8 @@ public class ActivitiesActivityIT extends AbstractIT { Manifest.permission.WRITE_EXTERNAL_STORAGE); @Test - public void openDrawer() throws InterruptedException { + @ScreenshotTest + public void openDrawer() { super.openDrawer(activityRule); } } diff --git a/src/androidTest/java/com/nextcloud/client/FileDisplayActivityIT.java b/src/androidTest/java/com/nextcloud/client/FileDisplayActivityIT.java index b066cfa19c..8e5fa9064b 100644 --- a/src/androidTest/java/com/nextcloud/client/FileDisplayActivityIT.java +++ b/src/androidTest/java/com/nextcloud/client/FileDisplayActivityIT.java @@ -38,6 +38,7 @@ import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.operations.CreateFolderOperation; import com.owncloud.android.ui.activity.FileDisplayActivity; import com.owncloud.android.ui.events.SearchEvent; +import com.owncloud.android.utils.ScreenshotTest; import org.greenrobot.eventbus.EventBus; import org.junit.Assert; @@ -56,7 +57,6 @@ import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentat import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertTrue; - public class FileDisplayActivityIT extends AbstractIT { @Rule public IntentsTestRule activityRule = new IntentsTestRule<>(FileDisplayActivity.class, true, @@ -67,6 +67,7 @@ public class FileDisplayActivityIT extends AbstractIT { Manifest.permission.WRITE_EXTERNAL_STORAGE); @Test + @ScreenshotTest public void open() { Activity sut = activityRule.launchActivity(null); @@ -76,15 +77,19 @@ public class FileDisplayActivityIT extends AbstractIT { } @Test + @ScreenshotTest public void drawer() { Activity sut = activityRule.launchActivity(null); onView(withId(R.id.drawer_layout)).perform(DrawerActions.open()); + waitForIdleSync(); + Screenshot.snapActivity(sut).record(); } @Test + @ScreenshotTest public void showShares() { assertTrue(new ExistenceCheckRemoteOperation("/shareToAdmin/", true).execute(client).isSuccess()); assertTrue(new CreateFolderRemoteOperation("/shareToAdmin/", true).execute(client).isSuccess()); @@ -148,6 +153,7 @@ public class FileDisplayActivityIT extends AbstractIT { } @Test + @ScreenshotTest public void showAccounts() { Activity sut = activityRule.launchActivity(null); diff --git a/src/androidTest/java/com/nextcloud/client/FirstRunActivityIT.java b/src/androidTest/java/com/nextcloud/client/FirstRunActivityIT.java index 2561b9d799..c28cc56fa3 100644 --- a/src/androidTest/java/com/nextcloud/client/FirstRunActivityIT.java +++ b/src/androidTest/java/com/nextcloud/client/FirstRunActivityIT.java @@ -28,6 +28,7 @@ import android.app.Activity; import com.facebook.testing.screenshot.Screenshot; import com.nextcloud.client.onboarding.FirstRunActivity; import com.owncloud.android.AbstractIT; +import com.owncloud.android.utils.ScreenshotTest; import org.junit.Rule; import org.junit.Test; @@ -46,6 +47,7 @@ public class FirstRunActivityIT extends AbstractIT { Manifest.permission.WRITE_EXTERNAL_STORAGE); @Test + @ScreenshotTest public void open() { Activity sut = activityRule.launchActivity(null); diff --git a/src/androidTest/java/com/nextcloud/client/NotificationsActivityIT.java b/src/androidTest/java/com/nextcloud/client/NotificationsActivityIT.java index 6047778533..f4ba1bc39e 100644 --- a/src/androidTest/java/com/nextcloud/client/NotificationsActivityIT.java +++ b/src/androidTest/java/com/nextcloud/client/NotificationsActivityIT.java @@ -26,6 +26,7 @@ import android.Manifest; import com.owncloud.android.AbstractIT; import com.owncloud.android.ui.activity.NotificationsActivity; +import com.owncloud.android.utils.ScreenshotTest; import org.junit.Rule; import org.junit.Test; @@ -44,7 +45,8 @@ public class NotificationsActivityIT extends AbstractIT { Manifest.permission.WRITE_EXTERNAL_STORAGE); @Test - public void openDrawer() throws InterruptedException { + @ScreenshotTest + public void openDrawer() { super.openDrawer(activityRule); } } diff --git a/src/androidTest/java/com/nextcloud/client/SettingsActivityIT.java b/src/androidTest/java/com/nextcloud/client/SettingsActivityIT.java index d1f027bd5b..b850f81339 100644 --- a/src/androidTest/java/com/nextcloud/client/SettingsActivityIT.java +++ b/src/androidTest/java/com/nextcloud/client/SettingsActivityIT.java @@ -28,6 +28,7 @@ import android.app.Activity; import com.facebook.testing.screenshot.Screenshot; import com.owncloud.android.AbstractIT; import com.owncloud.android.ui.activity.SettingsActivity; +import com.owncloud.android.utils.ScreenshotTest; import org.junit.Rule; import org.junit.Test; @@ -46,6 +47,7 @@ public class SettingsActivityIT extends AbstractIT { Manifest.permission.WRITE_EXTERNAL_STORAGE); @Test + @ScreenshotTest public void open() { Activity test = activityRule.launchActivity(null); diff --git a/src/androidTest/java/com/nextcloud/client/SyncedFoldersActivityIT.java b/src/androidTest/java/com/nextcloud/client/SyncedFoldersActivityIT.java index e204efd152..122ee1830a 100644 --- a/src/androidTest/java/com/nextcloud/client/SyncedFoldersActivityIT.java +++ b/src/androidTest/java/com/nextcloud/client/SyncedFoldersActivityIT.java @@ -26,6 +26,7 @@ import android.Manifest; import com.owncloud.android.AbstractIT; import com.owncloud.android.ui.activity.SyncedFoldersActivity; +import com.owncloud.android.utils.ScreenshotTest; import org.junit.Rule; import org.junit.Test; @@ -44,7 +45,8 @@ public class SyncedFoldersActivityIT extends AbstractIT { Manifest.permission.WRITE_EXTERNAL_STORAGE); @Test - public void openDrawer() throws InterruptedException { + @ScreenshotTest + public void openDrawer() { super.openDrawer(activityRule); } } diff --git a/src/androidTest/java/com/nextcloud/client/UploadListActivityActivityIT.java b/src/androidTest/java/com/nextcloud/client/UploadListActivityActivityIT.java index aceb9e0a13..7d210278f3 100644 --- a/src/androidTest/java/com/nextcloud/client/UploadListActivityActivityIT.java +++ b/src/androidTest/java/com/nextcloud/client/UploadListActivityActivityIT.java @@ -26,6 +26,7 @@ import android.Manifest; import com.owncloud.android.AbstractIT; import com.owncloud.android.ui.activity.UploadListActivity; +import com.owncloud.android.utils.ScreenshotTest; import org.junit.Rule; import org.junit.Test; @@ -44,7 +45,8 @@ public class UploadListActivityActivityIT extends AbstractIT { Manifest.permission.WRITE_EXTERNAL_STORAGE); @Test - public void openDrawer() throws InterruptedException { + @ScreenshotTest + public void openDrawer() { super.openDrawer(activityRule); } } diff --git a/src/androidTest/java/com/nextcloud/client/etm/EtmActivityTest.kt b/src/androidTest/java/com/nextcloud/client/etm/EtmActivityTest.kt index 070c1a2a73..eb41c91cfc 100644 --- a/src/androidTest/java/com/nextcloud/client/etm/EtmActivityTest.kt +++ b/src/androidTest/java/com/nextcloud/client/etm/EtmActivityTest.kt @@ -27,6 +27,7 @@ import androidx.test.espresso.intent.rule.IntentsTestRule import androidx.test.internal.runner.junit4.statement.UiThreadStatement import com.facebook.testing.screenshot.Screenshot import com.owncloud.android.AbstractIT +import com.owncloud.android.utils.ScreenshotTest import org.junit.Rule import org.junit.Test @@ -35,6 +36,7 @@ class EtmActivityTest : AbstractIT() { var activityRule = IntentsTestRule(EtmActivity::class.java, true, false) @Test + @ScreenshotTest fun overview() { val sut: Activity = activityRule.launchActivity(null) @@ -44,6 +46,7 @@ class EtmActivityTest : AbstractIT() { } @Test + @ScreenshotTest fun preferences() { val sut: EtmActivity = activityRule.launchActivity(null) @@ -53,6 +56,7 @@ class EtmActivityTest : AbstractIT() { } @Test + @ScreenshotTest fun accounts() { val sut: EtmActivity = activityRule.launchActivity(null) diff --git a/src/androidTest/java/com/owncloud/android/AbstractIT.java b/src/androidTest/java/com/owncloud/android/AbstractIT.java index 1e8e8f1d38..fc8edfcb76 100644 --- a/src/androidTest/java/com/owncloud/android/AbstractIT.java +++ b/src/androidTest/java/com/owncloud/android/AbstractIT.java @@ -68,7 +68,6 @@ import static org.junit.Assert.assertTrue; * Common base for all integration tests */ -//@RunWith(AndroidJUnit4.class) public abstract class AbstractIT { @Rule public RetryTestRule retryTestRule = new RetryTestRule(); @@ -221,7 +220,7 @@ public abstract class AbstractIT { InstrumentationRegistry.getInstrumentation().waitForIdleSync(); } - protected void openDrawer(IntentsTestRule activityRule) throws InterruptedException { + protected void openDrawer(IntentsTestRule activityRule) { Activity sut = activityRule.launchActivity(null); shortSleep(); diff --git a/src/androidTest/java/com/owncloud/android/ui/activity/FolderPickerActivityIT.java b/src/androidTest/java/com/owncloud/android/ui/activity/FolderPickerActivityIT.java index 70f29d2884..8218ba74ed 100644 --- a/src/androidTest/java/com/owncloud/android/ui/activity/FolderPickerActivityIT.java +++ b/src/androidTest/java/com/owncloud/android/ui/activity/FolderPickerActivityIT.java @@ -29,11 +29,10 @@ import org.junit.Test; import org.junit.runner.RunWith; import androidx.test.ext.junit.runners.AndroidJUnit4; -import androidx.test.filters.LargeTest; import androidx.test.rule.ActivityTestRule; @RunWith(AndroidJUnit4.class) -@LargeTest +//@LargeTest public class FolderPickerActivityIT { @Rule public ActivityTestRule activityRule = diff --git a/src/androidTest/java/com/owncloud/android/ui/activity/ManageAccountsActivityIT.java b/src/androidTest/java/com/owncloud/android/ui/activity/ManageAccountsActivityIT.java index a6a36fbb6b..132862c994 100644 --- a/src/androidTest/java/com/owncloud/android/ui/activity/ManageAccountsActivityIT.java +++ b/src/androidTest/java/com/owncloud/android/ui/activity/ManageAccountsActivityIT.java @@ -27,6 +27,7 @@ import android.app.Activity; import com.facebook.testing.screenshot.Screenshot; import com.nextcloud.client.account.User; import com.owncloud.android.AbstractIT; +import com.owncloud.android.utils.ScreenshotTest; import org.junit.Rule; import org.junit.Test; @@ -40,6 +41,7 @@ public class ManageAccountsActivityIT extends AbstractIT { false); @Test + @ScreenshotTest public void open() { Activity sut = activityRule.launchActivity(null); @@ -49,6 +51,7 @@ public class ManageAccountsActivityIT extends AbstractIT { } @Test + @ScreenshotTest public void userInfoDetail() { ManageAccountsActivity sut = activityRule.launchActivity(null); diff --git a/src/androidTest/java/com/owncloud/android/ui/fragment/OCFileListFragmentIT.kt b/src/androidTest/java/com/owncloud/android/ui/fragment/OCFileListFragmentIT.kt index 3a8488bbd8..8be7bcd38b 100644 --- a/src/androidTest/java/com/owncloud/android/ui/fragment/OCFileListFragmentIT.kt +++ b/src/androidTest/java/com/owncloud/android/ui/fragment/OCFileListFragmentIT.kt @@ -49,6 +49,7 @@ import com.owncloud.android.operations.RefreshFolderOperation import com.owncloud.android.operations.UploadFileOperation import com.owncloud.android.ui.activity.FileDisplayActivity import com.owncloud.android.utils.FileStorageUtils +import com.owncloud.android.utils.ScreenshotTest import junit.framework.TestCase import org.junit.Assert.assertTrue import org.junit.Rule @@ -88,6 +89,7 @@ class OCFileListFragmentIT : AbstractIT() { } @Test + @ScreenshotTest fun showRichWorkspace() { assertTrue(CreateFolderOperation("/test/", account, targetContext).execute(client, storageManager).isSuccess) @@ -155,6 +157,7 @@ class OCFileListFragmentIT : AbstractIT() { } @Test + @ScreenshotTest fun createAndShowShareToUser() { val path = "/shareToAdmin/" TestCase.assertTrue(CreateFolderOperation(path, account, targetContext) @@ -179,6 +182,7 @@ class OCFileListFragmentIT : AbstractIT() { } @Test + @ScreenshotTest fun createAndShowShareToGroup() { val path = "/shareToGroup/" TestCase.assertTrue(CreateFolderOperation(path, account, targetContext) @@ -203,6 +207,7 @@ class OCFileListFragmentIT : AbstractIT() { } // @Test +// @ScreenshotTest // fun createAndShowShareToCircle() { // val path = "/shareToCircle/" // TestCase.assertTrue(CreateFolderOperation(path, account, targetContext) @@ -234,6 +239,7 @@ class OCFileListFragmentIT : AbstractIT() { // } @Test + @ScreenshotTest fun createAndShowShareViaLink() { val path = "/shareViaLink/" TestCase.assertTrue(CreateFolderOperation(path, account, targetContext) diff --git a/src/androidTest/java/com/owncloud/android/ui/preview/PreviewTextFileFragmentTest.java b/src/androidTest/java/com/owncloud/android/ui/preview/PreviewTextFileFragmentTest.java index 0c64a98941..694ea3f535 100644 --- a/src/androidTest/java/com/owncloud/android/ui/preview/PreviewTextFileFragmentTest.java +++ b/src/androidTest/java/com/owncloud/android/ui/preview/PreviewTextFileFragmentTest.java @@ -30,6 +30,7 @@ import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.ui.activity.FileDisplayActivity; import com.owncloud.android.utils.FileStorageUtils; import com.owncloud.android.utils.MimeTypeUtil; +import com.owncloud.android.utils.ScreenshotTest; import org.junit.Rule; import org.junit.Test; @@ -50,7 +51,8 @@ public class PreviewTextFileFragmentTest extends AbstractIT { Manifest.permission.WRITE_EXTERNAL_STORAGE); @Test - public void displaySimpleTextFile() throws InterruptedException { + @ScreenshotTest + public void displaySimpleTextFile() { FileDisplayActivity sut = activityRule.launchActivity(null); shortSleep(); @@ -67,7 +69,8 @@ public class PreviewTextFileFragmentTest extends AbstractIT { } @Test - public void displayJavaSnippetFile() throws IOException, InterruptedException { + @ScreenshotTest + public void displayJavaSnippetFile() throws IOException { FileDisplayActivity sut = activityRule.launchActivity(null); shortSleep(); diff --git a/src/main/java/com/owncloud/android/utils/ScreenshotTest.java b/src/main/java/com/owncloud/android/utils/ScreenshotTest.java new file mode 100644 index 0000000000..015ca71a4a --- /dev/null +++ b/src/main/java/com/owncloud/android/utils/ScreenshotTest.java @@ -0,0 +1,37 @@ +/* + * + * Nextcloud Android client application + * + * @author Tobias Kaminsky + * Copyright (C) 2020 Tobias Kaminsky + * Copyright (C) 2020 Nextcloud GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package com.owncloud.android.utils; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotate any screenshot test with this so it is run only when updating/testing screenshots + */ + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface ScreenshotTest { +}