Compare commits
26
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61fe75e981 | ||
|
|
2a01aca904 | ||
|
|
87855c1335 | ||
|
|
0f54b71716 | ||
|
|
4ce14abb2c | ||
|
|
bff8068f2b | ||
|
|
0960d08321 | ||
|
|
b17373cddf | ||
|
|
0d6114283d | ||
|
|
d7122e70e4 | ||
|
|
f47fa94046 | ||
|
|
f303cd0dab | ||
|
|
56f8b3befc | ||
|
|
65acb834ef | ||
|
|
f7c8bf2f4c | ||
|
|
2b69892694 | ||
|
|
af606603de | ||
|
|
f22b386cc5 | ||
|
|
724147d272 | ||
|
|
235ca28bc6 | ||
|
|
1c19846711 | ||
|
|
87a8ab5f07 | ||
|
|
339770fa92 | ||
|
|
068ff229a7 | ||
|
|
aa11e9b1ee | ||
|
|
2ff6d73470 |
No files matched your search
+1
-4
@@ -16,9 +16,6 @@ comment:
|
||||
layout: "header, diff, changes, uncovered, tree"
|
||||
behavior: default
|
||||
|
||||
github_checks:
|
||||
annotations: false
|
||||
|
||||
ignore:
|
||||
- "src/main/res/values*/*"
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
FROM ubuntu:focal
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ENV ANDROID_HOME=/usr/lib/android-sdk
|
||||
|
||||
RUN apt-get update -y
|
||||
RUN apt-get install -y unzip wget openjdk-8-jdk vim
|
||||
|
||||
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip -O /tmp/commandlinetools.zip
|
||||
RUN cd /tmp && unzip commandlinetools.zip
|
||||
RUN mkdir -p /usr/lib/android-sdk/cmdline-tools/
|
||||
RUN cd /tmp/ && mv cmdline-tools/ latest/ && mv latest/ /usr/lib/android-sdk/cmdline-tools/
|
||||
RUN mkdir /usr/lib/android-sdk/licenses/
|
||||
RUN chmod -R 755 /usr/lib/android-sdk/
|
||||
RUN mkdir -p $HOME/.gradle
|
||||
RUN echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties
|
||||
@@ -1,5 +0,0 @@
|
||||
# Instructions
|
||||
|
||||
1. Start a DevContainer either on GitHub Codespaces or locally in VSCode.
|
||||
2. Accept all licenses by running `yes | /usr/lib/android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses`.
|
||||
3. You can now build the app using `./gradlew clean build`.
|
||||
@@ -1,3 +0,0 @@
|
||||
ANDROID_HOME=/usr/lib/android-sdk
|
||||
JAVA_OPTS="-Xmx8192M"
|
||||
GRADLE_OPTS="-Dorg.gradle.daemon=true"
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"name": "NextcloudAndroid",
|
||||
"dockerFile": "Dockerfile",
|
||||
}
|
||||
+86
-112
@@ -1,11 +1,58 @@
|
||||
kind: pipeline
|
||||
name: generic
|
||||
|
||||
steps:
|
||||
- name: generic
|
||||
image: nextcloudci/android:android-49
|
||||
environment:
|
||||
GIT_USERNAME:
|
||||
from_secret: GIT_USERNAME
|
||||
GIT_TOKEN:
|
||||
from_secret: GIT_TOKEN
|
||||
commands:
|
||||
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
|
||||
- ./gradlew assembleGeneric
|
||||
|
||||
- name: notify
|
||||
image: drillster/drone-email
|
||||
settings:
|
||||
port: 587
|
||||
from: [email protected]
|
||||
recipients_only: true
|
||||
username:
|
||||
from_secret: EMAIL_USERNAME
|
||||
password:
|
||||
from_secret: EMAIL_PASSWORD
|
||||
recipients:
|
||||
from_secret: EMAIL_RECIPIENTS
|
||||
host:
|
||||
from_secret: EMAIL_HOST
|
||||
GIT_USERNAME:
|
||||
from_secret: GIT_USERNAME
|
||||
GIT_TOKEN:
|
||||
from_secret: GIT_TOKEN
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
status:
|
||||
- failure
|
||||
branch:
|
||||
- master
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- pull_request
|
||||
- push
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: tests-stable
|
||||
name: gplay
|
||||
|
||||
steps:
|
||||
- name: gplay
|
||||
image: ghcr.io/nextcloud/continuous-integration-android8:2
|
||||
image: nextcloudci/android:android-49
|
||||
privileged: true
|
||||
environment:
|
||||
LOG_USERNAME:
|
||||
@@ -16,22 +63,20 @@ steps:
|
||||
from_secret: GIT_USERNAME
|
||||
GIT_TOKEN:
|
||||
from_secret: GIT_TOKEN
|
||||
ORG_GRADLE_PROJECT_coverage: ''
|
||||
commands:
|
||||
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
|
||||
- emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
|
||||
- sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g src/main/res/values/setup.xml
|
||||
- sed -i s"#server#server#" gradle.properties
|
||||
- sed -i s"#1#5#" ./src/androidTest/java/com/nextcloud/client/RetryTestRule.kt
|
||||
- emulator-headless -avd android-27 -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
|
||||
- ./gradlew assembleGplay
|
||||
- ./gradlew assembleGplayDebug
|
||||
- scripts/wait_for_emulator.sh
|
||||
- scripts/deleteOldComments.sh "stable" "Unit" $DRONE_PULL_REQUEST $GIT_TOKEN
|
||||
- ./gradlew jacocoTestGplayDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "Unit" $DRONE_PULL_REQUEST $GIT_TOKEN
|
||||
- ./gradlew jacocoTestGplayDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
|
||||
- ./gradlew installGplayDebugAndroidTest
|
||||
- scripts/wait_for_server.sh "server"
|
||||
- scripts/deleteOldComments.sh "stable" "IT" $DRONE_PULL_REQUEST $GIT_TOKEN
|
||||
- ./gradlew createGplayDebugCoverageReport -Pcoverage -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "IT" $DRONE_PULL_REQUEST $GIT_TOKEN
|
||||
- ./gradlew createGplayDebugCoverageReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
|
||||
- ./gradlew executeScreenshotTests || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "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
|
||||
- name: notify
|
||||
image: drillster/drone-email
|
||||
settings:
|
||||
@@ -53,62 +98,37 @@ steps:
|
||||
- failure
|
||||
branch:
|
||||
- master
|
||||
- stable-*
|
||||
|
||||
services:
|
||||
- name: server
|
||||
image: nextcloudci/server:server-17 # also change in updateScreenshots.sh
|
||||
environment:
|
||||
EVAL: true
|
||||
commands:
|
||||
- BRANCH='stable22' /usr/local/bin/initnc.sh
|
||||
- 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"
|
||||
- su www-data -c "php /var/www/html/occ user:setting user2 files quota 1G"
|
||||
- su www-data -c "php /var/www/html/occ group:add users"
|
||||
- su www-data -c "php /var/www/html/occ group:adduser users user1"
|
||||
- su www-data -c "php /var/www/html/occ group:adduser users user2"
|
||||
- su www-data -c "git clone -b stable22 https://github.com/nextcloud/activity.git /var/www/html/apps/activity/"
|
||||
- su www-data -c "php /var/www/html/occ app:enable activity"
|
||||
- su www-data -c "git clone -b stable22 https://github.com/nextcloud/text.git /var/www/html/apps/text/"
|
||||
- su www-data -c "php /var/www/html/occ app:enable text"
|
||||
- su www-data -c "git clone -b stable22 https://github.com/nextcloud/end_to_end_encryption.git /var/www/html/apps/end_to_end_encryption/"
|
||||
- su www-data -c "php /var/www/html/occ app:enable end_to_end_encryption"
|
||||
- /usr/local/bin/run.sh
|
||||
image: nextcloudci/server:server-3
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
- stable-*
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: tests-master
|
||||
name: analysis
|
||||
|
||||
steps:
|
||||
- name: gplay
|
||||
image: ghcr.io/nextcloud/continuous-integration-android8:2
|
||||
privileged: true
|
||||
- name: analysis
|
||||
image: nextcloudci/android:android-49
|
||||
environment:
|
||||
LOG_USERNAME:
|
||||
from_secret: LOG_USERNAME
|
||||
LOG_PASSWORD:
|
||||
from_secret: LOG_PASSWORD
|
||||
GIT_USERNAME:
|
||||
from_secret: GIT_USERNAME
|
||||
GIT_TOKEN:
|
||||
from_secret: GIT_TOKEN
|
||||
LOG_USERNAME:
|
||||
from_secret: LOG_USERNAME
|
||||
LOG_PASSWORD:
|
||||
from_secret: LOG_PASSWORD
|
||||
commands:
|
||||
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
|
||||
- emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
|
||||
- sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g src/main/res/values/setup.xml
|
||||
- sed -i s"#1#5#" ./src/androidTest/java/com/nextcloud/client/RetryTestRule.kt
|
||||
- scripts/runCombinedTest.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER
|
||||
- export BRANCH=$(scripts/analysis/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST)
|
||||
- scripts/analysis/analysis-wrapper.sh $GIT_USERNAME $GIT_TOKEN $BRANCH $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST
|
||||
|
||||
- name: notify
|
||||
image: drillster/drone-email
|
||||
@@ -131,88 +151,42 @@ steps:
|
||||
- failure
|
||||
branch:
|
||||
- master
|
||||
- stable-*
|
||||
|
||||
services:
|
||||
- name: server
|
||||
image: nextcloudci/server:server-17 # also change in updateScreenshots.sh
|
||||
environment:
|
||||
EVAL: true
|
||||
commands:
|
||||
- /usr/local/bin/initnc.sh
|
||||
- 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"
|
||||
- su www-data -c "php /var/www/html/occ user:setting user2 files quota 1G"
|
||||
- su www-data -c "php /var/www/html/occ group:add users"
|
||||
- su www-data -c "php /var/www/html/occ group:adduser users user1"
|
||||
- su www-data -c "php /var/www/html/occ group:adduser users user2"
|
||||
- su www-data -c "git clone -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/"
|
||||
- su www-data -c "php /var/www/html/occ app:enable activity"
|
||||
- su www-data -c "git clone -b master https://github.com/nextcloud/text.git /var/www/html/apps/text/"
|
||||
- su www-data -c "php /var/www/html/occ app:enable text"
|
||||
- su www-data -c "git clone -b master https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/"
|
||||
- su www-data -c "php /var/www/html/occ app:enable end_to_end_encryption"
|
||||
- /usr/local/bin/run.sh
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
- stable-*
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: allScreenshots
|
||||
name: qa
|
||||
|
||||
steps:
|
||||
- name: runAllScreenshots
|
||||
image: ghcr.io/nextcloud/continuous-integration-android8:2
|
||||
- name: qa
|
||||
image: nextcloudci/android:android-49
|
||||
privileged: true
|
||||
environment:
|
||||
GIT_USERNAME:
|
||||
from_secret: GIT_USERNAME
|
||||
GIT_TOKEN:
|
||||
from_secret: GIT_TOKEN
|
||||
LOG_USERNAME:
|
||||
from_secret: LOG_USERNAME
|
||||
LOG_PASSWORD:
|
||||
from_secret: LOG_PASSWORD
|
||||
GIT_USERNAME:
|
||||
from_secret: GIT_USERNAME
|
||||
GIT_TOKEN:
|
||||
from_secret: GIT_TOKEN
|
||||
KS_PASS:
|
||||
from_secret: KS_PASS
|
||||
KEY_PASS:
|
||||
from_secret: KEY_PASS
|
||||
commands:
|
||||
- emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
|
||||
- sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g src/main/res/values/setup.xml
|
||||
- sed -i s'#showOnlyFailingTestsInReports = ciBuild#showOnlyFailingTestsInReports = false#' build.gradle
|
||||
- scripts/wait_for_emulator.sh
|
||||
- scripts/runAllScreenshotCombinations noCI false
|
||||
- scripts/screenshotSummary.sh
|
||||
- name: notify
|
||||
image: drillster/drone-email
|
||||
settings:
|
||||
port: 587
|
||||
from: [email protected]
|
||||
recipients_only: true
|
||||
username:
|
||||
from_secret: EMAIL_USERNAME
|
||||
password:
|
||||
from_secret: EMAIL_PASSWORD
|
||||
recipients:
|
||||
from_secret: EMAIL_RECIPIENTS
|
||||
host:
|
||||
from_secret: EMAIL_HOST
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
status:
|
||||
- failure
|
||||
branch:
|
||||
- master
|
||||
- stable-*
|
||||
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
|
||||
- sed -i "/qa/,/\}/ s/versionCode .*/versionCode $DRONE_BUILD_NUMBER/" build.gradle
|
||||
- sed -i "/qa/,/\}/ s/versionName .*/versionName \"$DRONE_BUILD_NUMBER\"/" build.gradle
|
||||
- ./gradlew assembleQaDebug
|
||||
- /opt/android-sdk-linux/build-tools/*/apksigner sign --ks-pass pass:$KS_PASS --key-pass pass:$KEY_PASS --ks-key-alias key0 --ks scripts/QA_keystore.jks build/outputs/apk/qa/debug/qa-debug-*.apk
|
||||
- scripts/uploadArtifact.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- cron
|
||||
cron:
|
||||
- allscreenshots
|
||||
- pull_request
|
||||
@@ -13,9 +13,6 @@ max_line_length=120
|
||||
indent_style=space
|
||||
indent_size=4
|
||||
|
||||
[*.yml]
|
||||
max_line_length=150
|
||||
|
||||
charset=utf-8
|
||||
|
||||
# Trimming is good for consistency
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
firstPRMergeComment: >
|
||||
Thanks for your first pull request and welcome to the community!
|
||||
Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/android/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
|
||||
Most developers hang out on IRC. So join \#nextcloud-mobile on Freenode for a chat!
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
# You can add one username per supported platform and one custom link
|
||||
custom: https://nextcloud.com/include/
|
||||
custom: https://www.bountysource.com/teams/nextcloud/issues?tracker_ids=38838206
|
||||
@@ -16,11 +16,6 @@ labels: bug
|
||||
### Actual behaviour
|
||||
- Tell us what happens
|
||||
|
||||
### Can you reproduce this problem on https://try.nextcloud.com?
|
||||
- Please create a test demo account and see if this still happens there.
|
||||
- If yes, please open up a bug report
|
||||
- If not, please verify server setup and ask for help on forum
|
||||
|
||||
### Environment data
|
||||
Android version:
|
||||
|
||||
@@ -32,8 +27,6 @@ Nextcloud app version:
|
||||
|
||||
Nextcloud server version:
|
||||
|
||||
Reverse proxy:
|
||||
|
||||
### Logs
|
||||
#### Web server error log
|
||||
```
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: gradle
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
rebase-strategy: "disabled"
|
||||
open-pull-requests-limit: 10
|
||||
labels:
|
||||
- 2. to review
|
||||
- dependencies
|
||||
@@ -1,11 +0,0 @@
|
||||
<!--
|
||||
TESTING
|
||||
|
||||
Writing tests is very important. Please try to write some tests for your PR.
|
||||
If you need help, please do not hesitate to ask in this PR for help.
|
||||
|
||||
Unit tests: https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md#unit-tests
|
||||
Instrumented tests: https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md#instrumented-tests
|
||||
UI tests: https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md#ui-tests
|
||||
-->
|
||||
- [ ] Tests written, or not not needed
|
||||
@@ -0,0 +1,21 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 28
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 14
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- 1. developing
|
||||
- 2. to review
|
||||
- 3. to release
|
||||
- approved
|
||||
- enhancement
|
||||
- overview
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This request did not receive an update in the last 4 weeks.
|
||||
Please take a look again and update the issue with new details,
|
||||
otherwise the issue will be automatically closed in 2 weeks. Thank you!
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
@@ -1,21 +0,0 @@
|
||||
name: "Analysis"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, stable-* ]
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: 11
|
||||
- name: Run analysis wrapper
|
||||
run: |
|
||||
mkdir -p $HOME/.gradle
|
||||
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties
|
||||
scripts/analysis/analysis-wrapper.sh ${{ secrets.GIT_USERNAME }} ${{ secrets.GIT_TOKEN }} ${{ github.head_ref }} ${{ secrets.LOG_USERNAME }} ${{ secrets.LOG_PASSWORD }} $GITHUB_RUN_NUMBER ${{ github.event.pull_request.number }}
|
||||
@@ -1,24 +0,0 @@
|
||||
name: "Assemble"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, stable-* ]
|
||||
|
||||
jobs:
|
||||
flavor:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [ Generic, Gplay, Huawei ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: 11
|
||||
- name: Build ${{ matrix.flavor }}
|
||||
run: |
|
||||
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" >> gradle.properties
|
||||
./gradlew assemble${{ matrix.flavor }}
|
||||
@@ -1,13 +0,0 @@
|
||||
name: Auto approve
|
||||
on:
|
||||
pull_request_target:
|
||||
branches: [ master, stable-* ]
|
||||
|
||||
jobs:
|
||||
auto-approve:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: hmarr/[email protected]
|
||||
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
|
||||
with:
|
||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, stable-* ]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
task: [ detekt, ktlint ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: 11
|
||||
- name: Check ${{ matrix.task }}
|
||||
run: ./gradlew ${{ matrix.task }}
|
||||
@@ -1,46 +0,0 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
|
||||
name: Rebase command
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: created
|
||||
|
||||
jobs:
|
||||
rebase:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# On pull requests and if the comment starts with `/rebase`
|
||||
if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/rebase')
|
||||
|
||||
steps:
|
||||
- name: Add reaction on start
|
||||
uses: peter-evans/create-or-update-comment@v1
|
||||
with:
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
repository: ${{ github.event.repository.full_name }}
|
||||
comment-id: ${{ github.event.comment.id }}
|
||||
reaction-type: "+1"
|
||||
|
||||
- name: Checkout the latest code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
|
||||
- name: Automatic Rebase
|
||||
uses: cirrus-actions/[email protected]
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
|
||||
- name: Add reaction on failure
|
||||
uses: peter-evans/create-or-update-comment@v1
|
||||
if: failure()
|
||||
with:
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
repository: ${{ github.event.repository.full_name }}
|
||||
comment-id: ${{ github.event.comment.id }}
|
||||
reaction-type: "-1"
|
||||
@@ -1,14 +0,0 @@
|
||||
name: "Detect snapshot"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, stable-* ]
|
||||
|
||||
jobs:
|
||||
detectSnapshot:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Detect SNAPSHOT
|
||||
run: scripts/analysis/detectSNAPSHOT.sh
|
||||
@@ -1,13 +0,0 @@
|
||||
name: "Validate Gradle Wrapper"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, stable-* ]
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
name: "Validation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
@@ -1,36 +0,0 @@
|
||||
name: "QA"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, stable-* ]
|
||||
|
||||
jobs:
|
||||
qa:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if secrets are available
|
||||
run: echo "::set-output name=ok::${{ secrets.KS_PASS != '' }}"
|
||||
id: check-secrets
|
||||
- uses: actions/checkout@v2
|
||||
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
|
||||
- name: set up JDK 11
|
||||
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: 11
|
||||
- name: Build QA
|
||||
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
|
||||
env:
|
||||
KS_PASS: ${{ secrets.KS_PASS }}
|
||||
KEY_PASS: ${{ secrets.KEY_PASS }}
|
||||
LOG_USERNAME: ${{ secrets.LOG_USERNAME }}
|
||||
LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }}
|
||||
run: |
|
||||
mkdir -p $HOME/.gradle
|
||||
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties
|
||||
sed -i "/qa/,/\}/ s/versionCode .*/versionCode ${{github.event.number}} /" build.gradle
|
||||
sed -i "/qa/,/\}/ s/versionName .*/versionName \"${{github.event.number}}\"/" build.gradle
|
||||
./gradlew assembleQaDebug
|
||||
$(find /usr/local/lib/android/sdk/build-tools/*/apksigner | sort | tail -n1) sign --ks-pass pass:$KS_PASS --key-pass pass:$KEY_PASS --ks-key-alias key0 --ks scripts/QA_keystore.jks build/outputs/apk/qa/debug/qa-debug-*.apk
|
||||
sudo scripts/uploadArtifact.sh $LOG_USERNAME $LOG_PASSWORD ${{github.event.number}} ${{github.event.number}} ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,55 +0,0 @@
|
||||
name: Scorecards supply-chain security
|
||||
on:
|
||||
# Only the default branch is supported.
|
||||
branch_protection_rule:
|
||||
schedule:
|
||||
- cron: '33 1 * * 5'
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
# Declare default permissions as read only.
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
name: Scorecards analysis
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed to upload the results to code-scanning dashboard.
|
||||
security-events: write
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@e3e75cf2ffbf9364bbff86cdbdf52b23176fe492 # v1.0.1
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
# Read-only PAT token. To create it,
|
||||
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
|
||||
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
|
||||
# Publish the results to enable scorecard badges. For more details, see
|
||||
# https://github.com/ossf/scorecard-action#publishing-results.
|
||||
# For private repositories, `publish_results` will automatically be set to `false`,
|
||||
# regardless of the value entered here.
|
||||
publish_results: false
|
||||
|
||||
# Upload the results as artifacts (optional).
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2.3.1
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
@@ -1,85 +0,0 @@
|
||||
name: "Screenshot Test"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, stable-* ]
|
||||
|
||||
jobs:
|
||||
screenshot:
|
||||
runs-on: macOS-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
scheme: [ Light ]
|
||||
color: [ blue ]
|
||||
api-level: [ 27 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Gradle cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
||||
- name: AVD cache
|
||||
uses: actions/cache@v2
|
||||
id: avd-cache
|
||||
with:
|
||||
path: |
|
||||
~/.android/avd/*
|
||||
~/.android/adb*
|
||||
key: avd-${{ matrix.api-level }}
|
||||
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: 11
|
||||
|
||||
- name: create AVD and generate snapshot for caching
|
||||
if: steps.avd-cache.outputs.cache-hit != 'true'
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
force-avd-creation: false
|
||||
arch: x86
|
||||
sdcard-path-or-size: 100M
|
||||
target: google_apis
|
||||
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
|
||||
script: echo "Generated AVD snapshot for caching."
|
||||
|
||||
- name: Configure gradle daemon
|
||||
run: |
|
||||
mkdir -p $HOME/.gradle
|
||||
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties
|
||||
echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties
|
||||
|
||||
- name: Build gplay
|
||||
run: ./gradlew assembleGplayDebug
|
||||
|
||||
- name: Delete old comments
|
||||
if: ${{ always() }}
|
||||
run: scripts/deleteOldComments.sh "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}} ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Run screenshot tests
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
force-avd-creation: false
|
||||
arch: x86
|
||||
sdcard-path-or-size: 100M
|
||||
target: google_apis
|
||||
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
|
||||
script: ./gradlew gplayDebugExecuteScreenshotTests -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest -Pandroid.testInstrumentationRunnerArguments.COLOR=${{ matrix.color }} -Pandroid.testInstrumentationRunnerArguments.DARKMODE=${{ matrix.scheme }}
|
||||
- name: upload failing results
|
||||
if: ${{ failure() }}
|
||||
run:
|
||||
scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}} ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Archive Espresso results
|
||||
uses: actions/upload-artifact@v2
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
name: Report-${{ matrix.color }}-${{ matrix.scheme }}
|
||||
path: build/reports
|
||||
retention-days: 4
|
||||
@@ -1,20 +0,0 @@
|
||||
name: 'Close stale issues'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '* */2 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/[email protected]
|
||||
with:
|
||||
days-before-stale: 28
|
||||
days-before-close: 14
|
||||
days-before-pr-close: -1
|
||||
only-labels: 'bug,needs info/discussion'
|
||||
exempt-issue-labels: 'no-stale'
|
||||
stale-issue-message: 'This bug report did not receive an update in the last 4 weeks.
|
||||
Please take a look again and update the issue with new details,
|
||||
otherwise the issue will be automatically closed in 2 weeks. Thank you!'
|
||||
exempt-all-pr-milestones: true
|
||||
+2
-5
@@ -28,8 +28,8 @@ tests/proguard-project.txt
|
||||
|
||||
# Android Studio and Gradle specific entries
|
||||
.gradle
|
||||
.idea/*
|
||||
!.idea/codeStyles/
|
||||
.idea
|
||||
*.iml
|
||||
build
|
||||
/gradle.properties
|
||||
.attach_pid*
|
||||
@@ -47,6 +47,3 @@ fastlane/Fastfile
|
||||
|
||||
# scan temporary files
|
||||
**/fastlane/test_output
|
||||
/fastlane/vendor/
|
||||
/.bundle/
|
||||
/fastlane/.bundle/
|
||||
Whitespace-only changes.
Generated
+5
-18
@@ -28,6 +28,10 @@
|
||||
</value>
|
||||
</option>
|
||||
<option name="RIGHT_MARGIN" value="120" />
|
||||
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
|
||||
<AndroidXmlCodeStyleSettings>
|
||||
<option name="ARRANGEMENT_SETTINGS_MIGRATED_TO_191" value="true" />
|
||||
</AndroidXmlCodeStyleSettings>
|
||||
<JavaCodeStyleSettings>
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
@@ -55,12 +59,11 @@
|
||||
<JetCodeStyleSettings>
|
||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||
<value>
|
||||
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
||||
<package name="kotlinx.android.synthetic" withSubpackages="true" static="false" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="2147483647" />
|
||||
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2147483647" />
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
</JetCodeStyleSettings>
|
||||
<MarkdownNavigatorCodeStyleSettings>
|
||||
<option name="RIGHT_MARGIN" value="120" />
|
||||
@@ -70,7 +73,6 @@
|
||||
</XML>
|
||||
<codeStyleSettings language="JAVA">
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
||||
<option name="ALIGN_MULTILINE_METHOD_BRACKETS" value="true" />
|
||||
<option name="WRAP_COMMENTS" value="true" />
|
||||
<option name="IF_BRACE_FORCE" value="3" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="3" />
|
||||
@@ -78,9 +80,6 @@
|
||||
<option name="FOR_BRACE_FORCE" value="3" />
|
||||
<option name="FIELD_ANNOTATION_WRAP" value="0" />
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="Markdown">
|
||||
<option name="RIGHT_MARGIN" value="120" />
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
@@ -193,17 +192,5 @@
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="kotlin">
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
|
||||
<option name="LINE_COMMENT_ADD_SPACE" value="true" />
|
||||
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
|
||||
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
|
||||
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
Generated
-7
@@ -1,7 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="ktlint" />
|
||||
<inspection_tool class="KotlinUnusedImport" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
<inspection_tool class="RedundantSemicolon" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="PROJECT_PROFILE" value="ktlint" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
+3
-218
@@ -1,232 +1,17 @@
|
||||
## 3.18.1 (December 22, 2021)
|
||||
|
||||
- Fix connection bug for usernames with spaces
|
||||
- Fix some crashes in search and share views
|
||||
- Fix login for server URLs in IP:port format
|
||||
- Lots of minor bug fixes
|
||||
|
||||
Minimum: NC 16 Server, Android 6.0 Marshmallow
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/63
|
||||
|
||||
## 3.18.0 (November 18, 2021)
|
||||
|
||||
- Calendar backup/restore
|
||||
- Unified search
|
||||
- Sharing permissions improvements
|
||||
- Minor bug fixes
|
||||
|
||||
Minimum: NC 16 Server, Android 6.0 Marshmallow
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/61
|
||||
|
||||
## 3.17.1 (October, 20, 2021)
|
||||
|
||||
- fix FIDO crash
|
||||
- fix crash in documents provider while offline
|
||||
- updated translations
|
||||
|
||||
Minimum: NC 16 Server, Android 5.1 Lollipop
|
||||
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/60
|
||||
|
||||
## 3.17.0 (August, 19, 2021)
|
||||
|
||||
- UI improvements (Avatar, password dialog)
|
||||
- New video player for better streaming
|
||||
- Many bug fixes
|
||||
- Drop Android 5.0, new min version Android 5.1
|
||||
|
||||
Minimum: NC 16 Server, Android 5.1 Lollipop
|
||||
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/59
|
||||
|
||||
## 3.16.1 (June, 01, 2021)
|
||||
|
||||
- Fix media tab not showing images/videos
|
||||
- Connectivity checks fixed
|
||||
- Crashing while retrieving avatar
|
||||
|
||||
Minimum: NC 16 Server, Android 5.0 Lollipop
|
||||
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/58
|
||||
|
||||
## 3.16.0 (May, 05, 2021)
|
||||
|
||||
- Enhance sharing
|
||||
- Update template section when creating new files
|
||||
- Pin protection update
|
||||
- Updated notification handling during updates @newhinton
|
||||
- UI improvements
|
||||
|
||||
Minimum: NC 16 Server, Android 5.0 Lollipop
|
||||
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/55
|
||||
|
||||
## 3.15.1 (March, 10, 2021)
|
||||
|
||||
- share fix
|
||||
- passcode fix
|
||||
- enhance share access
|
||||
|
||||
Minimum: NC 16 Server, Android 5.0 Lollipop
|
||||
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/57
|
||||
|
||||
## 3.15.0 (February, 02, 2021)
|
||||
|
||||
- Media instead of Photos: also show videos
|
||||
- UI Improvement (shimmer)
|
||||
- Bug fixes all over the place
|
||||
- Drop Android 4.4, new min version Android 5.0
|
||||
|
||||
Minimum: NC 16 Server, Android 5.0 Lollipop
|
||||
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/52
|
||||
|
||||
## 3.14.3 (January, 13, 2021)
|
||||
|
||||
- Fix crash when clicking "+" button
|
||||
- Fix push notifications on some devices
|
||||
- Fix updating of sharee list
|
||||
- Fix crash during setting status
|
||||
- Fix Crash Sharing files to Nextcloud via Android Apps
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/56
|
||||
|
||||
## 3.14.2 (January, 13, 2021)
|
||||
|
||||
- Fix push notifications on some devices
|
||||
- Fix updating of sharee list
|
||||
- Fix crash during setting status
|
||||
- Fix Crash Sharing files to Nextcloud via Android Apps
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/54
|
||||
|
||||
## 3.14.1 (December, 02, 2020)
|
||||
|
||||
- Fix crash due to service not started in time
|
||||
- Fix UI while media playback
|
||||
- Fix uploading direct camera images with more than one picture
|
||||
- Fix conflict handling on auto upload
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/53
|
||||
|
||||
## 3.14.0 (November, 18, 2020)
|
||||
|
||||
- Prevent Firebase crashes: Exodus will warn about tracker, but code wise it is disabled
|
||||
- Status support
|
||||
- Document storage enhancement @tgrote
|
||||
- Auto upload media detection improvements @AndyScherzinger
|
||||
- Sharing UI rewrite
|
||||
- Drop Android 4.3, new min version Android 4.4
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/50
|
||||
|
||||
## 3.13.1 (September, 15, 2020)
|
||||
|
||||
- bugfix release
|
||||
- auto upload obey metered network
|
||||
- fix adding account via qrCode
|
||||
- fix deleting password on share
|
||||
- fix conflict handling on auto upload
|
||||
- lots more
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/51
|
||||
|
||||
## 3.13.0 (August, 18, 2020)
|
||||
|
||||
- new UI overhaul @Shagequi @JorisBodin
|
||||
- E2EE beta support
|
||||
- dark mode enhancement @AndyScherzinger
|
||||
- warn on outdated NC16 server
|
||||
- requires Android 4.3 or newer
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/48
|
||||
|
||||
## 3.12.1 (July, 07, 2020)
|
||||
|
||||
- UI does not hang when changing auto upload
|
||||
- fix crash on contacts backup settings
|
||||
- bugfixes
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/49
|
||||
|
||||
## 3.12.0 (June, 10, 2020)
|
||||
|
||||
- add circle support for searching/displaying
|
||||
- if no offline editor is available, use OO/Cool/Text
|
||||
- add possibility to set expiration date on user/group shares (NC18+)
|
||||
- rich workspaces can be disabled on server side
|
||||
- improved loading view
|
||||
- requires Android 4.2 or newer
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/42
|
||||
|
||||
## 3.11.1 (April, 23, 2020)
|
||||
|
||||
- Crash while browsing files
|
||||
- auto upload:
|
||||
- fix wrong conflict detection on custom folder
|
||||
- allow to choose default conflict strategy @fodinabor
|
||||
- fix hanging UI after saving
|
||||
- open office files online if no local app installed
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/47
|
||||
|
||||
## 3.11.0 (March, 26, 2020)
|
||||
|
||||
- not enough space dialog @Shagequi
|
||||
- fix shared search
|
||||
- upload existing images in auto upload @koying @ArisuOngaku
|
||||
- allow deep links @Charon77
|
||||
- support for circle
|
||||
- last version supporting Android 4.1
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/41
|
||||
|
||||
## 3.10.1 (February, 05, 2020)
|
||||
|
||||
- fix crash on self-signed certificates
|
||||
- fix openOffice open files with special chars
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/45
|
||||
|
||||
## 3.10.0 (January, 17, 2020)
|
||||
|
||||
- Dark theme (@dan0xii, @AndyScherzinger)
|
||||
- Rich workspace (NC18+)
|
||||
- collaborative text editor (NC18+)
|
||||
- links in Markdown previews clickable (@AndyScherzinger)
|
||||
- Show/Hide auto upload list items (@AndyScherzinger)
|
||||
- drop 4.0.x support
|
||||
- outdated server warning set to NC15
|
||||
- latest supported version NC13
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/40
|
||||
|
||||
## 3.9.2 (December, 05, 2019)
|
||||
3.9.2 (December, 05, 2019)
|
||||
|
||||
- HOTFIX: fix login loop
|
||||
- Fix crash on opening png images
|
||||
- Translation updates
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/44
|
||||
|
||||
## 3.9.1 (December, 04, 2019)
|
||||
3.9.1 (December, 04, 2019)
|
||||
|
||||
- Fix crash on opening png images
|
||||
- Translation updates
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/43
|
||||
|
||||
## 3.9.0 (November, 12, 2019)
|
||||
3.9.0 (November, 12, 2019)
|
||||
|
||||
- preview Markdown with syntax highlighting @AndyScherzinger
|
||||
- improved DavX5 integration @bitfireAT
|
||||
|
||||
+48
-193
@@ -1,47 +1,44 @@
|
||||
# [Nextcloud](https://nextcloud.com) Android app
|
||||
|
||||
[](https://webchat.freenode.net/?channels=nextcloud)
|
||||
[](https://webchat.freenode.net/?channels=nextcloud-mobile)
|
||||
|
||||
|
||||
# Index
|
||||
1. [Guidelines](#guidelines)
|
||||
1. [Issue reporting](#issue-reporting)
|
||||
1. [Labels](#labels)
|
||||
1. [Pull request](#pull-request)
|
||||
1. [Issue](#issue)
|
||||
1. [Bug workflow](#bug-workflow)
|
||||
1. [Contributing to Source Code](#contributing-to-source-code)
|
||||
1. [Developing process](#developing-process)
|
||||
1. [Branching model](#branching-model)
|
||||
1. [Android Studio formatter setup](#android-studio-formatter-setup)
|
||||
1. [Build variants](#build-variants)
|
||||
1. [Git hooks](#git-hooks)
|
||||
1. [Contribution process](#contribution-process)
|
||||
1. [Fork and download android repository](#fork-and-download-android-repository)
|
||||
1. [Create pull request](#create-pull-request)
|
||||
1. [Create another pull request](#create-another-pull-request)
|
||||
1. [Backport pull request](#backport-pull-request)
|
||||
1. [Pull requests that also need changes on library](#pull-requests-that-also-need-changes-on-library)
|
||||
1. [Adding new files](#adding-new-files)
|
||||
1. [Testing](#testing)
|
||||
1. [File naming](#file-naming)
|
||||
1. [Menu files](#menu-files)
|
||||
1. [Translations](#translations)
|
||||
1. [Engineering practices](#engineering-practices)
|
||||
1. [Approach to technical debt](#approach-to-technical-debt)
|
||||
1. [Dependency injection](#dependency-injection)
|
||||
1. [Custom platform APIs](#custom-platform-apis)
|
||||
1. [Testing](#testing)
|
||||
1. [Releases](#releases)
|
||||
1. [Types](#types)
|
||||
1. [Stable](#stable)
|
||||
1. [Release Candidate](#release-candidate)
|
||||
1. [Dev](#dev)
|
||||
1. [Version Name and number](#version-name-and-number)
|
||||
1. [Stable / Release candidate](#stable-release-candidate)
|
||||
1. [Dev](#dev)
|
||||
1. [Release cycle](#release-cycle)
|
||||
1. [Release Process](#release-process)
|
||||
1. [Stable Release](#stable-release)
|
||||
1. [Release Candidate Release](#release-candidate-release)
|
||||
1. [Development Dev](#development-dev)
|
||||
1. Guidelines
|
||||
1. Issue reporting
|
||||
1. Labels
|
||||
1. Pull request (PR)
|
||||
1. Issue
|
||||
1. Bug workflow
|
||||
1. Contributing to Source Code
|
||||
1. Developing process
|
||||
1. Branching model
|
||||
1. Android Studio formatter setup
|
||||
1. Build variants
|
||||
1. Contribution process
|
||||
1. Fork and download android/master repository
|
||||
1. Create pull request
|
||||
1. Create another pull request
|
||||
1. Backport pull request
|
||||
1. Pull requests that also need changes on library
|
||||
1. Adding new files
|
||||
1. File naming
|
||||
1. Menu files
|
||||
1. Translations
|
||||
1. Releases
|
||||
1. Types
|
||||
1. Stable
|
||||
1. Release Candidate
|
||||
1. Dev
|
||||
1. Version Name and number
|
||||
1. Stable / Release candidate
|
||||
1. Dev
|
||||
1. Release cycle
|
||||
1. Release Process
|
||||
1. Stable Release
|
||||
1. Release Candidate Release
|
||||
1. Development Dev
|
||||
|
||||
|
||||
# Guidelines
|
||||
@@ -69,7 +66,6 @@ If your issue appears to be a bug, and hasn't been reported, open a new issue.
|
||||
|
||||
|
||||
### Bug workflow
|
||||
Every bug should be triaged in approved/needs info in a given time.
|
||||
* approved: at least one other is able to reproduce it
|
||||
* needs info: something unclear, or not able to reproduce
|
||||
* if no response within 1 months, bug will be closed
|
||||
@@ -116,30 +112,23 @@ There are three build variants
|
||||
* gplay: with Google Stuff (Push notification), used for Google Play Store
|
||||
* versionDev: based on master and library master, available as direct download and FDroid
|
||||
|
||||
### Git hooks
|
||||
We provide git hooks to make development process easier for both the developer and the reviewers.
|
||||
To install them, just run:
|
||||
|
||||
```bash
|
||||
./gradlew installGitHooks
|
||||
```
|
||||
|
||||
## Contribution process
|
||||
* Contribute your code in the branch 'master'. It will give us a better chance to test your code before merging it with stable code.
|
||||
* For your first contribution start a pull request on master.
|
||||
|
||||
|
||||
### Fork and download android repository:
|
||||
### 1. Fork and download android/master repository:
|
||||
* Please follow [SETUP.md](https://github.com/nextcloud/android/blob/master/SETUP.md) to setup Nextcloud Android app work environment.
|
||||
|
||||
|
||||
### Create pull request:
|
||||
* Commit your changes locally. Remember to sign off your commits (`git commit -sm 'Your commit message'`).
|
||||
### 2. Create pull request:
|
||||
* Commit your changes locally: ```git commit -a```
|
||||
* Push your changes to your GitHub repo: ```git push```
|
||||
* Browse to <https://github.com/YOURGITHUBNAME/android/pulls> and issue pull request
|
||||
* Enter description and send pull request.
|
||||
|
||||
### Create another pull request:
|
||||
|
||||
### 3. Create another pull request:
|
||||
To make sure your new pull request does not contain commits which are already contained in previous PRs, create a new branch which is a clone of upstream/master.
|
||||
|
||||
* ```git fetch upstream```
|
||||
@@ -148,12 +137,12 @@ To make sure your new pull request does not contain commits which are already co
|
||||
* Push branch to server: ```git push -u origin name_of_local_master_branch```
|
||||
* Use GitHub to issue PR
|
||||
|
||||
### Backport pull request:
|
||||
### 4. Backport pull request:
|
||||
Use backport-bot via "/backport to stable-version", e.g. "/backport to stable-3.7".
|
||||
This will automatically add "backport-request" label to PR and bot will create a new PR to targeted branch once the base PR is merged.
|
||||
If automatic backport fails, it will create a comment.
|
||||
|
||||
### Pull requests that also need changes on library
|
||||
### 5. Pull requests that also need changes on library
|
||||
For speeding up developing, we do use a master snapshot of nextcloud-library, provided by jitpack.io.
|
||||
This means that if a breaking change is merged on library, master branch of the app will fail.
|
||||
To limit this risk please follow this approach:
|
||||
@@ -167,7 +156,7 @@ Once both PRs are reviewed and ready to merge:
|
||||
|
||||
With this approach the "downtime" of not building master is limited to the timestamp between merge lib PR and merging app PR, which is only limited by CI.
|
||||
|
||||
### Adding new files
|
||||
### 6. Adding new files
|
||||
If you create a new file it needs to contain a license header. We encourage you to use the same license (AGPL3+) as we do.
|
||||
Copyright of Nextcloud GmbH is optional.
|
||||
|
||||
@@ -249,56 +238,6 @@ Source code of app:
|
||||
-->
|
||||
```
|
||||
|
||||
### Testing
|
||||
- testing is very important, but is lacking a lot on this project. Starting with 2020 we aim to write tests for every
|
||||
new pull request.
|
||||
- Code coverage can be found [here](https://codecov.io/gh/nextcloud/android).
|
||||
|
||||
#### Unit tests
|
||||
- small, isolated tests, with no need of Android SDK
|
||||
- code coverage can be directly shown via right click on test and select "Run Test with Coverage"
|
||||
|
||||
#### Instrumented tests
|
||||
- tests to see larger code working in correct way
|
||||
- tests that require parts of Android SDK
|
||||
- best to avoid server communication, see https://github.com/nextcloud/android/pull/3624
|
||||
|
||||
- run all tests ```./gradlew createGplayDebugCoverageReport -Pcoverage=true```
|
||||
- run selective test class: ```./gradlew createGplayDebugCoverageReport -Pcoverage=true
|
||||
-Pandroid.testInstrumentationRunnerArguments.class=com.owncloud.android.datamodel.FileDataStorageManagerTest```
|
||||
- run multiple test classes:
|
||||
- separate by ","
|
||||
- ```./gradlew createGplayDebugCoverageReport -Pcoverage=true -Pandroid.testInstrumentationRunnerArguments.class=com.owncloud.android.datamodel.FileDataStorageManagerTest,com.nextcloud.client.FileDisplayActivityIT```
|
||||
- run one test in class: ```./gradlew createGplayDebugCoverageReport -Pcoverage=true
|
||||
-Pandroid.testInstrumentationRunnerArguments.class=com.owncloud.android.datamodel.FileDataStorageManagerTest#saveNewFile```
|
||||
- JaCoCo results are shown as html: firefox ./build/reports/coverage/gplay/debug/index.html
|
||||
|
||||
|
||||
#### UI tests
|
||||
We use [shot](https://github.com/Karumi/Shot) for taking screenshots and compare them
|
||||
- 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
|
||||
- creating own UI comparison tests:
|
||||
- add IntentsTestRule for launching activity directly:
|
||||
|
||||
```java
|
||||
@Rule public IntentsTestRule<SettingsActivity> activityRule = new IntentsTestRule<>(SettingsActivity.class,
|
||||
true,
|
||||
false);
|
||||
```
|
||||
|
||||
- in test method:
|
||||
|
||||
```java
|
||||
Activity activity = activityRule.launchActivity(null);
|
||||
…do something, e.g. navigate, create folder, etc. …
|
||||
Screenshot.snapActivity(activity).record();
|
||||
```
|
||||
|
||||
- best practise is to first create test with emulator too see behaviour and then create screenshots
|
||||
|
||||
## File naming
|
||||
|
||||
The file naming patterns are inspired and based on [Ribot's Android Project And Code Guidelines](https://github.com/ribot/android-guidelines/blob/c1d8c9c904eb31bf01fe24aadb963b74281fe79a/project_and_code_guidelines.md).
|
||||
@@ -318,95 +257,11 @@ Similar to layout files, menu files should match the name of the component. For
|
||||
A good practice is to not include the word `menu` as part of the name because these files are already located in the `menu` directory. In case a component uses several menus in different places (via popup menus) then the resource name would be extended. For example, if the user profile activity has two popup menus for configuring the users settings and one for the handling group assignments then the file names for the menus would be: `activity_user_profile_user_settings.xml` and `activity_user_profile_group_assignments.xml`.
|
||||
|
||||
## Translations
|
||||
|
||||
We manage translations via [Transifex](https://www.transifex.com/nextcloud/nextcloud/android/). So just request joining the translation team for Android on the site and start translating. All translations will then be automatically pushed to this repository, there is no need for any pull request for translations.
|
||||
|
||||
If you need to change a translation, do not change it, but give it new key. This way the translation stays backward compatible as we automatically backport translated strings to last versions.
|
||||
|
||||
When submitting PRs with changed translations, please only submit changes to values/strings.xml and not changes to translated files. These will be overwritten by next merge of transifex-bot and increase PR review.
|
||||
|
||||
## Engineering practices
|
||||
|
||||
This section contains some general guidelines for new contributors, based on common issues flagged during code review.
|
||||
|
||||
### Approach to technical debt
|
||||
|
||||
TL;DR Non-Stop Litter Picking Party!
|
||||
|
||||
We recognize the importance of technical debt that can slow down development, make bug fixing difficult and
|
||||
discourage future contributors.
|
||||
|
||||
We are mindful of the [Broken Windows Theory](https://en.wikipedia.org/wiki/Broken_windows_theory) and we'd like
|
||||
actively promote and encourage contributors to apply The Scout's Rule: *"Always leave the campground cleaner than
|
||||
you found it"*. Simple, little improvements will sum up and will be very appreciated by Nextcloud team.
|
||||
|
||||
We also promise to actively support and mentor contributors that help us to improve code quality, as we understand
|
||||
that this process is challenging and requires deep understanding of the application codebase.
|
||||
|
||||
### Dependency injection
|
||||
|
||||
TL;DR Avoid calling constructors inside constructors.
|
||||
|
||||
In effort to modernize the codebase we are applying [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection)
|
||||
whenever possible. We use 2 approaches: automatic and manual.
|
||||
|
||||
We are using [Dagger 2](https://dagger.dev/) to inject dependencies into major Android components only:
|
||||
|
||||
* `Activity`
|
||||
* `Fragment`
|
||||
* `Service`
|
||||
* `BroadcastReceiver`
|
||||
* `ContentProvider`
|
||||
|
||||
This process is fairly automatic, with `@Inject` annotation being sufficient to supply properly initialized
|
||||
objects. Android lifecycle callbacks allow us to do most of the work without effort.
|
||||
|
||||
For other application sub-components we prefer to use constructor injection and manually provide required dependencies.
|
||||
|
||||
This combination allows us to benefit from automation when it provides most value, does not tie rest of the code
|
||||
to any specific framework and stimulates continuous code modernization through iterative refactoring of all minor
|
||||
elements.
|
||||
|
||||
### Custom platform APIs
|
||||
|
||||
TL;DR Avoid Android platform APIs.
|
||||
|
||||
Nextcloud Android application provides some replacements for native Android APIs to facilitate testing
|
||||
and expose higher-level, business-specific APIs.
|
||||
|
||||
Generally, whenever you need:
|
||||
|
||||
* account management
|
||||
* application preferences
|
||||
* background task scheduling
|
||||
* device hardware information
|
||||
* media playback
|
||||
* networking
|
||||
* logging
|
||||
* notifications management
|
||||
|
||||
we have something more suitable.
|
||||
|
||||
Our transition to new APIs is a continuous process. Contributors might be asked by code reviewers to
|
||||
refrain from using specific Android APIs considered problematic and to use Nextcloud APIs instead.
|
||||
In extreme cases we might decide to put specific features on hold until we provide platform API
|
||||
replacement.
|
||||
|
||||
If in doubt, ask Nextcloud developers. App undergoes a process of intense refactoring and situation
|
||||
changes frequently.
|
||||
|
||||
### Testing
|
||||
|
||||
TL;DR If we can't write a test for it, it's not good.
|
||||
|
||||
Test automation is challenging in mobile applications in general. We try to improve in this area
|
||||
and thereof we'd ask contributors to be mindful of their code testability:
|
||||
|
||||
1. new code submitted to Nextcloud project should be provided with automatic tests
|
||||
2. contributions to existing code that is currently not covered by automatic tests
|
||||
should at least not make future efforts more challenging
|
||||
3. whenever possible, testability should be improved even if the code is not covered by tests
|
||||
|
||||
When submitting PRs with changed translations, please only submit changes to values/strings.xml and not changes to translated files. These will be overwritten by next merge of transifex-but and increase PR review.
|
||||
|
||||
# Releases
|
||||
At the moment we are releasing the app in two app stores:
|
||||
@@ -449,7 +304,7 @@ Examples for different versions:
|
||||
* 8.12.2 ```80120200```
|
||||
* 9.8.4-rc18 ```90080418```
|
||||
|
||||
beware, that beta releases for an upcoming version will always use the minor and hotfix version of the release they are targeting. So to make sure the version code of the upcoming stable release will always be higher stable releases set the 2 beta digits to '99' as seen above in the examples. For major versions, as we're not a library and thus 'incompatible API changes' is not something that happens, decisions are essentially marketing-based. If we deem a release to be very impactful, we might increase the major version number.
|
||||
beware, that beta releases for an upcoming version will always use the minor and hotfix version of the release they are targeting. So to make sure the version code of the upcoming stable release will always be higher stable releases set the 2 beta digits to '99' as seen above in the examples.
|
||||
|
||||
### Dev
|
||||
For dev the version name is in format YYYYMMDD. It is mainly as a reference for reporting bugs and is not related to stable/release candidates as it is an independent app.
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# Autogenerated by fastlane
|
||||
#
|
||||
# Ensure this file is checked in to source control!
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem 'fastlane'
|
||||
|
||||
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
|
||||
eval_gemfile(plugins_path) if File.exist?(plugins_path)
|
||||
-216
@@ -1,216 +0,0 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.5)
|
||||
rexml
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
artifactory (3.0.15)
|
||||
atomos (0.1.3)
|
||||
aws-eventstream (1.2.0)
|
||||
aws-partitions (1.541.0)
|
||||
aws-sdk-core (3.124.0)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
aws-partitions (~> 1, >= 1.525.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
jmespath (~> 1.0)
|
||||
aws-sdk-kms (1.52.0)
|
||||
aws-sdk-core (~> 3, >= 3.122.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-s3 (1.109.0)
|
||||
aws-sdk-core (~> 3, >= 3.122.0)
|
||||
aws-sdk-kms (~> 1)
|
||||
aws-sigv4 (~> 1.4)
|
||||
aws-sigv4 (1.4.0)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
babosa (1.0.4)
|
||||
claide (1.0.3)
|
||||
colored (1.2)
|
||||
colored2 (3.1.2)
|
||||
commander (4.6.0)
|
||||
highline (~> 2.0.0)
|
||||
declarative (0.0.20)
|
||||
digest-crc (0.6.4)
|
||||
rake (>= 12.0.0, < 14.0.0)
|
||||
domain_name (0.5.20190701)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
dotenv (2.7.6)
|
||||
emoji_regex (3.2.3)
|
||||
excon (0.89.0)
|
||||
faraday (1.8.0)
|
||||
faraday-em_http (~> 1.0)
|
||||
faraday-em_synchrony (~> 1.0)
|
||||
faraday-excon (~> 1.1)
|
||||
faraday-httpclient (~> 1.0.1)
|
||||
faraday-net_http (~> 1.0)
|
||||
faraday-net_http_persistent (~> 1.1)
|
||||
faraday-patron (~> 1.0)
|
||||
faraday-rack (~> 1.0)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
ruby2_keywords (>= 0.0.4)
|
||||
faraday-cookie_jar (0.0.7)
|
||||
faraday (>= 0.8.0)
|
||||
http-cookie (~> 1.0.0)
|
||||
faraday-em_http (1.0.0)
|
||||
faraday-em_synchrony (1.0.0)
|
||||
faraday-excon (1.1.0)
|
||||
faraday-httpclient (1.0.1)
|
||||
faraday-net_http (1.0.1)
|
||||
faraday-net_http_persistent (1.2.0)
|
||||
faraday-patron (1.0.0)
|
||||
faraday-rack (1.0.0)
|
||||
faraday_middleware (1.2.0)
|
||||
faraday (~> 1.0)
|
||||
fastimage (2.2.5)
|
||||
fastlane (2.199.0)
|
||||
CFPropertyList (>= 2.3, < 4.0.0)
|
||||
addressable (>= 2.8, < 3.0.0)
|
||||
artifactory (~> 3.0)
|
||||
aws-sdk-s3 (~> 1.0)
|
||||
babosa (>= 1.0.3, < 2.0.0)
|
||||
bundler (>= 1.12.0, < 3.0.0)
|
||||
colored
|
||||
commander (~> 4.6)
|
||||
dotenv (>= 2.1.1, < 3.0.0)
|
||||
emoji_regex (>= 0.1, < 4.0)
|
||||
excon (>= 0.71.0, < 1.0.0)
|
||||
faraday (~> 1.0)
|
||||
faraday-cookie_jar (~> 0.0.6)
|
||||
faraday_middleware (~> 1.0)
|
||||
fastimage (>= 2.1.0, < 3.0.0)
|
||||
gh_inspector (>= 1.1.2, < 2.0.0)
|
||||
google-apis-androidpublisher_v3 (~> 0.3)
|
||||
google-apis-playcustomapp_v1 (~> 0.1)
|
||||
google-cloud-storage (~> 1.31)
|
||||
highline (~> 2.0)
|
||||
json (< 3.0.0)
|
||||
jwt (>= 2.1.0, < 3)
|
||||
mini_magick (>= 4.9.4, < 5.0.0)
|
||||
multipart-post (~> 2.0.0)
|
||||
naturally (~> 2.2)
|
||||
optparse (~> 0.1.1)
|
||||
plist (>= 3.1.0, < 4.0.0)
|
||||
rubyzip (>= 2.0.0, < 3.0.0)
|
||||
security (= 0.1.3)
|
||||
simctl (~> 1.6.3)
|
||||
terminal-notifier (>= 2.0.0, < 3.0.0)
|
||||
terminal-table (>= 1.4.5, < 2.0.0)
|
||||
tty-screen (>= 0.6.3, < 1.0.0)
|
||||
tty-spinner (>= 0.8.0, < 1.0.0)
|
||||
word_wrap (~> 1.0.0)
|
||||
xcodeproj (>= 1.13.0, < 2.0.0)
|
||||
xcpretty (~> 0.3.0)
|
||||
xcpretty-travis-formatter (>= 0.0.3)
|
||||
fastlane-plugin-huawei_appgallery_connect (1.0.17)
|
||||
gh_inspector (1.1.3)
|
||||
google-apis-androidpublisher_v3 (0.14.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-apis-core (0.4.1)
|
||||
addressable (~> 2.5, >= 2.5.1)
|
||||
googleauth (>= 0.16.2, < 2.a)
|
||||
httpclient (>= 2.8.1, < 3.a)
|
||||
mini_mime (~> 1.0)
|
||||
representable (~> 3.0)
|
||||
retriable (>= 2.0, < 4.a)
|
||||
rexml
|
||||
webrick
|
||||
google-apis-iamcredentials_v1 (0.9.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-apis-playcustomapp_v1 (0.6.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-apis-storage_v1 (0.10.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-cloud-core (1.6.0)
|
||||
google-cloud-env (~> 1.0)
|
||||
google-cloud-errors (~> 1.0)
|
||||
google-cloud-env (1.5.0)
|
||||
faraday (>= 0.17.3, < 2.0)
|
||||
google-cloud-errors (1.2.0)
|
||||
google-cloud-storage (1.35.0)
|
||||
addressable (~> 2.8)
|
||||
digest-crc (~> 0.4)
|
||||
google-apis-iamcredentials_v1 (~> 0.1)
|
||||
google-apis-storage_v1 (~> 0.1)
|
||||
google-cloud-core (~> 1.6)
|
||||
googleauth (>= 0.16.2, < 2.a)
|
||||
mini_mime (~> 1.0)
|
||||
googleauth (1.1.0)
|
||||
faraday (>= 0.17.3, < 2.0)
|
||||
jwt (>= 1.4, < 3.0)
|
||||
memoist (~> 0.16)
|
||||
multi_json (~> 1.11)
|
||||
os (>= 0.9, < 2.0)
|
||||
signet (>= 0.16, < 2.a)
|
||||
highline (2.0.3)
|
||||
http-cookie (1.0.4)
|
||||
domain_name (~> 0.5)
|
||||
httpclient (2.8.3)
|
||||
jmespath (1.4.0)
|
||||
json (2.6.1)
|
||||
jwt (2.3.0)
|
||||
memoist (0.16.2)
|
||||
mini_magick (4.11.0)
|
||||
mini_mime (1.1.2)
|
||||
multi_json (1.15.0)
|
||||
multipart-post (2.0.0)
|
||||
nanaimo (0.3.0)
|
||||
naturally (2.2.1)
|
||||
optparse (0.1.1)
|
||||
os (1.1.4)
|
||||
plist (3.6.0)
|
||||
public_suffix (4.0.6)
|
||||
rake (13.0.6)
|
||||
representable (3.1.1)
|
||||
declarative (< 0.1.0)
|
||||
trailblazer-option (>= 0.1.1, < 0.2.0)
|
||||
uber (< 0.2.0)
|
||||
retriable (3.1.2)
|
||||
rexml (3.2.5)
|
||||
rouge (2.0.7)
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.3.2)
|
||||
security (0.1.3)
|
||||
signet (0.16.0)
|
||||
addressable (~> 2.8)
|
||||
faraday (>= 0.17.3, < 2.0)
|
||||
jwt (>= 1.5, < 3.0)
|
||||
multi_json (~> 1.10)
|
||||
simctl (1.6.8)
|
||||
CFPropertyList
|
||||
naturally
|
||||
terminal-notifier (2.0.0)
|
||||
terminal-table (1.8.0)
|
||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||
trailblazer-option (0.1.2)
|
||||
tty-cursor (0.7.1)
|
||||
tty-screen (0.8.1)
|
||||
tty-spinner (0.9.3)
|
||||
tty-cursor (~> 0.7)
|
||||
uber (0.1.0)
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.8)
|
||||
unicode-display_width (1.8.0)
|
||||
webrick (1.7.0)
|
||||
word_wrap (1.0.0)
|
||||
xcodeproj (1.21.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
xcpretty (0.3.0)
|
||||
rouge (~> 2.0.7)
|
||||
xcpretty-travis-formatter (1.0.1)
|
||||
xcpretty (~> 0.2, >= 0.0.7)
|
||||
|
||||
PLATFORMS
|
||||
x86_64-linux
|
||||
|
||||
DEPENDENCIES
|
||||
fastlane
|
||||
fastlane-plugin-huawei_appgallery_connect
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.26
|
||||
@@ -1,6 +1,6 @@
|
||||
# [Nextcloud](https://nextcloud.com) Android app :iphone:
|
||||
|
||||
[](https://drone.nextcloud.com/nextcloud/android) [](https://www.codacy.com/app/Nextcloud/android?utm_source=github.com&utm_medium=referral&utm_content=nextcloud/android&utm_campaign=Badge_Grade) [](https://github.com/nextcloud/android/releases/latest)
|
||||
[](https://drone.nextcloud.com/nextcloud/android) [](https://www.codacy.com/app/Nextcloud/android?utm_source=github.com&utm_medium=referral&utm_content=nextcloud/android&utm_campaign=Badge_Grade) [](https://github.com/nextcloud/android/releases/latest) [](https://webchat.freenode.net/?channels=nextcloud-mobile)
|
||||
|
||||
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png"
|
||||
alt="Download from Google Play"
|
||||
@@ -16,6 +16,7 @@
|
||||
## How to contribute :rocket:
|
||||
If you want to [contribute](https://nextcloud.com/contribute/) to Nextcloud, you are very welcome:
|
||||
|
||||
- on our IRC channels [](https://webchat.freenode.net/?channels=nextcloud) and [](https://webchat.freenode.net/?channels=nextcloud-mobile) on freenode
|
||||
- our forum at https://help.nextcloud.com
|
||||
- for translations of the app on [Transifex](https://www.transifex.com/nextcloud/nextcloud/android/)
|
||||
- opening issues and PRs (including a corresponding issue)
|
||||
@@ -41,21 +42,13 @@ Make sure you read [SETUP.md](https://github.com/nextcloud/android/blob/master/S
|
||||
Easy starting points are also reviewing [pull requests](https://github.com/nextcloud/android/pulls) and working on [starter issues](https://github.com/nextcloud/android/issues?q=is%3Aopen+is%3Aissue+label%3A%22starter+issue%22).
|
||||
|
||||
### Getting debug info via logcat :mag:
|
||||
#### With a linux computer:
|
||||
- enable USB-Debugging in your smartphones developer settings and connect it via USB
|
||||
#### With a computer:
|
||||
- connect the device via USB
|
||||
- open command prompt/terminal
|
||||
- enter `adb logcat | grep "$(adb shell ps | awk '/com.nextcloud.client/{print $2}')" > logcatOutput.txt` to save the output to this file
|
||||
|
||||
**Note:** You must have [adb](https://developer.android.com/studio/releases/platform-tools.html) installed first!
|
||||
|
||||
#### On Windows:
|
||||
- download and install [Minimal ADB and fastboot](https://forum.xda-developers.com/t/tool-minimal-adb-and-fastboot-2-9-18.2317790/#post-42407269)
|
||||
- enable USB-Debugging in your smartphones developer settings and connect it via USB
|
||||
- launch Minimal ADB and fastboot
|
||||
- enter `adb shell ps | findstr com.nextcloud.client` and use the second place of this output (it is the first integer, e.g. `18841`) as processID in the following command:
|
||||
- `adb logcat | findstr <processID> > %HOMEPATH%\Downloads\logcatOutput.txt` (This will produce a logcatOutput.txt file in your downloads)
|
||||
- if the processID is 18841, an example command is: `adb logcat | findstr 18841 > %HOMEPATH%\Downloads\logcatOutput.txt` (You might cancel the process after a while manually: it will not be exited automatically.)
|
||||
|
||||
#### On a device (with root) :wrench:
|
||||
- open terminal app *(can be enabled in developer options)*
|
||||
- get root access via "su"
|
||||
@@ -74,7 +67,7 @@ or
|
||||
|
||||
## Support :rescue_worker_helmet:
|
||||
|
||||
If you need assistance or want to ask a question about the Android app, you are welcome to [ask for support](https://help.nextcloud.com/c/clients/android) in our Forums. If you have found a bug, feel free to [open a new Issue on GitHub](https://github.com/nextcloud/android/issues). Keep in mind, that this repository only manages the Android app. If you find bugs or have problems with the server/backend, you should ask the [Nextcloud server team](https://github.com/nextcloud/server) for help!
|
||||
If you need assistance or want to ask a question about the Android app, you are welcome to [ask for support](https://help.nextcloud.com/c/clients/android) in our Forums or the [IRC-Channel](https://webchat.freenode.net/?channels=nextcloud-mobile). If you have found a bug, feel free to [open a new Issue on GitHub](https://github.com/nextcloud/android/issues). Keep in mind, that this repository only manages the Android app. If you find bugs or have problems with the server/backend, you should ask the [Nextcloud server team](https://github.com/nextcloud/server) for help!
|
||||
|
||||
## Remarks :scroll:
|
||||
|
||||
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Only the latest version is supported. We release every second month a feature release (currently 3.x) and inbetween a bug fix release (3.x.y).
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Security is very important to us. If you have discovered a security issue with Nextcloud,
|
||||
please read our responsible disclosure guidelines and contact us at [hackerone.com/nextcloud](https://hackerone.com/nextcloud).
|
||||
Your report should include:
|
||||
|
||||
- Product version
|
||||
- A vulnerability description
|
||||
- Reproduction steps
|
||||
|
||||
A member of the security team will confirm the vulnerability, determine its impact, and develop a fix.
|
||||
The fix will be applied to the master branch, tested, and packaged in the next bug fix release.
|
||||
The vulnerability will be publicly announced after the release. Finally, your name will be added
|
||||
to the [hall of fame](https://hackerone.com/nextcloud/thanks) as a thank you from the entire Nextcloud community. Note our
|
||||
[threat model](https://nextcloud.com/security/threat-model) to know what is expected behavior.
|
||||
|
||||
|
||||
Please visit https://nextcloud.com/security/ for further information about security.
|
||||
@@ -32,7 +32,7 @@ The next steps will assume you have a GitHub account and that you will get the c
|
||||
|
||||
* In a web browser, go to https://github.com/nextcloud/android, and click the 'Fork' button near the top right corner.
|
||||
* Open a terminal and go on with the next steps in it.
|
||||
* Clone your forked repository: ```git clone https://github.com/YOURGITHUBNAME/android.git```.
|
||||
* Clone your forked repository: ```git clone --recursive https://github.com/YOURGITHUBNAME/android.git```.
|
||||
* Move to the project folder with ```cd android```.
|
||||
* Pull any changes from your remote branch 'master': ```git pull origin master```
|
||||
* Make official Nextcloud repo known as upstream: ```git remote add upstream https://github.com/nextcloud/android.git```
|
||||
@@ -49,6 +49,7 @@ We recommend to use the last version available in the stable channel of Android
|
||||
|
||||
To set up the project in Android Studio follow the next steps:
|
||||
|
||||
* Make sure you have called ```git submodule update``` whenever you switched branches
|
||||
* Open Android Studio and select 'Import Project (Eclipse ADT, Gradle, etc)'. Browse through your file system to the folder 'android' where the project is located. Android Studio will then create the '.iml' files it needs. If you ever close the project but the files are still there, you just select 'Open Project…'. The file chooser will show an Android face as the folder icon, which you can select to reopen the project.
|
||||
* Android Studio will try to build the project directly after importing it. To build it manually, follow the menu path 'Build'/'Make Project', or just click the 'Play' button in the toolbar to build and run it in a mobile device or an emulator. The resulting APK file will be saved in the 'build/outputs/apk/' subdirectory in the project folder.
|
||||
* Setup Android Studio editor configurtation for the project: ```Settings``` → ```Editor``` → ```Code Style``` → ```Scheme: Project``` and ```Enable EditorConfig support```
|
||||
@@ -59,6 +60,7 @@ To set up the project in Android Studio follow the next steps:
|
||||
[Gradle][7] is the build system used by Android Studio to manage the building operations on Android apps. You do not need to install Gradle in your system, and Google recommends not to do it, but instead trusting on the [Gradle wrapper][8] included in the project.
|
||||
|
||||
* Open a terminal and go to the 'android' directory that contains the repository.
|
||||
* Make sure you have called ```git submodule update``` whenever you switched branches
|
||||
* Run the 'clean' and 'build' tasks using the Gradle wrapper provided
|
||||
- Windows: ```gradlew.bat clean build```
|
||||
- Mac OS/Linux: ```./gradlew clean build```
|
||||
@@ -92,25 +94,14 @@ This is handy if one wants to make changes both to files app and library:
|
||||
- in files app root: ln -s $pathToLibraryProject nextcloud-android-library
|
||||
- uncomment in build.gradle:
|
||||
- `// implementation project('nextcloud-android-library')`
|
||||
- comment in build.gradle:
|
||||
```
|
||||
implementation ("com.github.nextcloud:android-library:$androidLibraryVersion") {
|
||||
exclude group: 'org.ogce', module: 'xpp3' // unused in Android and brings wrong Junit version
|
||||
}
|
||||
```
|
||||
- comment in build.gradle:
|
||||
- `genericImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT'`
|
||||
- `gplayImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT'`
|
||||
- `versionDevImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT'`
|
||||
- comment in settings.gradle:
|
||||
- `include ':'`
|
||||
- add in settings.gradle:
|
||||
- `include 'nextcloud-android-library'`
|
||||
- uncomment in settings.gradle:
|
||||
- `//include 'nextcloud-android-library'`
|
||||
- sync project with gradle files
|
||||
|
||||
Now every change in library can be directly used in files app.
|
||||
|
||||
### 6. Troubleshooting
|
||||
|
||||
#### 1. Compilation fails with "java.lang.OutOfMemoryError: Java heap space" error
|
||||
The default settings for Gradle is to limit the compilation to 1GB of heap.
|
||||
You can increase that value by :
|
||||
- adding `org.gradle.jvmargs=-Xmx4G` to `gradle.properties`
|
||||
- running gradlew(.bat) with this command line : `GRADLE_OPTS="-Xmx4G" ./gradlew clean build"
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="resources"/>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
target/
|
||||
ScreenShots/
|
||||
.DS_Store
|
||||
Users/
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>androidtest</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,12 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
@@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
@@ -0,0 +1,20 @@
|
||||
** Work in progress
|
||||
|
||||
This project contains a set of automatic tests operating in the UI level.
|
||||
|
||||
Tests are to be run with the tool Appium. Check [here][0] to install it and all its dependencies (including Maven).
|
||||
|
||||
You will need to modify the constants in automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/Config.java to assign appropriate values for your test server and accounts.
|
||||
You will need to include the ownCloud.apk to test in automationTest/src/test/resources/.
|
||||
|
||||
To run the tests from command line, plug a device to your computer or start and emulator. Then type
|
||||
|
||||
mvn clean tests
|
||||
|
||||
To run only one category of the test
|
||||
|
||||
mvn clean -Dtest=RunSmokeTests test
|
||||
|
||||
The project may also be imported in Eclipse, with the appropriate plug-ins, and run from it.
|
||||
|
||||
[0]: http://appium.io/slate/en/master/?java#about-appium
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.owncloud</groupId>
|
||||
<artifactId>androidtest</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.18.1</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Test**.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.3</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.seleniumhq.selenium</groupId>
|
||||
<artifactId>selenium-java</artifactId>
|
||||
<version>2.45.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.selendroid</groupId>
|
||||
<version>0.9.0</version>
|
||||
<artifactId>selendroid-standalone</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.selendroid</groupId>
|
||||
<version>0.9.0</version>
|
||||
<artifactId>selendroid-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.appium</groupId>
|
||||
<artifactId>java-client</artifactId>
|
||||
<version>2.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.3.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.android</groupId>
|
||||
<artifactId>android</artifactId>
|
||||
<version>4.1.1.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,4 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
||||
@@ -0,0 +1,244 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.actions;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.NoSuchElementException;
|
||||
import org.openqa.selenium.ScreenOrientation;
|
||||
import org.openqa.selenium.remote.RemoteWebElement;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
import com.owncloud.android.test.ui.models.CertificatePopUp;
|
||||
import com.owncloud.android.test.ui.models.ElementMenuOptions;
|
||||
import com.owncloud.android.test.ui.models.GmailSendMailView;
|
||||
import com.owncloud.android.test.ui.models.ShareView;
|
||||
import com.owncloud.android.test.ui.models.UploadFilesView;
|
||||
import com.owncloud.android.test.ui.models.LoginForm;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
import com.owncloud.android.test.ui.models.MenuList;
|
||||
import com.owncloud.android.test.ui.models.NewFolderPopUp;
|
||||
import com.owncloud.android.test.ui.models.RemoveConfirmationView;
|
||||
import com.owncloud.android.test.ui.models.SettingsView;
|
||||
import com.owncloud.android.test.ui.models.WaitAMomentPopUp;
|
||||
import com.owncloud.android.test.ui.testSuites.Common;
|
||||
import com.owncloud.android.test.ui.testSuites.Config;
|
||||
|
||||
public class Actions {
|
||||
|
||||
public static FileListView login(String url, String user, String password,
|
||||
Boolean isTrusted, AndroidDriver driver)
|
||||
throws InterruptedException {
|
||||
LoginForm loginForm = new LoginForm(driver);
|
||||
CertificatePopUp certificatePopUp = loginForm.typeHostUrl(url);
|
||||
if(!isTrusted){
|
||||
WebDriverWait wait = new WebDriverWait(driver, 30);
|
||||
//sometimes the certificate has been already accept
|
||||
//and it doesn't appear again
|
||||
try {
|
||||
wait.until(ExpectedConditions
|
||||
.visibilityOf(certificatePopUp.getOkButtonElement()));
|
||||
//we need to repaint the screen
|
||||
//because of some element are misplaced
|
||||
driver.rotate(ScreenOrientation.LANDSCAPE);
|
||||
driver.rotate(ScreenOrientation.PORTRAIT);
|
||||
certificatePopUp.clickOnOkButton();
|
||||
}catch (NoSuchElementException e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
loginForm.typeUserName(user);
|
||||
loginForm.typePassword(password);
|
||||
//TODO. Assert related to check the connection?
|
||||
return loginForm.clickOnConnectButton();
|
||||
}
|
||||
|
||||
public static WaitAMomentPopUp createFolder(String folderName,
|
||||
FileListView fileListView){
|
||||
NewFolderPopUp newFolderPopUp = fileListView.clickOnNewFolderButton();
|
||||
newFolderPopUp.typeNewFolderName(folderName);
|
||||
WaitAMomentPopUp waitAMomentPopUp = newFolderPopUp
|
||||
.clickOnNewFolderOkButton();
|
||||
//TODO. assert here
|
||||
return waitAMomentPopUp;
|
||||
}
|
||||
|
||||
|
||||
public static AndroidElement scrollTillFindElement (String elementName,
|
||||
AndroidElement element, AndroidDriver driver) {
|
||||
AndroidElement fileElement;
|
||||
|
||||
if(element.getAttribute("scrollable").equals("true")){
|
||||
HashMap<String, String> scrollObject = new HashMap<String,String>();
|
||||
scrollObject.put("text", elementName);
|
||||
scrollObject.put("element", ( (RemoteWebElement) element).getId());
|
||||
driver.executeScript("mobile: scrollTo", scrollObject);
|
||||
}
|
||||
try {
|
||||
fileElement = (AndroidElement) driver
|
||||
.findElementByName(elementName);
|
||||
} catch (NoSuchElementException e) {
|
||||
fileElement = null;
|
||||
}
|
||||
return fileElement;
|
||||
}
|
||||
|
||||
|
||||
public static void deleteAccount (int accountPosition,FileListView fileListView) {
|
||||
MenuList menulist = fileListView.clickOnMenuButton();
|
||||
SettingsView settingView = menulist.clickOnSettingsButton();
|
||||
deleteAccount(accountPosition,settingView);
|
||||
}
|
||||
|
||||
public static void deleteAccount (int accountPosition, SettingsView settingsView) {
|
||||
settingsView.tapOnAccountElement(accountPosition,1, 1000);
|
||||
settingsView.clickOnDeleteAccountElement();
|
||||
}
|
||||
|
||||
public static void clickOnMainLayout(AndroidDriver driver){
|
||||
driver.tap(1, 0, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
public static AndroidElement deleteElement(String elementName,
|
||||
FileListView fileListView, AndroidDriver driver) throws Exception{
|
||||
AndroidElement fileElement;
|
||||
WaitAMomentPopUp waitAMomentPopUp;
|
||||
try{
|
||||
//To open directly the "file list view" and
|
||||
//we don't need to know in which view we are
|
||||
driver.startActivity("com.owncloud.android",
|
||||
".ui.activity.FileDisplayActivity");
|
||||
fileElement = (AndroidElement) driver
|
||||
.findElementByName(elementName);
|
||||
ElementMenuOptions menuOptions = fileListView
|
||||
.longPressOnElement(elementName);
|
||||
RemoveConfirmationView removeConfirmationView = menuOptions
|
||||
.clickOnRemove();;
|
||||
waitAMomentPopUp = removeConfirmationView
|
||||
.clickOnRemoteAndLocalButton();
|
||||
Common.waitTillElementIsNotPresent(
|
||||
waitAMomentPopUp.getWaitAMomentTextElement(), 100);
|
||||
}catch(NoSuchElementException e){
|
||||
fileElement=null;
|
||||
}
|
||||
return fileElement;
|
||||
}
|
||||
|
||||
public static AndroidElement shareLinkElementByGmail(String elementName,
|
||||
FileListView fileListView, AndroidDriver driver, Common common)
|
||||
throws Exception{
|
||||
try{
|
||||
//To open directly the "file list view" and
|
||||
//we don't need to know in which view we are
|
||||
driver.startActivity("com.owncloud.android",
|
||||
".ui.activity.FileDisplayActivity");
|
||||
ElementMenuOptions menuOptions = fileListView
|
||||
.longPressOnElement(elementName);
|
||||
ShareView shareView = menuOptions.clickOnShareLinkElement();
|
||||
Actions.scrollTillFindElement("Gmail", shareView
|
||||
.getListViewLayout(), driver).click();
|
||||
GmailSendMailView gmailSendMailView = new GmailSendMailView(driver);
|
||||
gmailSendMailView.typeToEmailAdress(Config.gmailAccount);
|
||||
gmailSendMailView.clickOnSendButton();
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(fileListView
|
||||
.getProgressCircular(), 1000);
|
||||
common.wait.until(ExpectedConditions.visibilityOf(
|
||||
fileListView.getFileElementLayout()
|
||||
.findElement(By.id(FileListView
|
||||
.getSharedElementIndicator()))));
|
||||
|
||||
}catch(NoSuchElementException e){
|
||||
return null;
|
||||
}
|
||||
return (AndroidElement) fileListView.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getSharedElementIndicator()));
|
||||
}
|
||||
|
||||
public static AndroidElement shareLinkElementByCopyLink(String elementName,
|
||||
FileListView fileListView, AndroidDriver driver, Common common)
|
||||
throws Exception{
|
||||
try{
|
||||
//To open directly the "file list view" and
|
||||
//we don't need to know in which view we are
|
||||
driver.startActivity("com.owncloud.android",
|
||||
".ui.activity.FileDisplayActivity");
|
||||
ElementMenuOptions menuOptions = fileListView
|
||||
.longPressOnElement(elementName);
|
||||
ShareView shareView = menuOptions.clickOnShareLinkElement();
|
||||
Actions.scrollTillFindElement("Copy link", shareView.getListViewLayout(),
|
||||
driver).click();
|
||||
WaitAMomentPopUp waitAMomentPopUp = new WaitAMomentPopUp(driver);
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp
|
||||
.getWaitAMomentTextElement(), 100);
|
||||
common.wait.until(ExpectedConditions.visibilityOf(
|
||||
fileListView.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getSharedElementIndicator()))));
|
||||
}catch(NoSuchElementException e){
|
||||
return null;
|
||||
}
|
||||
return (AndroidElement) fileListView.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getSharedElementIndicator()));
|
||||
}
|
||||
|
||||
|
||||
public static void unshareLinkElement(String elementName,
|
||||
FileListView fileListView, AndroidDriver driver, Common common)
|
||||
throws Exception{
|
||||
try{
|
||||
//To open directly the "file list view" and
|
||||
//we don't need to know in which view we are
|
||||
driver.startActivity("com.owncloud.android",
|
||||
".ui.activity.FileDisplayActivity");
|
||||
ElementMenuOptions menuOptions = fileListView
|
||||
.longPressOnElement(elementName);
|
||||
WaitAMomentPopUp waitAMomentPopUp = menuOptions
|
||||
.clickOnUnshareLinkElement();
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp
|
||||
.getWaitAMomentTextElement(), 100);
|
||||
Common.waitTillElementIsNotPresent((AndroidElement) fileListView
|
||||
.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getSharedElementIndicator())
|
||||
),100);
|
||||
}catch(NoSuchElementException e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static FileListView uploadFile(String elementName,
|
||||
FileListView fileListView) throws InterruptedException{
|
||||
fileListView.clickOnUploadButton();
|
||||
UploadFilesView uploadFilesView = fileListView
|
||||
.clickOnFilesElementUploadFile();
|
||||
uploadFilesView.clickOnFileName(elementName);
|
||||
FileListView fileListViewAfterUploadFile = uploadFilesView
|
||||
.clickOnUploadButton();
|
||||
//TO DO. detect when the file is successfully uploaded
|
||||
Thread.sleep(15000);
|
||||
return fileListViewAfterUploadFile;
|
||||
}
|
||||
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.owncloud.android.test.ui.groups;
|
||||
|
||||
public interface FailingTestCategory extends IgnoreTestCategory {}
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
package com.owncloud.android.test.ui.groups;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Categories.CategoryFilter;
|
||||
import org.junit.experimental.categories.Categories.ExcludeCategory;
|
||||
import org.junit.experimental.categories.Categories.IncludeCategory;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.runner.Description;
|
||||
import org.junit.runner.manipulation.NoTestsRemainException;
|
||||
import org.junit.runners.Suite;
|
||||
import org.junit.runners.model.InitializationError;
|
||||
import org.junit.runners.model.RunnerBuilder;
|
||||
|
||||
/**
|
||||
* This class is based on org.junit.experimental.categories.Categories from JUnit 4.10.
|
||||
*
|
||||
* All anotations and inner classes from the original class Categories are removed,
|
||||
* since they will be re-used.
|
||||
* Unfortunately sub-classing Categories did not work.
|
||||
*/
|
||||
public class FlexibleCategories extends Suite {
|
||||
|
||||
/**
|
||||
* Specifies the package which should be scanned for test classes (e.g. @TestScanPackage("my.package")).
|
||||
* This annotation is required.
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TestScanPackage {
|
||||
public String value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the prefix of matching class names (e.g. @TestClassPrefix("Test")).
|
||||
* This annotation is optional (default: "").
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TestClassPrefix {
|
||||
public String value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the suffix of matching class names (e.g. @TestClassSuffix("Test")).
|
||||
* This annotation is optional (default: "Test").
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TestClassSuffix {
|
||||
public String value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies an annotation for methods which must be present in a matching class (e.g. @TestMethodAnnotationFilter(Test.class)).
|
||||
* This annotation is optional (default: org.junit.Test.class).
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TestMethodAnnotation {
|
||||
public Class<? extends Annotation> value();
|
||||
}
|
||||
|
||||
public FlexibleCategories(Class<?> clazz, RunnerBuilder builder)
|
||||
throws InitializationError {
|
||||
this(builder, clazz, PatternClasspathClassesFinder.getSuiteClasses(
|
||||
getTestScanPackage(clazz), getTestClassPrefix(clazz), getTestClassSuffix(clazz),
|
||||
getTestMethodAnnotation(clazz)));
|
||||
try {
|
||||
filter(new CategoryFilter(getIncludedCategory(clazz),
|
||||
getExcludedCategory(clazz)));
|
||||
} catch (NoTestsRemainException e) {
|
||||
// Ignore all classes with no matching tests.
|
||||
}
|
||||
assertNoCategorizedDescendentsOfUncategorizeableParents(getDescription());
|
||||
}
|
||||
|
||||
public FlexibleCategories(RunnerBuilder builder, Class<?> clazz,
|
||||
Class<?>[] suiteClasses) throws InitializationError {
|
||||
super(builder, clazz, suiteClasses);
|
||||
}
|
||||
|
||||
private static String getTestScanPackage(Class<?> clazz) throws InitializationError {
|
||||
TestScanPackage annotation = clazz.getAnnotation(TestScanPackage.class);
|
||||
if (annotation == null) {
|
||||
throw new InitializationError("No package given to scan for tests!\nUse the annotation @TestScanPackage(\"my.package\") on the test suite " + clazz + ".");
|
||||
}
|
||||
return annotation.value();
|
||||
}
|
||||
|
||||
private static String getTestClassPrefix(Class<?> clazz) {
|
||||
TestClassPrefix annotation = clazz.getAnnotation(TestClassPrefix.class);
|
||||
return annotation == null ? "" : annotation.value();
|
||||
}
|
||||
|
||||
private static String getTestClassSuffix(Class<?> clazz) {
|
||||
TestClassSuffix annotation = clazz.getAnnotation(TestClassSuffix.class);
|
||||
return annotation == null ? "Test" : annotation.value();
|
||||
}
|
||||
|
||||
private static Class<? extends Annotation> getTestMethodAnnotation(Class<?> clazz) {
|
||||
TestMethodAnnotation annotation = clazz.getAnnotation(TestMethodAnnotation.class);
|
||||
return annotation == null ? Test.class : annotation.value();
|
||||
}
|
||||
|
||||
private Class<?> getIncludedCategory(Class<?> clazz) {
|
||||
IncludeCategory annotation= clazz.getAnnotation(IncludeCategory.class);
|
||||
return annotation == null ? null : annotation.value();
|
||||
}
|
||||
|
||||
private Class<?> getExcludedCategory(Class<?> clazz) {
|
||||
ExcludeCategory annotation= clazz.getAnnotation(ExcludeCategory.class);
|
||||
return annotation == null ? null : annotation.value();
|
||||
}
|
||||
|
||||
private void assertNoCategorizedDescendentsOfUncategorizeableParents(Description description) throws InitializationError {
|
||||
if (!canHaveCategorizedChildren(description))
|
||||
assertNoDescendantsHaveCategoryAnnotations(description);
|
||||
for (Description each : description.getChildren())
|
||||
assertNoCategorizedDescendentsOfUncategorizeableParents(each);
|
||||
}
|
||||
|
||||
private void assertNoDescendantsHaveCategoryAnnotations(Description description) throws InitializationError {
|
||||
for (Description each : description.getChildren()) {
|
||||
if (each.getAnnotation(Category.class) != null)
|
||||
throw new InitializationError("Category annotations on Parameterized classes are not supported on individual methods.");
|
||||
assertNoDescendantsHaveCategoryAnnotations(each);
|
||||
}
|
||||
}
|
||||
|
||||
// If children have names like [0], our current magical category code can't determine their
|
||||
// parentage.
|
||||
private static boolean canHaveCategorizedChildren(Description description) {
|
||||
for (Description each : description.getChildren())
|
||||
if (each.getTestClass() == null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.groups;
|
||||
|
||||
public interface IgnoreTestCategory {}
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package com.owncloud.android.test.ui.groups;
|
||||
|
||||
public interface InProgressCategory extends IgnoreTestCategory{
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.groups;
|
||||
|
||||
public interface NoIgnoreTestCategory {
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.groups;
|
||||
|
||||
public interface OtherTestCategory extends IgnoreTestCategory {}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
package com.owncloud.android.test.ui.groups;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Modified version of ClasspathClassesFinder from:
|
||||
* http://linsolas.free.fr/wordpress/index.php/2011/02/how-to-categorize-junit-tests-with-maven/
|
||||
*
|
||||
* The difference is, that it does not search for annotated classes but for classes with a certain
|
||||
* class name prefix and suffix.
|
||||
*/
|
||||
public final class PatternClasspathClassesFinder {
|
||||
|
||||
/**
|
||||
* Get the list of classes of a given package name, and that are annotated
|
||||
* by a given annotation.
|
||||
*
|
||||
* @param packageName
|
||||
* The package name of the classes.
|
||||
* @param classPrefix
|
||||
* The prefix of the class name.
|
||||
* @param classSuffix
|
||||
* The suffix of the class name.
|
||||
* @param methodAnnotation
|
||||
* Only return classes containing methods annotated with methodAnnotation.
|
||||
* @return The List of classes that matches the requirements.
|
||||
*/
|
||||
public static Class<?>[] getSuiteClasses(String packageName,
|
||||
String classPrefix, String classSuffix,
|
||||
Class<? extends Annotation> methodAnnotation) {
|
||||
try {
|
||||
return getClasses(packageName, classPrefix, classSuffix, methodAnnotation);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of classes of a given package name, and that are annotated
|
||||
* by a given annotation.
|
||||
*
|
||||
* @param packageName
|
||||
* The package name of the classes.
|
||||
* @param classPrefix
|
||||
* The prefix of the class name.
|
||||
* @param classSuffix
|
||||
* The suffix of the class name.
|
||||
* @param methodAnnotation
|
||||
* Only return classes containing methods annotated with methodAnnotation.
|
||||
* @return The List of classes that matches the requirements.
|
||||
* @throws ClassNotFoundException
|
||||
* If something goes wrong...
|
||||
* @throws IOException
|
||||
* If something goes wrong...
|
||||
*/
|
||||
private static Class<?>[] getClasses(String packageName,
|
||||
String classPrefix, String classSuffix,
|
||||
Class<? extends Annotation> methodAnnotation)
|
||||
throws ClassNotFoundException, IOException {
|
||||
ClassLoader classLoader = Thread.currentThread()
|
||||
.getContextClassLoader();
|
||||
String path = packageName.replace('.', '/');
|
||||
// Get classpath
|
||||
Enumeration<URL> resources = classLoader.getResources(path);
|
||||
List<File> dirs = new ArrayList<File>();
|
||||
while (resources.hasMoreElements()) {
|
||||
URL resource = resources.nextElement();
|
||||
dirs.add(new File(resource.getFile()));
|
||||
}
|
||||
// For each classpath, get the classes.
|
||||
ArrayList<Class<?>> classes = new ArrayList<Class<?>>();
|
||||
for (File directory : dirs) {
|
||||
classes.addAll(findClasses(directory, packageName, classPrefix, classSuffix, methodAnnotation));
|
||||
}
|
||||
return classes.toArray(new Class[classes.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find classes, in a given directory (recursively), for a given package
|
||||
* name, that are annotated by a given annotation.
|
||||
*
|
||||
* @param directory
|
||||
* The directory where to look for.
|
||||
* @param packageName
|
||||
* The package name of the classes.
|
||||
* @param classPrefix
|
||||
* The prefix of the class name.
|
||||
* @param classSuffix
|
||||
* The suffix of the class name.
|
||||
* @param methodAnnotation
|
||||
* Only return classes containing methods annotated with methodAnnotation.
|
||||
* @return The List of classes that matches the requirements.
|
||||
* @throws ClassNotFoundException
|
||||
* If something goes wrong...
|
||||
*/
|
||||
private static List<Class<?>> findClasses(File directory,
|
||||
String packageName, String classPrefix, String classSuffix,
|
||||
Class<? extends Annotation> methodAnnotation)
|
||||
throws ClassNotFoundException {
|
||||
List<Class<?>> classes = new ArrayList<Class<?>>();
|
||||
if (!directory.exists()) {
|
||||
return classes;
|
||||
}
|
||||
File[] files = directory.listFiles();
|
||||
for (File file : files) {
|
||||
if (file.isDirectory()) {
|
||||
classes.addAll(findClasses(file,
|
||||
packageName + "." + file.getName(), classPrefix, classSuffix, methodAnnotation));
|
||||
} else if (file.getName().startsWith(classPrefix) && file.getName().endsWith(classSuffix + ".class")) {
|
||||
// We remove the .class at the end of the filename to get the
|
||||
// class name...
|
||||
Class<?> clazz = Class.forName(packageName
|
||||
+ '.'
|
||||
+ file.getName().substring(0,
|
||||
file.getName().length() - 6));
|
||||
|
||||
// Check, if class contains test methods (prevent "No runnable methods" exception):
|
||||
boolean classHasTest = false;
|
||||
for (Method method : clazz.getMethods()) {
|
||||
if (method.getAnnotation(methodAnnotation) != null) {
|
||||
classHasTest = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (classHasTest) {
|
||||
classes.add(clazz);
|
||||
}
|
||||
}
|
||||
}
|
||||
return classes;
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.groups;
|
||||
|
||||
public interface SmokeTestCategory {
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.groups;
|
||||
|
||||
public interface UnfinishedTestCategory extends IgnoreTestCategory{
|
||||
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
public class CertificatePopUp {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@AndroidFindBy(name = "OK")
|
||||
private AndroidElement okButton;
|
||||
|
||||
public CertificatePopUp (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public void clickOnOkButton () {
|
||||
okButton.click();
|
||||
}
|
||||
|
||||
public AndroidElement getOkButtonElement () {
|
||||
return okButton;
|
||||
}
|
||||
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
public class ElementMenuOptions {
|
||||
|
||||
final AndroidDriver driver;
|
||||
|
||||
@AndroidFindBy(name = "Share link")
|
||||
private AndroidElement shareLinkElement;
|
||||
|
||||
@AndroidFindBy(name = "Unshare link")
|
||||
private AndroidElement unshareLinkElement;
|
||||
|
||||
@AndroidFindBy(name = "Details")
|
||||
private AndroidElement detailsFileElement;
|
||||
|
||||
@AndroidFindBy(name = "Rename")
|
||||
private AndroidElement renameFileElement;
|
||||
|
||||
@AndroidFindBy(name = "Remove")
|
||||
private AndroidElement removeFileElement;
|
||||
|
||||
@AndroidFindBy(name = "Move")
|
||||
private AndroidElement moveElement;
|
||||
|
||||
public ElementMenuOptions (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public FileDetailsView clickOnDetails () {
|
||||
detailsFileElement.click();
|
||||
FileDetailsView fileDetailsView = new FileDetailsView(driver);
|
||||
return fileDetailsView;
|
||||
}
|
||||
|
||||
public RemoveConfirmationView clickOnRemove () {
|
||||
removeFileElement.click();
|
||||
RemoveConfirmationView removeConfirmationView =
|
||||
new RemoveConfirmationView(driver);
|
||||
return removeConfirmationView;
|
||||
}
|
||||
|
||||
|
||||
public MoveView clickOnMove () {
|
||||
moveElement.click();
|
||||
MoveView moveView = new MoveView(driver);
|
||||
return moveView;
|
||||
}
|
||||
|
||||
public NewFolderPopUp clickOnRename () {
|
||||
renameFileElement.click();
|
||||
NewFolderPopUp newFolderPopUp = new NewFolderPopUp(driver);
|
||||
return newFolderPopUp;
|
||||
}
|
||||
|
||||
public ShareView clickOnShareLinkElement () {
|
||||
shareLinkElement.click();
|
||||
ShareView shareView = new ShareView(driver);
|
||||
return shareView;
|
||||
}
|
||||
|
||||
public WaitAMomentPopUp clickOnUnshareLinkElement () {
|
||||
unshareLinkElement.click();
|
||||
WaitAMomentPopUp waitAMomentPopUp = new WaitAMomentPopUp(driver);
|
||||
return waitAMomentPopUp;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.CacheLookup;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
public class FileDetailsView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(name = "Keep file up to date")
|
||||
private AndroidElement keepFileUpToDateCheckbox;
|
||||
|
||||
@AndroidFindBy(id = "com.owncloud.android:id/fdProgressBar")
|
||||
private AndroidElement progressBar;
|
||||
|
||||
public FileDetailsView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public void checkKeepFileUpToDateCheckbox () {
|
||||
if(keepFileUpToDateCheckbox.getAttribute("checked").equals("false")){
|
||||
keepFileUpToDateCheckbox.click();
|
||||
}
|
||||
}
|
||||
|
||||
public void unCheckKeepFileUpToDateCheckbox () {
|
||||
if(keepFileUpToDateCheckbox.getAttribute("checked").equals("true")){
|
||||
keepFileUpToDateCheckbox.click();
|
||||
}
|
||||
}
|
||||
|
||||
public AndroidElement getProgressBar (){
|
||||
return progressBar;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.android.AndroidKeyCode;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.NoSuchElementException;
|
||||
import org.openqa.selenium.support.CacheLookup;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
import org.openqa.selenium.Point;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
|
||||
public class FileListView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".description(\"More options\")")
|
||||
private AndroidElement menuButton;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(id = "com.owncloud.android:id/list_root")
|
||||
private AndroidElement filesLayout;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".resourceId(\"android:id/action_bar_title\")")
|
||||
private AndroidElement titleText;
|
||||
|
||||
@AndroidFindBy(id = "android:id/progress_circular")
|
||||
private AndroidElement progressCircular;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".description(\"New folder\")")
|
||||
private AndroidElement newFolderButton;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector().description(\"Upload\")")
|
||||
private AndroidElement uploadButton;
|
||||
|
||||
private AndroidElement waitAMomentText;
|
||||
|
||||
@AndroidFindBy(id = "com.owncloud.android:id/ListItemLayout")
|
||||
private List<AndroidElement> listItemLayout;
|
||||
|
||||
@AndroidFindBy(id = "com.owncloud.android:id/list_root")
|
||||
private AndroidElement listRootLayout;
|
||||
|
||||
@AndroidFindBy(name = "Files")
|
||||
private AndroidElement filesElementUploadFile;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".description(\"List Layout\")")
|
||||
private AndroidElement listLayout;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.FrameLayout\").index(0)")
|
||||
private AndroidElement deviceScreen;
|
||||
|
||||
private AndroidElement fileElement;
|
||||
|
||||
private AndroidElement fileElementLayout;
|
||||
|
||||
private static String localFileIndicator =
|
||||
"com.owncloud.android:id/localFileIndicator";
|
||||
private static String favoriteFileIndicator =
|
||||
"com.owncloud.android:id/keptOfflineIcon";
|
||||
private static String sharedElementIndicator =
|
||||
"com.owncloud.android:id/sharedIcon";
|
||||
|
||||
|
||||
public FileListView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public MenuList clickOnMenuButton () {
|
||||
//if the menu option is not in the actionBar, it is opening again
|
||||
try {
|
||||
menuButton.click();
|
||||
} catch (NoSuchElementException e){
|
||||
driver.sendKeyEvent(AndroidKeyCode.MENU);
|
||||
}
|
||||
MenuList menuList = new MenuList (driver);
|
||||
return menuList;
|
||||
}
|
||||
|
||||
public SettingsView getSettingsView () {
|
||||
SettingsView settingsView = new SettingsView(driver);
|
||||
return settingsView;
|
||||
}
|
||||
|
||||
public NewFolderPopUp clickOnNewFolderButton () {
|
||||
newFolderButton.click();
|
||||
NewFolderPopUp newFolderPopUp = new NewFolderPopUp(driver);
|
||||
return newFolderPopUp;
|
||||
}
|
||||
|
||||
public void clickOnUploadButton () {
|
||||
uploadButton.click();
|
||||
}
|
||||
|
||||
public UploadFilesView clickOnFilesElementUploadFile () {
|
||||
filesElementUploadFile.click();
|
||||
UploadFilesView uploadFilesView = new UploadFilesView(driver);
|
||||
return uploadFilesView;
|
||||
}
|
||||
|
||||
public AndroidElement getTitleTextElement () {
|
||||
return titleText;
|
||||
}
|
||||
|
||||
public AndroidElement getUploadButton () {
|
||||
return uploadButton;
|
||||
}
|
||||
|
||||
public AndroidElement getWaitAMomentTextElement () {
|
||||
return waitAMomentText;
|
||||
}
|
||||
|
||||
public AndroidElement getListRootElement () {
|
||||
return listRootLayout;
|
||||
}
|
||||
|
||||
public List<AndroidElement> getListItemLayout () {
|
||||
return listItemLayout;
|
||||
}
|
||||
|
||||
public AndroidElement getFileElement () {
|
||||
return fileElement;
|
||||
}
|
||||
|
||||
public ElementMenuOptions longPressOnElement (String elementName) {
|
||||
scrollTillFindElement(elementName).tap(1, 1000);
|
||||
//fileElement.tap(1, 1000);
|
||||
ElementMenuOptions menuOptions = new ElementMenuOptions(driver);
|
||||
return menuOptions;
|
||||
}
|
||||
|
||||
public AndroidElement scrollTillFindElement (String elementName) {
|
||||
fileElement = Actions
|
||||
.scrollTillFindElement (elementName,filesLayout,driver);
|
||||
try {
|
||||
fileElementLayout = (AndroidElement) driver
|
||||
.findElementByAndroidUIAutomator("new UiSelector()"
|
||||
+ ".description(\"LinearLayout-"+ elementName +"\")");
|
||||
} catch (NoSuchElementException e) {
|
||||
fileElementLayout = null;
|
||||
}
|
||||
return fileElement;
|
||||
}
|
||||
|
||||
public AndroidElement getFileElementLayout () {
|
||||
return fileElementLayout;
|
||||
}
|
||||
|
||||
public AndroidElement getProgressCircular () {
|
||||
return progressCircular;
|
||||
}
|
||||
|
||||
public static String getLocalFileIndicator() {
|
||||
return localFileIndicator;
|
||||
}
|
||||
|
||||
public static String getFavoriteFileIndicator() {
|
||||
return favoriteFileIndicator;
|
||||
}
|
||||
|
||||
public static String getSharedElementIndicator() {
|
||||
return sharedElementIndicator;
|
||||
}
|
||||
public void pulldownToRefresh () throws InterruptedException {
|
||||
Point listLocation = listLayout.getLocation();
|
||||
driver.swipe(listLocation.getX(),listLocation.getY(),
|
||||
listLocation.getX(),listLocation.getY()+1000, 5000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void pulldownToSeeNotification () throws InterruptedException {
|
||||
Point listLocation = deviceScreen.getLocation();
|
||||
driver.swipe(listLocation.getX(),listLocation.getY(),
|
||||
listLocation.getX(),listLocation.getY()+1000, 5000);
|
||||
}
|
||||
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.NoSuchElementException;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
public class GmailEmailListView {
|
||||
|
||||
final AndroidDriver driver;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector().description(\""
|
||||
+ "me about UploadFile, on May 11, conversation read\")")
|
||||
private AndroidElement emailAmericanFormatDate;
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector().description(\""
|
||||
+ "me about UploadFile, on 11 May, conversation read\")")
|
||||
private AndroidElement emailEuropeanFormatDate;
|
||||
|
||||
|
||||
public GmailEmailListView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public GmailEmailView clickOnEmail (){
|
||||
try{
|
||||
emailAmericanFormatDate.click();
|
||||
}catch (NoSuchElementException e) {
|
||||
emailEuropeanFormatDate.click();
|
||||
}
|
||||
GmailEmailView gmailEmailView = new GmailEmailView(driver);
|
||||
return gmailEmailView;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.CacheLookup;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
import com.owncloud.android.test.ui.testSuites.Config;
|
||||
|
||||
public class GmailEmailView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(name = Config.fileToTestSendByEmailName)
|
||||
private AndroidElement fileButton;
|
||||
|
||||
public GmailEmailView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public ImageView clickOnfileButton (){
|
||||
fileButton.click();
|
||||
ImageView imageView = new ImageView(driver);
|
||||
return imageView;
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.CacheLookup;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
public class GmailSendMailView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector().description(\"To\")")
|
||||
private AndroidElement toTextField;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(name = "Subject")
|
||||
private AndroidElement subjectTextField;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector().description(\"Send\")")
|
||||
private AndroidElement sendButton;
|
||||
|
||||
public GmailSendMailView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public void typeToEmailAdress (String email) {
|
||||
toTextField.sendKeys(email + "\n");
|
||||
}
|
||||
|
||||
public void clickOnSendButton () {
|
||||
sendButton.click();
|
||||
}
|
||||
|
||||
public void typeSubject (String subject) {
|
||||
subjectTextField.clear();
|
||||
subjectTextField.sendKeys(subject);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
import org.openqa.selenium.support.CacheLookup;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.testSuites.Common;
|
||||
|
||||
|
||||
public class ImageView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".description(\"More options\")")
|
||||
private AndroidElement optionsButton;
|
||||
|
||||
@AndroidFindBy(name = "Share")
|
||||
private AndroidElement shareButton;
|
||||
|
||||
@AndroidFindBy(name = "ownCloud")
|
||||
private AndroidElement ownCloudButton;
|
||||
|
||||
@AndroidFindBy(name = "Share with ownCloud")
|
||||
private AndroidElement shareWithOwnCloudButton;
|
||||
|
||||
@AndroidFindBy(name = "Just once")
|
||||
private AndroidElement justOnceButton;
|
||||
|
||||
@AndroidFindBy(id = "android:id/resolver_list")
|
||||
private AndroidElement sharingAppsLayout;
|
||||
|
||||
public ImageView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public void clickOnOptionsButton(){
|
||||
optionsButton.click();
|
||||
}
|
||||
|
||||
public void clickOnShareButton(){
|
||||
shareButton.click();
|
||||
}
|
||||
|
||||
public void clickOnOwnCloudButton(){
|
||||
if(Common.isElementPresent(ownCloudButton)){
|
||||
Actions.scrollTillFindElement("ownCloud",sharingAppsLayout,driver);
|
||||
ownCloudButton.click();
|
||||
}else if(Common.isElementPresent(shareWithOwnCloudButton)){}
|
||||
}
|
||||
|
||||
public void clickOnJustOnceButton(){
|
||||
justOnceButton.click();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import org.openqa.selenium.support.CacheLookup;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
public class LoginForm {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".description(\"Server address\")")
|
||||
private AndroidElement hostUrlInput;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector().description(\"Username\")")
|
||||
private AndroidElement userNameInput;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector().description(\"Password\")")
|
||||
private AndroidElement passwordInput;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector().description(\"Connect\")")
|
||||
private AndroidElement connectButton;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".description(\"Testing connection\")")
|
||||
private AndroidElement serverStatusText;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".description(\"Wrong username or password\")")
|
||||
private AndroidElement authStatusText;
|
||||
|
||||
public LoginForm (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public CertificatePopUp typeHostUrl (String hostUrl) {
|
||||
hostUrlInput.clear();
|
||||
hostUrlInput.sendKeys(hostUrl + "\n");
|
||||
CertificatePopUp certificatePopUp = new CertificatePopUp(driver);
|
||||
return certificatePopUp;
|
||||
}
|
||||
|
||||
public void clickOnUserName () {
|
||||
userNameInput.click();
|
||||
}
|
||||
|
||||
public void typeUserName (String userName) {
|
||||
userNameInput.clear();
|
||||
//using the \n , it not need to hide the keyboard
|
||||
//which sometimes gives problems
|
||||
userNameInput.sendKeys(userName + "\n");
|
||||
//driver.hideKeyboard();
|
||||
}
|
||||
|
||||
public void typePassword (String password) {
|
||||
passwordInput.clear();
|
||||
passwordInput.sendKeys(password + "\n");
|
||||
//driver.hideKeyboard();
|
||||
}
|
||||
|
||||
public FileListView clickOnConnectButton () {
|
||||
connectButton.click();
|
||||
FileListView fileListView = new FileListView(driver);
|
||||
return fileListView;
|
||||
}
|
||||
|
||||
public AndroidElement gethostUrlInput () {
|
||||
return hostUrlInput;
|
||||
}
|
||||
|
||||
public AndroidElement getUserNameInput () {
|
||||
return userNameInput;
|
||||
}
|
||||
|
||||
public AndroidElement getPasswordInput () {
|
||||
return passwordInput;
|
||||
}
|
||||
|
||||
|
||||
public AndroidElement getServerStatusTextElement () {
|
||||
return serverStatusText;
|
||||
}
|
||||
|
||||
public AndroidElement getAuthStatusText () {
|
||||
return authStatusText;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
public class MenuList {
|
||||
|
||||
final AndroidDriver driver;
|
||||
|
||||
@AndroidFindBy(name = "Settings")
|
||||
private AndroidElement settingsButton;
|
||||
|
||||
public MenuList (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public SettingsView clickOnSettingsButton () {
|
||||
settingsButton.click();
|
||||
SettingsView settingsView = new SettingsView(driver);
|
||||
return settingsView;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.CacheLookup;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
|
||||
public class MoveView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(id = "com.owncloud.android:id/list_root")
|
||||
private AndroidElement filesLayout;
|
||||
|
||||
@AndroidFindBy(name = "Choose")
|
||||
private AndroidElement chooseButton;
|
||||
|
||||
public MoveView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public WaitAMomentPopUp clickOnChoose () {
|
||||
chooseButton.click();
|
||||
WaitAMomentPopUp waitAMomentPopUp = new WaitAMomentPopUp(driver);
|
||||
return waitAMomentPopUp;
|
||||
}
|
||||
|
||||
public AndroidElement scrollTillFindElement (String elementName) {
|
||||
return Actions.scrollTillFindElement (elementName,filesLayout,driver);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
public class NewFolderPopUp {
|
||||
|
||||
final AndroidDriver driver;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".resourceId(\"android:id/button1\")")
|
||||
private AndroidElement newFolderOkButton;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".resourceId(\"com.owncloud.android:id/user_input\")")
|
||||
private AndroidElement newFolderNameField;
|
||||
|
||||
public NewFolderPopUp (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public void typeNewFolderName (String newFolderName) {
|
||||
newFolderNameField.clear();
|
||||
newFolderNameField.sendKeys(newFolderName + "\n");
|
||||
//driver.hideKeyboard();
|
||||
}
|
||||
|
||||
public WaitAMomentPopUp clickOnNewFolderOkButton () {
|
||||
newFolderOkButton.click();
|
||||
WaitAMomentPopUp waitAMomentPopUp = new WaitAMomentPopUp(driver);
|
||||
return waitAMomentPopUp;
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
public class NotificationView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@AndroidFindBy(name = "Upload succeeded")
|
||||
private static AndroidElement uploadSucceededNotification;
|
||||
|
||||
@AndroidFindBy(name = "Uploading ?")
|
||||
private static AndroidElement uploadingNotification;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector().description(\"Clear all notifications.\")")
|
||||
private AndroidElement clearAllNotificationButton;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.FrameLayout\").index(0)")
|
||||
private AndroidElement notificationArea;
|
||||
|
||||
|
||||
public NotificationView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
|
||||
public AndroidElement getUploadSucceededNotification() {
|
||||
return uploadSucceededNotification;
|
||||
}
|
||||
|
||||
public AndroidElement getUploadingNotification() {
|
||||
return uploadingNotification;
|
||||
}
|
||||
|
||||
public AndroidElement getClearAllNotificationButton() {
|
||||
return clearAllNotificationButton;
|
||||
}
|
||||
|
||||
public void tapOnClearAllNotification () {
|
||||
clearAllNotificationButton.tap(1, 1000);
|
||||
}
|
||||
|
||||
public void tapOnBottomNotificationArea(){
|
||||
//TODO. it is not working
|
||||
notificationArea.getSize();
|
||||
notificationArea.tap(1, 1000);
|
||||
}
|
||||
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
public class PassCodeRequestView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".className(\"android.widget.EditText\").index(0)")
|
||||
private AndroidElement codeElement1;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".className(\"android.widget.EditText\").index(1)")
|
||||
private AndroidElement codeElement2;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".className(\"android.widget.EditText\").index(2)")
|
||||
private AndroidElement codeElement3;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".className(\"android.widget.EditText\").index(3)")
|
||||
private AndroidElement codeElement4;
|
||||
|
||||
public PassCodeRequestView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public void enterPasscode(String codeNumber1, String codeNumber2,
|
||||
String codeNumber3, String codeNumber4){
|
||||
codeElement1
|
||||
.sendKeys(codeNumber1 + codeNumber1 + codeNumber1 + codeNumber1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
public class PassCodeView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".className(\"android.widget.EditText\").index(0)")
|
||||
private AndroidElement codeElement1;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".className(\"android.widget.EditText\").index(1)")
|
||||
private AndroidElement codeElement2;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".className(\"android.widget.EditText\").index(2)")
|
||||
private AndroidElement codeElement3;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".className(\"android.widget.EditText\").index(3)")
|
||||
private AndroidElement codeElement4;
|
||||
|
||||
@AndroidFindBy(name = "Cancel")
|
||||
private AndroidElement cancelButton;
|
||||
|
||||
public PassCodeView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public PassCodeView enterPasscode(String codeNumber1, String codeNumber2,
|
||||
String codeNumber3, String codeNumber4){
|
||||
codeElement1
|
||||
.sendKeys(codeNumber1 + codeNumber1 + codeNumber1 + codeNumber1);
|
||||
return this;
|
||||
}
|
||||
public SettingsView reenterPasscode(String codeNumber1,
|
||||
String codeNumber2, String codeNumber3, String codeNumber4){
|
||||
codeElement1
|
||||
.sendKeys(codeNumber1 + codeNumber1 + codeNumber1 + codeNumber1);
|
||||
SettingsView settingsView = new SettingsView(driver);
|
||||
return settingsView;
|
||||
}
|
||||
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
public class RemoveConfirmationView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@AndroidFindBy(name = "Remote and local")
|
||||
private AndroidElement remoteAndLocalButton;
|
||||
|
||||
public RemoveConfirmationView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public WaitAMomentPopUp clickOnRemoteAndLocalButton () {
|
||||
remoteAndLocalButton.click();
|
||||
WaitAMomentPopUp waitAMomentPopUp = new WaitAMomentPopUp(driver);
|
||||
return waitAMomentPopUp;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.CacheLookup;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
import com.owncloud.android.test.ui.testSuites.Config;
|
||||
|
||||
public class SettingsView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(name = Config.userAccount)
|
||||
private AndroidElement accountElement;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(name = Config.userAccount2)
|
||||
private AndroidElement accountElement2;
|
||||
|
||||
@AndroidFindBy(name = "Delete account")
|
||||
private AndroidElement deleteAccountElement;
|
||||
|
||||
@AndroidFindBy(name = "Change password")
|
||||
private AndroidElement changePasswordElement;
|
||||
|
||||
@AndroidFindBy(name = "Add account")
|
||||
private AndroidElement addAccountElement;
|
||||
|
||||
@AndroidFindBy(uiAutomator = "new UiSelector()"
|
||||
+ ".className(\"android.widget.CheckBox\").index(0)")
|
||||
private AndroidElement passcodeCheckbox;
|
||||
|
||||
public SettingsView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public void tapOnAccountElement (int accountPosition, int fingers, int milliSeconds) {
|
||||
if(accountPosition==1)
|
||||
accountElement.tap(fingers, milliSeconds);
|
||||
else
|
||||
accountElement2.tap(fingers, milliSeconds);
|
||||
}
|
||||
|
||||
public void tapOnAddAccount (int fingers, int milliSeconds) {
|
||||
addAccountElement.tap(fingers, milliSeconds);
|
||||
}
|
||||
|
||||
public LoginForm clickOnDeleteAccountElement () {
|
||||
deleteAccountElement.click();
|
||||
LoginForm loginForm = new LoginForm(driver);
|
||||
return loginForm;
|
||||
}
|
||||
|
||||
public LoginForm clickOnChangePasswordElement () {
|
||||
changePasswordElement.click();
|
||||
LoginForm loginForm = new LoginForm(driver);
|
||||
return loginForm;
|
||||
}
|
||||
|
||||
public PassCodeView EnablePassCode(){
|
||||
if(!passcodeCheckbox.isSelected()){
|
||||
passcodeCheckbox.click();
|
||||
}
|
||||
PassCodeView passcodeview = new PassCodeView(driver);
|
||||
return passcodeview;
|
||||
}
|
||||
|
||||
public PassCodeView DisablePassCode(){
|
||||
if(passcodeCheckbox.isSelected()){
|
||||
passcodeCheckbox.click();
|
||||
}
|
||||
PassCodeView passcodeview = new PassCodeView(driver);
|
||||
return passcodeview;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.CacheLookup;
|
||||
import org.openqa.selenium.support.FindBy;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
public class ShareView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@CacheLookup
|
||||
@FindBy(id = "android:id/select_dialog_listview")
|
||||
private AndroidElement listViewLayout;
|
||||
|
||||
public ShareView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public AndroidElement getListViewLayout () {
|
||||
return listViewLayout;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.CacheLookup;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
|
||||
public class UploadFilesView{
|
||||
final AndroidDriver driver;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(id = "com.owncloud.android:id/list_root")
|
||||
private AndroidElement filesLayout;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(id = "com.owncloud.android:id/upload_files_btn_upload")
|
||||
private AndroidElement uploadButton;
|
||||
|
||||
private AndroidElement fileElement;
|
||||
|
||||
public UploadFilesView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public FileListView clickOnUploadButton () {
|
||||
uploadButton.click();
|
||||
FileListView fileListView = new FileListView (driver);
|
||||
return fileListView;
|
||||
}
|
||||
|
||||
//change to scrollTillFindElement
|
||||
public void scrollTillFindFile (String fileName) {
|
||||
fileElement = Actions
|
||||
.scrollTillFindElement(fileName,filesLayout,driver);
|
||||
}
|
||||
|
||||
public void clickOnFileName (String fileName) {
|
||||
scrollTillFindFile(fileName);
|
||||
fileElement.click();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
import org.openqa.selenium.support.CacheLookup;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
public class UploadView {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@CacheLookup
|
||||
@AndroidFindBy(name = "Upload")
|
||||
private AndroidElement uploadButton;
|
||||
|
||||
public UploadView (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public void clickOUploadButton () {
|
||||
uploadButton.click();
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.models;
|
||||
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
import io.appium.java_client.pagefactory.AndroidFindBy;
|
||||
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
|
||||
|
||||
public class WaitAMomentPopUp {
|
||||
final AndroidDriver driver;
|
||||
|
||||
@AndroidFindBy(name = "Wait a moment")
|
||||
private AndroidElement waitAMomentText;
|
||||
|
||||
public WaitAMomentPopUp (AndroidDriver driver) {
|
||||
this.driver = driver;
|
||||
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
|
||||
}
|
||||
|
||||
public AndroidElement getWaitAMomentTextElement () {
|
||||
return waitAMomentText;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Config.java
|
||||
@@ -0,0 +1,203 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.NoSuchElementException;
|
||||
import org.openqa.selenium.OutputType;
|
||||
import org.openqa.selenium.TimeoutException;
|
||||
import org.openqa.selenium.remote.DesiredCapabilities;
|
||||
import org.openqa.selenium.remote.RemoteWebDriver;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
|
||||
public class Common{
|
||||
AndroidDriver driver;
|
||||
static int waitingTime = 30;
|
||||
|
||||
public WebDriverWait wait;
|
||||
|
||||
protected AndroidDriver setUpCommonDriver () throws Exception {
|
||||
File rootPath = new File(System.getProperty("user.dir"));
|
||||
File appDir = new File(rootPath,"src/test/resources");
|
||||
File app = new File(appDir,"ownCloud.apk");
|
||||
DesiredCapabilities capabilities = new DesiredCapabilities();
|
||||
capabilities.setCapability("platformName", "Android");
|
||||
capabilities.setCapability("deviceName", "test");
|
||||
capabilities.setCapability("app", app.getAbsolutePath());
|
||||
capabilities.setCapability("appPackage", "com.owncloud.android");
|
||||
capabilities.setCapability("appActivity",
|
||||
".ui.activity.FileDisplayActivity");
|
||||
capabilities.setCapability("appWaitActivity",
|
||||
".authentication.AuthenticatorActivity");
|
||||
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),
|
||||
capabilities);
|
||||
driver.manage().timeouts().implicitlyWait(waitingTime,
|
||||
TimeUnit.SECONDS);
|
||||
wait = new WebDriverWait(driver, waitingTime, 50);
|
||||
return driver;
|
||||
|
||||
}
|
||||
|
||||
protected boolean waitForTextPresent(String text, AndroidElement element)
|
||||
throws InterruptedException{
|
||||
for (int second = 0;;second++){
|
||||
if (second >= waitingTime)
|
||||
return false;
|
||||
try{
|
||||
if (text.equals(element.getText()))
|
||||
break;
|
||||
} catch (Exception e){
|
||||
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean isElementPresent(AndroidElement element, By by) {
|
||||
try {
|
||||
element.findElement(by);
|
||||
return true;
|
||||
} catch (NoSuchElementException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isElementPresent(AndroidElement element) {
|
||||
try{
|
||||
element.isDisplayed();
|
||||
} catch (NoSuchElementException e){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//pollingTime in milliseconds
|
||||
public static void waitTillElementIsNotPresent (AndroidElement element,
|
||||
int pollingTime) throws Exception {
|
||||
for (int time = 0;time <= waitingTime * 1000;time += pollingTime){
|
||||
try{
|
||||
element.isDisplayed();
|
||||
} catch (NoSuchElementException e){
|
||||
return;
|
||||
}
|
||||
Thread.sleep(pollingTime);
|
||||
}
|
||||
throw new TimeoutException();
|
||||
}
|
||||
|
||||
public static void waitTillElementIsNotPresentWithoutTimeout (
|
||||
AndroidElement element,int pollingTime)
|
||||
throws InterruptedException {
|
||||
for (int time = 0;time <= waitingTime * 1000;time += pollingTime){
|
||||
try{
|
||||
element.isDisplayed();
|
||||
} catch (NoSuchElementException e){
|
||||
return;
|
||||
}
|
||||
Thread.sleep(pollingTime);
|
||||
}
|
||||
}
|
||||
|
||||
public static void waitTillElementIsPresent (
|
||||
AndroidElement element,int pollingTime)
|
||||
throws InterruptedException {
|
||||
for (int time = 0;time <= waitingTime * 1000;time += pollingTime){
|
||||
try{
|
||||
if(element.isDisplayed()){
|
||||
return;
|
||||
}
|
||||
} catch (NoSuchElementException e){
|
||||
|
||||
}
|
||||
Thread.sleep(pollingTime);
|
||||
}
|
||||
}
|
||||
|
||||
protected void takeScreenShotOnFailed (String testName)
|
||||
throws IOException {
|
||||
File file = ((RemoteWebDriver) driver)
|
||||
.getScreenshotAs(OutputType.FILE);
|
||||
SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date today = Calendar.getInstance().getTime();
|
||||
String screenShotName = "ScreenShots/" + dt1.format(today) + "/"
|
||||
+ testName + ".png";
|
||||
FileUtils.copyFile(file, new File(screenShotName));
|
||||
}
|
||||
|
||||
protected void assertIsInFileListView() throws InterruptedException {
|
||||
//waitForTextPresent("Wrong username or password",
|
||||
// changePasswordForm.getAuthStatusText());
|
||||
Thread.sleep(2000);
|
||||
assertTrue(waitForTextPresent("ownCloud", (AndroidElement) driver
|
||||
.findElementByAndroidUIAutomator("new UiSelector()"
|
||||
+ ".resourceId(\"android:id/action_bar_title\")")));
|
||||
assertTrue(isElementPresent((AndroidElement) driver
|
||||
.findElementByAndroidUIAutomator("new UiSelector()"
|
||||
+ ".description(\"Upload\")")));
|
||||
}
|
||||
|
||||
protected void assertIsNotInFileListView() throws InterruptedException {
|
||||
AndroidElement fileElement;
|
||||
assertTrue(waitForTextPresent("ownCloud", (AndroidElement) driver
|
||||
.findElementByAndroidUIAutomator("new UiSelector()"
|
||||
+ ".resourceId(\"android:id/action_bar_title\")")));
|
||||
try {
|
||||
fileElement = (AndroidElement) driver
|
||||
.findElementByAndroidUIAutomator("new UiSelector()"
|
||||
+ ".description(\"Upload\")");
|
||||
} catch (NoSuchElementException e) {
|
||||
fileElement = null;
|
||||
}
|
||||
assertNull(fileElement);
|
||||
}
|
||||
|
||||
protected void assertIsPasscodeRequestView() throws InterruptedException {
|
||||
assertTrue(waitForTextPresent("ownCloud", (AndroidElement) driver
|
||||
.findElementByAndroidUIAutomator("new UiSelector()"
|
||||
+ ".resourceId(\"android:id/action_bar_title\")")));
|
||||
assertTrue(((AndroidElement) driver.findElementByAndroidUIAutomator(
|
||||
"new UiSelector().text(\"Please, insert your pass code\")"))
|
||||
.isDisplayed());
|
||||
|
||||
}
|
||||
|
||||
protected void assertIsInSettingsView() throws InterruptedException {
|
||||
assertTrue(waitForTextPresent("Settings", (AndroidElement) driver
|
||||
.findElementByAndroidUIAutomator("new UiSelector()"
|
||||
+ ".resourceId(\"android:id/action_bar_title\")")));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
public final class Config {
|
||||
|
||||
//without http or https
|
||||
public static final String URL = "owncloudServerVar";
|
||||
public static boolean isTrusted = true;
|
||||
|
||||
//without http or https
|
||||
public static final String URL2 = "owncloudServer2Var";
|
||||
public static boolean isTrusted2 = true;
|
||||
|
||||
public static final String user = "owncloudUserVar";
|
||||
public static final String password = "owncloudPasswordVar";
|
||||
public static final String user2 = "owncloudUser2Var";
|
||||
public static final String password2 = "owncloudPassword2Var";
|
||||
public static final String userAccount = user + "@"+ URL;
|
||||
public static final String userAccount2 = user2 + "@"+ URL2;
|
||||
|
||||
public static final String gmailAccount = "gmailAccountVar";
|
||||
|
||||
public static final String fileWhichIsInTheServer1 ="test";
|
||||
public static final String fileWhichIsInTheServer2 ="test";
|
||||
|
||||
public static final String fileToTestName = "test";
|
||||
public static final String fileToTestSendByEmailName = "test";
|
||||
public static final String bigFileToTestName = "test";
|
||||
|
||||
public static final String passcode1 = "passcode1";
|
||||
public static final String passcode2 = "passcode2";
|
||||
public static final String passcode3 = "passcode3";
|
||||
public static final String passcode4 = "passcode4";
|
||||
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
import com.owncloud.android.test.ui.models.WaitAMomentPopUp;
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class CreateFolderTestSuite{
|
||||
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
private Boolean folderHasBeenCreated = false;
|
||||
private final String FOLDER_NAME = "testCreateFolder";
|
||||
private String CurrentCreatedFolder = "";
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testCreateNewFolder () throws Exception {
|
||||
String NEW_FOLDER_NAME = "testCreateFolder";
|
||||
|
||||
FileListView fileListView = Actions.login(Config.URL,
|
||||
Config.user,Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//check if the folder already exists and if true, delete them
|
||||
Actions.deleteElement(NEW_FOLDER_NAME, fileListView, driver);
|
||||
|
||||
WaitAMomentPopUp waitAMomentPopUp = Actions
|
||||
.createFolder(NEW_FOLDER_NAME, fileListView);
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp
|
||||
.getWaitAMomentTextElement(), 100);
|
||||
fileListView.scrollTillFindElement(FOLDER_NAME);
|
||||
assertNotNull(fileListView.getFileElement());
|
||||
assertTrue(
|
||||
folderHasBeenCreated=fileListView.getFileElement().isDisplayed());
|
||||
CurrentCreatedFolder = FOLDER_NAME;
|
||||
assertEquals(FOLDER_NAME , fileListView.getFileElement().getText());
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
if (folderHasBeenCreated) {
|
||||
FileListView fileListView = new FileListView(driver);
|
||||
Actions.deleteElement(CurrentCreatedFolder, fileListView, driver);
|
||||
}
|
||||
driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class DeleteFileTestSuite{
|
||||
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
private final String FILE_NAME = Config.fileToTestName;
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testDeleteFile () throws Exception {
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//TODO. if the file already exists, do not upload
|
||||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(FILE_NAME, fileListView);
|
||||
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(
|
||||
fileListViewAfterUploadFile.getProgressCircular(), 1000);
|
||||
common.wait.until(ExpectedConditions.visibilityOf(
|
||||
fileListViewAfterUploadFile.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getLocalFileIndicator()))));
|
||||
|
||||
Actions.deleteElement(FILE_NAME,fileListViewAfterUploadFile, driver);
|
||||
assertFalse(fileListViewAfterUploadFile.getFileElement().isDisplayed());
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
import com.owncloud.android.test.ui.models.WaitAMomentPopUp;
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class DeleteFolderTestSuite{
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
private Boolean folderHasBeenCreated = false;
|
||||
private final String FOLDER_NAME = "testCreateFolder";
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testDeleteFolder () throws Exception {
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//TODO. if the folder already exists, do no created
|
||||
//create the folder
|
||||
WaitAMomentPopUp waitAMomentPopUp = Actions
|
||||
.createFolder(FOLDER_NAME, fileListView);
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(
|
||||
waitAMomentPopUp.getWaitAMomentTextElement(), 100);
|
||||
fileListView.scrollTillFindElement(FOLDER_NAME);
|
||||
assertTrue(
|
||||
folderHasBeenCreated = fileListView.getFileElement().isDisplayed());
|
||||
|
||||
//delete the folder
|
||||
Actions.deleteElement(FOLDER_NAME, fileListView, driver);
|
||||
assertFalse(
|
||||
folderHasBeenCreated =fileListView.getFileElement().isDisplayed());
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
if(folderHasBeenCreated){
|
||||
FileListView fileListView = new FileListView(driver);
|
||||
Actions.deleteElement(FOLDER_NAME, fileListView, driver);
|
||||
}
|
||||
driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
}
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.ScreenOrientation;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.*;
|
||||
import com.owncloud.android.test.ui.models.LoginForm;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
import com.owncloud.android.test.ui.models.MenuList;
|
||||
import com.owncloud.android.test.ui.models.SettingsView;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class LoginTestSuite{
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class})
|
||||
public void test1LoginPortrait () throws Exception {
|
||||
driver.rotate(ScreenOrientation.PORTRAIT);
|
||||
|
||||
Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class})
|
||||
public void test2LoginLandscape () throws Exception {
|
||||
driver.rotate(ScreenOrientation.LANDSCAPE);
|
||||
Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testLoginAndShowFiles () throws Exception {
|
||||
driver.rotate(ScreenOrientation.PORTRAIT);
|
||||
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
fileListView.scrollTillFindElement(Config.fileWhichIsInTheServer1);
|
||||
assertTrue(fileListView.getFileElement().isDisplayed());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void test3MultiAccountRotate () throws Exception {
|
||||
driver.rotate(ScreenOrientation.LANDSCAPE);
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
driver.rotate(ScreenOrientation.PORTRAIT);
|
||||
MenuList menu = fileListView.clickOnMenuButton();
|
||||
SettingsView settingsView = menu.clickOnSettingsButton();
|
||||
|
||||
settingsView.tapOnAddAccount(1, 1000);
|
||||
fileListView = Actions.login(Config.URL2, Config.user2,
|
||||
Config.password2, Config.isTrusted2, driver);
|
||||
common.assertIsInSettingsView();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testMultiAccountAndShowFiles () throws Exception {
|
||||
driver.rotate(ScreenOrientation.LANDSCAPE);
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
fileListView.scrollTillFindElement(Config.fileWhichIsInTheServer1);
|
||||
assertTrue(fileListView.getFileElement().isDisplayed());
|
||||
|
||||
driver.rotate(ScreenOrientation.PORTRAIT);
|
||||
MenuList menu = fileListView.clickOnMenuButton();
|
||||
SettingsView settingsView = menu.clickOnSettingsButton();
|
||||
|
||||
settingsView.tapOnAddAccount(1, 1000);
|
||||
fileListView = Actions.login(Config.URL2, Config.user2,
|
||||
Config.password2, Config.isTrusted2, driver);
|
||||
common.assertIsInSettingsView();
|
||||
settingsView.tapOnAccountElement(2,1, 100);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
fileListView.scrollTillFindElement(Config.fileWhichIsInTheServer2);
|
||||
assertTrue(fileListView.getFileElement().isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class})
|
||||
public void test4ExistingAccountRotate () throws Exception {
|
||||
driver.rotate(ScreenOrientation.PORTRAIT);
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
driver.rotate(ScreenOrientation.LANDSCAPE);
|
||||
MenuList menu = fileListView.clickOnMenuButton();
|
||||
SettingsView settingsView = menu.clickOnSettingsButton();
|
||||
settingsView.tapOnAddAccount(1, 1000);
|
||||
|
||||
LoginForm loginForm = new LoginForm(driver);
|
||||
fileListView = Actions.login(Config.URL, Config.user,Config.password,
|
||||
Config.isTrusted, driver);
|
||||
assertTrue(common.waitForTextPresent("An account for the same user and"
|
||||
+ " server already exists in the device",
|
||||
loginForm.getAuthStatusText()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class})
|
||||
public void test5ChangePasswordWrong () throws Exception {
|
||||
driver.rotate(ScreenOrientation.PORTRAIT);
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
MenuList menu = fileListView.clickOnMenuButton();
|
||||
SettingsView settingsView = menu.clickOnSettingsButton();
|
||||
settingsView.tapOnAccountElement(1,1, 1000);
|
||||
LoginForm changePasswordForm = settingsView
|
||||
.clickOnChangePasswordElement();
|
||||
changePasswordForm.typePassword("WrongPassword");
|
||||
changePasswordForm.clickOnConnectButton();
|
||||
assertTrue(common.waitForTextPresent("Wrong username or password",
|
||||
changePasswordForm.getAuthStatusText()));
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.models.LoginForm;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
import com.owncloud.android.test.ui.models.MenuList;
|
||||
import com.owncloud.android.test.ui.models.SettingsView;
|
||||
|
||||
public class LogoutTestSuite{
|
||||
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testLogout () throws Exception {
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
MenuList menulist = fileListView.clickOnMenuButton();
|
||||
SettingsView settingsView = menulist.clickOnSettingsButton();
|
||||
settingsView.tapOnAccountElement(1,1, 1000);
|
||||
LoginForm loginForm = settingsView.clickOnDeleteAccountElement();
|
||||
assertEquals("Server address https://…",
|
||||
loginForm.gethostUrlInput().getText());
|
||||
assertEquals("Username", loginForm.getUserNameInput().getText());
|
||||
assertEquals("", loginForm.getPasswordInput().getText());
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
//driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
}
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.models.ElementMenuOptions;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
import com.owncloud.android.test.ui.models.MoveView;
|
||||
import com.owncloud.android.test.ui.models.WaitAMomentPopUp;
|
||||
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class MoveFileTestSuite{
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
private String FOLDER_WHERE_MOVE = "folderWhereMove";
|
||||
private String FILE_NAME = Config.fileToTestName;
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testMoveFile () throws Exception {
|
||||
WaitAMomentPopUp waitAMomentPopUp;
|
||||
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//Common.waitTillElementIsNotPresentWithoutTimeout(
|
||||
//fileListView.getProgressCircular(), 1000);
|
||||
|
||||
//check if the folder already exists and if true, delete them
|
||||
Actions.deleteElement(FOLDER_WHERE_MOVE, fileListView, driver);
|
||||
Actions.deleteElement(FILE_NAME, fileListView, driver);
|
||||
|
||||
//Create the folder where the other is gone to be moved
|
||||
waitAMomentPopUp = Actions
|
||||
.createFolder(FOLDER_WHERE_MOVE, fileListView);
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(
|
||||
waitAMomentPopUp.getWaitAMomentTextElement(), 100);
|
||||
fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE);
|
||||
assertTrue(fileListView.getFileElement().isDisplayed());
|
||||
|
||||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(FILE_NAME, fileListView);
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
|
||||
assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
|
||||
|
||||
//select to move the file
|
||||
ElementMenuOptions menuOptions = fileListView
|
||||
.longPressOnElement(FILE_NAME);
|
||||
MoveView moveView = menuOptions.clickOnMove();
|
||||
|
||||
//to move to a folder
|
||||
moveView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1);
|
||||
waitAMomentPopUp = moveView.clickOnChoose();
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(
|
||||
waitAMomentPopUp.getWaitAMomentTextElement(), 100);
|
||||
|
||||
//check that the folder moved is inside the other
|
||||
fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1);
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(),
|
||||
1000);
|
||||
Thread.sleep(1000);
|
||||
fileListView.scrollTillFindElement(FILE_NAME);
|
||||
assertEquals(FILE_NAME , fileListView.getFileElement().getText());
|
||||
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
FileListView fileListView = new FileListView(driver);
|
||||
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK);
|
||||
Actions.deleteElement(FOLDER_WHERE_MOVE, fileListView, driver);
|
||||
Actions.deleteElement(FILE_NAME, fileListView, driver);
|
||||
driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.models.ElementMenuOptions;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
import com.owncloud.android.test.ui.models.MoveView;
|
||||
import com.owncloud.android.test.ui.models.WaitAMomentPopUp;
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class MoveFolderTestSuite{
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
private String FOLDER_TO_MOVE = "folderToMove";
|
||||
private String FOLDER_WHERE_MOVE = "folderWhereMove";
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testMoveFolder () throws Exception {
|
||||
WaitAMomentPopUp waitAMomentPopUp;
|
||||
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//Common.waitTillElementIsNotPresentWithoutTimeout(
|
||||
//fileListView.getProgressCircular(), 1000);
|
||||
|
||||
//check if the folder already exists and if true, delete them
|
||||
Actions.deleteElement(FOLDER_WHERE_MOVE, fileListView, driver);
|
||||
Actions.deleteElement(FOLDER_TO_MOVE, fileListView, driver);
|
||||
|
||||
//Create the folder where the other is gone to be moved
|
||||
waitAMomentPopUp = Actions
|
||||
.createFolder(FOLDER_WHERE_MOVE, fileListView);
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(
|
||||
waitAMomentPopUp.getWaitAMomentTextElement(), 100);
|
||||
fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE);
|
||||
assertTrue(fileListView.getFileElement().isDisplayed());
|
||||
|
||||
//Create the folder which is going to be moved
|
||||
waitAMomentPopUp = Actions.createFolder(FOLDER_TO_MOVE, fileListView);
|
||||
Common.waitTillElementIsNotPresent(
|
||||
waitAMomentPopUp.getWaitAMomentTextElement(), 100);
|
||||
fileListView.scrollTillFindElement(FOLDER_TO_MOVE);
|
||||
assertTrue(fileListView.getFileElement().isDisplayed());
|
||||
|
||||
//select to move the folder
|
||||
ElementMenuOptions menuOptions = fileListView
|
||||
.longPressOnElement(FOLDER_TO_MOVE);
|
||||
MoveView moveView = menuOptions.clickOnMove();
|
||||
|
||||
//to move to a folder
|
||||
moveView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1);
|
||||
waitAMomentPopUp = moveView.clickOnChoose();
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp
|
||||
.getWaitAMomentTextElement(), 100);
|
||||
|
||||
//check that the folder moved is inside the other
|
||||
fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1);
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(),
|
||||
1000);
|
||||
Thread.sleep(1000);
|
||||
fileListView.scrollTillFindElement(FOLDER_TO_MOVE);
|
||||
assertEquals(FOLDER_TO_MOVE , fileListView.getFileElement().getText());
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
FileListView fileListView = new FileListView(driver);
|
||||
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK);
|
||||
Actions.deleteElement(FOLDER_WHERE_MOVE, fileListView, driver);
|
||||
Actions.deleteElement(FOLDER_TO_MOVE, fileListView, driver);
|
||||
driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.openqa.selenium.ScreenOrientation;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
import com.owncloud.android.test.ui.models.MenuList;
|
||||
import com.owncloud.android.test.ui.models.PassCodeRequestView;
|
||||
import com.owncloud.android.test.ui.models.PassCodeView;
|
||||
import com.owncloud.android.test.ui.models.SettingsView;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class PasscodeTestSuite {
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class})
|
||||
public void testPincodeEnable () throws Exception {
|
||||
driver.rotate(ScreenOrientation.PORTRAIT);
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
MenuList menu = fileListView.clickOnMenuButton();
|
||||
SettingsView settingsView = menu.clickOnSettingsButton();
|
||||
|
||||
PassCodeView passCodeview = settingsView.EnablePassCode();
|
||||
PassCodeView passCodeview2 = passCodeview.enterPasscode(
|
||||
Config.passcode1, Config.passcode2, Config.passcode3,
|
||||
Config.passcode4);
|
||||
passCodeview2.reenterPasscode(Config.passcode1, Config.passcode2,
|
||||
Config.passcode3, Config.passcode4);
|
||||
|
||||
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
|
||||
//TO DO. Open the app instead of start an activity
|
||||
driver.startActivity("com.owncloud.android",
|
||||
".ui.activity.FileDisplayActivity");
|
||||
//here we check that we are not in the fileDisplayActivity,
|
||||
//because pincode is asked
|
||||
common.assertIsNotInFileListView();
|
||||
common.assertIsPasscodeRequestView();
|
||||
|
||||
PassCodeRequestView passCodeReequestView = new
|
||||
PassCodeRequestView(driver);
|
||||
passCodeReequestView.enterPasscode(Config.passcode1, Config.passcode2,
|
||||
Config.passcode3, Config.passcode4);
|
||||
common.assertIsInFileListView();
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.UnfinishedTestCategory;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class RefreshFolderTestSuite{
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Category({UnfinishedTestCategory.class})
|
||||
public void testPulldownToRefreshFolder () throws Exception {
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
//TODO. Remove the sleep and check why is not working the assert
|
||||
//when using waitTillElementIsNotPresent
|
||||
Thread.sleep(5000);
|
||||
//waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), 1000);
|
||||
fileListView.pulldownToRefresh();
|
||||
assertTrue(fileListView.getProgressCircular().isDisplayed());
|
||||
//TODO insert a file in the web, and check that it's shown here
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.models.ElementMenuOptions;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
import com.owncloud.android.test.ui.models.NewFolderPopUp;
|
||||
import com.owncloud.android.test.ui.models.WaitAMomentPopUp;
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class RenameFileTestSuite{
|
||||
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
private Boolean fileHasBeenCreated = false;
|
||||
private final String OLD_FILE_NAME = Config.fileToTestName;
|
||||
private final String FILE_NAME = "newNameFile";
|
||||
private String CurrentCreatedFile = "";
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testRenameFile () throws Exception {
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//TODO. if the file already exists, do not upload
|
||||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(OLD_FILE_NAME, fileListView);
|
||||
|
||||
//check if the file with the new name already exists, if true delete it
|
||||
Actions.deleteElement(FILE_NAME, fileListView, driver);
|
||||
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(OLD_FILE_NAME);
|
||||
assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile
|
||||
.getFileElement().isDisplayed());
|
||||
CurrentCreatedFile = OLD_FILE_NAME;
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(fileListViewAfterUploadFile
|
||||
.getProgressCircular(), 1000);
|
||||
common.wait.until(ExpectedConditions.visibilityOf(
|
||||
fileListViewAfterUploadFile.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getLocalFileIndicator()))));
|
||||
ElementMenuOptions menuOptions = fileListViewAfterUploadFile
|
||||
.longPressOnElement(OLD_FILE_NAME);
|
||||
NewFolderPopUp newFolderPopUp = menuOptions.clickOnRename();
|
||||
newFolderPopUp.typeNewFolderName(FILE_NAME);
|
||||
WaitAMomentPopUp waitAMomentPopUp = newFolderPopUp
|
||||
.clickOnNewFolderOkButton();
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp
|
||||
.getWaitAMomentTextElement(), 100);
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
|
||||
assertNotNull(fileListViewAfterUploadFile.getFileElement());
|
||||
assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
|
||||
assertEquals(FILE_NAME , fileListViewAfterUploadFile.getFileElement()
|
||||
.getText());
|
||||
CurrentCreatedFile = FILE_NAME;
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
if (fileHasBeenCreated) {
|
||||
FileListView fileListView = new FileListView(driver);
|
||||
Actions.deleteElement(CurrentCreatedFile,fileListView, driver);
|
||||
}
|
||||
driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.models.ElementMenuOptions;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
import com.owncloud.android.test.ui.models.NewFolderPopUp;
|
||||
import com.owncloud.android.test.ui.models.WaitAMomentPopUp;
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class RenameFolderTestSuite{
|
||||
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
private Boolean folderHasBeenCreated = false;
|
||||
private final String OLD_FOLDER_NAME = "beforeRemoving";
|
||||
private final String FOLDER_NAME = "testCreateFolder";
|
||||
private String CurrentCreatedFolder = "";
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testRenameFolder () throws Exception {
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//TODO. if the folder already exists, do no created
|
||||
//create the folder to rename
|
||||
WaitAMomentPopUp waitAMomentPopUp = Actions
|
||||
.createFolder(OLD_FOLDER_NAME, fileListView);
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(
|
||||
waitAMomentPopUp.getWaitAMomentTextElement(), 100);
|
||||
fileListView.scrollTillFindElement(OLD_FOLDER_NAME);
|
||||
|
||||
assertTrue(
|
||||
folderHasBeenCreated = fileListView.getFileElement().isDisplayed());
|
||||
|
||||
//check if the folder with the new name already exists
|
||||
//and if true, delete them
|
||||
Actions.deleteElement(FOLDER_NAME, fileListView, driver);
|
||||
|
||||
CurrentCreatedFolder = OLD_FOLDER_NAME;
|
||||
ElementMenuOptions menuOptions = fileListView
|
||||
.longPressOnElement(OLD_FOLDER_NAME);
|
||||
NewFolderPopUp FolderPopUp = menuOptions.clickOnRename();
|
||||
FolderPopUp.typeNewFolderName(FOLDER_NAME);
|
||||
FolderPopUp.clickOnNewFolderOkButton();
|
||||
CurrentCreatedFolder = FOLDER_NAME;
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp
|
||||
.getWaitAMomentTextElement(), 100);
|
||||
fileListView.scrollTillFindElement(FOLDER_NAME);
|
||||
assertNotNull(fileListView.getFileElement());
|
||||
assertTrue(
|
||||
folderHasBeenCreated = fileListView.getFileElement().isDisplayed());
|
||||
assertEquals(FOLDER_NAME , fileListView.getFileElement().getText());
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
if(folderHasBeenCreated){
|
||||
FileListView fileListView = new FileListView(driver);
|
||||
Actions.deleteElement(CurrentCreatedFolder, fileListView, driver);
|
||||
}
|
||||
driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
|
||||
import org.junit.experimental.categories.Categories.ExcludeCategory;
|
||||
import org.junit.experimental.categories.Categories.IncludeCategory;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import com.owncloud.android.test.ui.groups.FailingTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassPrefix;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassSuffix;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestScanPackage;
|
||||
|
||||
|
||||
@RunWith(FlexibleCategories.class)
|
||||
@ExcludeCategory(NoIgnoreTestCategory.class)
|
||||
@IncludeCategory(FailingTestCategory.class)
|
||||
@TestScanPackage("com.owncloud.android.test.ui.testSuites")
|
||||
@TestClassPrefix("")
|
||||
@TestClassSuffix("TestSuite")
|
||||
public class RunFailingTests {
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import org.junit.experimental.categories.Categories.IncludeCategory;
|
||||
import org.junit.runner.RunWith;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories;
|
||||
import com.owncloud.android.test.ui.groups.InProgressCategory;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassPrefix;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassSuffix;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestScanPackage;
|
||||
|
||||
|
||||
@RunWith(FlexibleCategories.class)
|
||||
@IncludeCategory(InProgressCategory.class)
|
||||
@TestScanPackage("com.owncloud.android.test.ui.testSuites")
|
||||
@TestClassPrefix("")
|
||||
@TestClassSuffix("TestSuite")
|
||||
public class RunInProgressTest {
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import org.junit.experimental.categories.Categories.ExcludeCategory;
|
||||
import org.junit.experimental.categories.Categories.IncludeCategory;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories;
|
||||
import com.owncloud.android.test.ui.groups.IgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassPrefix;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassSuffix;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestScanPackage;
|
||||
|
||||
|
||||
@RunWith(FlexibleCategories.class)
|
||||
@ExcludeCategory(IgnoreTestCategory.class)
|
||||
@IncludeCategory(NoIgnoreTestCategory.class)
|
||||
@TestScanPackage("com.owncloud.android.test.ui.testSuites")
|
||||
@TestClassPrefix("")
|
||||
@TestClassSuffix("TestSuite")
|
||||
public class RunNoIgnoreTests {
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import org.junit.experimental.categories.Categories.ExcludeCategory;
|
||||
import org.junit.experimental.categories.Categories.IncludeCategory;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories;
|
||||
import com.owncloud.android.test.ui.groups.IgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassPrefix;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassSuffix;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestScanPackage;
|
||||
|
||||
|
||||
@RunWith(FlexibleCategories.class)
|
||||
@ExcludeCategory(IgnoreTestCategory.class)
|
||||
@IncludeCategory(SmokeTestCategory.class)
|
||||
@TestScanPackage("com.owncloud.android.test.ui.testSuites")
|
||||
@TestClassPrefix("")
|
||||
@TestClassSuffix("TestSuite")
|
||||
public class RunSmokeTests {
|
||||
}
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.android.AndroidElement;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.IgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.InProgressCategory;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.models.FileListView;;
|
||||
|
||||
public class ShareLinkFileTestSuite{
|
||||
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
private final String FILE_NAME = Config.fileToTestName;
|
||||
private Boolean fileHasBeenCreated = false;
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class})
|
||||
public void testShareLinkFileByGmail () throws Exception {
|
||||
AndroidElement sharedElementIndicator;
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//TODO. if the file already exists, do not upload
|
||||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(FILE_NAME, fileListView);
|
||||
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
|
||||
assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile
|
||||
.getFileElement().isDisplayed());
|
||||
|
||||
sharedElementIndicator = Actions.shareLinkElementByGmail(FILE_NAME,
|
||||
fileListViewAfterUploadFile,driver,common);
|
||||
assertTrue(sharedElementIndicator.isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testShareLinkFileByCopyLink () throws Exception {
|
||||
AndroidElement sharedElementIndicator;
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//TODO. if the file already exists, do not upload
|
||||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(FILE_NAME, fileListView);
|
||||
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
|
||||
assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile
|
||||
.getFileElement().isDisplayed());
|
||||
|
||||
sharedElementIndicator = Actions.shareLinkElementByCopyLink(FILE_NAME,
|
||||
fileListViewAfterUploadFile,driver,common);
|
||||
assertTrue(sharedElementIndicator.isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({IgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testUnshareLinkFile () throws Exception {
|
||||
AndroidElement sharedElementIndicator;
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//TODO. if the file already exists, do not upload
|
||||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(FILE_NAME, fileListView);
|
||||
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
|
||||
assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile
|
||||
.getFileElement().isDisplayed());
|
||||
|
||||
sharedElementIndicator = Actions.shareLinkElementByCopyLink(FILE_NAME,
|
||||
fileListViewAfterUploadFile,driver,common);
|
||||
assertTrue(sharedElementIndicator.isDisplayed());
|
||||
Actions.unshareLinkElement(FILE_NAME,
|
||||
fileListViewAfterUploadFile,driver,common);
|
||||
assertFalse(sharedElementIndicator.isDisplayed());
|
||||
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
if (fileHasBeenCreated) {
|
||||
FileListView fileListView = new FileListView(driver);
|
||||
Actions.deleteElement(FILE_NAME,fileListView, driver);
|
||||
}
|
||||
driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
}
|
||||
+285
@@ -0,0 +1,285 @@
|
||||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author purigarcia
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import io.appium.java_client.MobileBy;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.NoSuchElementException;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
|
||||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.FailingTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.InProgressCategory;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.UnfinishedTestCategory;
|
||||
import com.owncloud.android.test.ui.models.FileDetailsView;
|
||||
import com.owncloud.android.test.ui.models.ElementMenuOptions;
|
||||
import com.owncloud.android.test.ui.models.GmailEmailListView;
|
||||
import com.owncloud.android.test.ui.models.GmailEmailView;
|
||||
import com.owncloud.android.test.ui.models.ImageView;
|
||||
import com.owncloud.android.test.ui.models.FileListView;
|
||||
import com.owncloud.android.test.ui.models.NotificationView;
|
||||
import com.owncloud.android.test.ui.models.SettingsView;
|
||||
import com.owncloud.android.test.ui.models.UploadView;
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Category({NoIgnoreTestCategory.class})
|
||||
public class UploadTestSuite{
|
||||
|
||||
AndroidDriver driver;
|
||||
Common common;
|
||||
String FILE_NAME = Config.fileToTestName;
|
||||
String BIG_FILE_NAME = Config.bigFileToTestName;
|
||||
String FILE_GMAIL_NAME = Config.fileToTestSendByEmailName;
|
||||
private Boolean fileHasBeenUploadedFromGmail = false;
|
||||
private Boolean fileHasBeenUploaded = false;
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
common=new Common();
|
||||
driver=common.setUpCommonDriver();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testUploadFile () throws Exception {
|
||||
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//check if the file already exists and if true, delete it
|
||||
Actions.deleteElement(FILE_NAME, fileListView, driver);
|
||||
|
||||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(FILE_NAME, fileListView);
|
||||
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
|
||||
assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(
|
||||
fileListViewAfterUploadFile.getProgressCircular(), 1000);
|
||||
common.wait.until(ExpectedConditions.visibilityOf(
|
||||
fileListViewAfterUploadFile.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getLocalFileIndicator()))));
|
||||
assertTrue(fileListViewAfterUploadFile.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getLocalFileIndicator()))
|
||||
.isDisplayed());
|
||||
fileListView = new FileListView(driver);
|
||||
fileListView.scrollTillFindElement(FILE_NAME);
|
||||
assertTrue(
|
||||
fileHasBeenUploaded = fileListView.getFileElement().isDisplayed());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
@Category({UnfinishedTestCategory.class})
|
||||
public void testUploadBigFile () throws Exception {
|
||||
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
//check if the file already exists and if true, delete it
|
||||
Actions.deleteElement(BIG_FILE_NAME, fileListView, driver);
|
||||
|
||||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(BIG_FILE_NAME, fileListView);
|
||||
|
||||
|
||||
driver.openNotifications();
|
||||
NotificationView notificationView = new NotificationView(driver);
|
||||
|
||||
try{
|
||||
if(notificationView.getUploadingNotification().isDisplayed()){
|
||||
Common.waitTillElementIsPresent(
|
||||
notificationView.getUploadSucceededNotification(),300000);
|
||||
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
|
||||
driver.startActivity("com.owncloud.android",
|
||||
".ui.activity.FileDisplayActivity");
|
||||
|
||||
}
|
||||
} catch (NoSuchElementException e) {
|
||||
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
|
||||
driver.startActivity("com.owncloud.android",
|
||||
".ui.activity.FileDisplayActivity");
|
||||
}
|
||||
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(BIG_FILE_NAME);
|
||||
|
||||
assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
|
||||
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(
|
||||
fileListViewAfterUploadFile.getProgressCircular(), 1000);
|
||||
common.wait.until(ExpectedConditions.visibilityOf(
|
||||
fileListViewAfterUploadFile.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getLocalFileIndicator()))));
|
||||
assertTrue(fileListViewAfterUploadFile.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getLocalFileIndicator()))
|
||||
.isDisplayed());
|
||||
fileListView = new FileListView(driver);
|
||||
fileListView.scrollTillFindElement(BIG_FILE_NAME);
|
||||
assertTrue(
|
||||
fileHasBeenUploaded = fileListView.getFileElement().isDisplayed());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Category(UnfinishedTestCategory.class)
|
||||
public void testUploadFromGmail () throws Exception {
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
driver.startActivity("com.google.android.gm",
|
||||
".ConversationListActivityGmail");
|
||||
GmailEmailListView gmailEmailListView = new GmailEmailListView(driver);
|
||||
Thread.sleep(3000);
|
||||
GmailEmailView gmailEmailView = gmailEmailListView.clickOnEmail();
|
||||
ImageView imageView = gmailEmailView.clickOnfileButton();
|
||||
imageView.clickOnOptionsButton();
|
||||
imageView.clickOnShareButton();
|
||||
imageView.clickOnOwnCloudButton();
|
||||
//justonce button do not appear always
|
||||
try{
|
||||
imageView.clickOnJustOnceButton();
|
||||
}catch (NoSuchElementException e) {
|
||||
}
|
||||
UploadView uploadView = new UploadView(driver);
|
||||
uploadView.clickOUploadButton();
|
||||
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
|
||||
driver.startActivity("com.owncloud.android",
|
||||
".ui.activity.FileDisplayActivity");
|
||||
common.wait.until(ExpectedConditions
|
||||
.visibilityOfAllElementsLocatedBy(By.name(FILE_GMAIL_NAME)));
|
||||
assertEquals(Config.fileToTestSendByEmailName ,
|
||||
driver.findElementByName(FILE_GMAIL_NAME).getText());
|
||||
fileListView = new FileListView(driver);
|
||||
fileListView.scrollTillFindElement(FILE_GMAIL_NAME);
|
||||
assertTrue(fileHasBeenUploadedFromGmail = fileListView
|
||||
.getFileElement().isDisplayed());
|
||||
//TODO. correct assert if fileListView is shown in grid mode
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Category({FailingTestCategory.class})
|
||||
public void testKeepFileUpToDate () throws Exception {
|
||||
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(),
|
||||
1000);
|
||||
|
||||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(FILE_NAME, fileListView);
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
|
||||
assertTrue(fileHasBeenUploaded = fileListViewAfterUploadFile
|
||||
.getFileElement().isDisplayed());
|
||||
|
||||
ElementMenuOptions menuOptions = fileListViewAfterUploadFile
|
||||
.longPressOnElement(FILE_NAME);
|
||||
FileDetailsView fileDetailsView = menuOptions.clickOnDetails();
|
||||
fileDetailsView.checkKeepFileUpToDateCheckbox();
|
||||
Thread.sleep(3000);
|
||||
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK);
|
||||
assertTrue(common.isElementPresent(
|
||||
fileListViewAfterUploadFile.getFileElementLayout(),
|
||||
MobileBy.id(FileListView.getFavoriteFileIndicator())));
|
||||
assertTrue(fileListViewAfterUploadFile.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getFavoriteFileIndicator()))
|
||||
.isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class})
|
||||
public void testKeepFileUpToDateAndRefresh () throws Exception {
|
||||
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(),
|
||||
1000);
|
||||
|
||||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(FILE_NAME, fileListView);
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
|
||||
assertTrue(fileHasBeenUploaded = fileListViewAfterUploadFile
|
||||
.getFileElement().isDisplayed());
|
||||
|
||||
ElementMenuOptions menuOptions = fileListViewAfterUploadFile
|
||||
.longPressOnElement(FILE_NAME);
|
||||
FileDetailsView fileDetailsView = menuOptions.clickOnDetails();
|
||||
fileDetailsView.checkKeepFileUpToDateCheckbox();
|
||||
Thread.sleep(3000);
|
||||
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK);
|
||||
|
||||
fileListViewAfterUploadFile.pulldownToRefresh();
|
||||
//assertTrue(fileListView.getProgressCircular().isDisplayed());
|
||||
Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(),
|
||||
100);
|
||||
|
||||
assertTrue(common.isElementPresent(
|
||||
fileListViewAfterUploadFile.getFileElementLayout(),
|
||||
MobileBy.id(FileListView.getFavoriteFileIndicator())));
|
||||
assertTrue(fileListViewAfterUploadFile.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getFavoriteFileIndicator()))
|
||||
.isDisplayed());
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
common.takeScreenShotOnFailed(name.getMethodName());
|
||||
FileListView fileListView = new FileListView(driver);
|
||||
if (fileHasBeenUploadedFromGmail) {
|
||||
Actions.deleteElement(FILE_GMAIL_NAME,fileListView, driver);
|
||||
}
|
||||
if(fileHasBeenUploaded){
|
||||
Actions.deleteElement(FILE_NAME,fileListView, driver);
|
||||
Actions.deleteElement(BIG_FILE_NAME,fileListView, driver);
|
||||
}
|
||||
|
||||
//driver.removeApp("com.owncloud.android");
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
||||
+163
-201
@@ -1,109 +1,115 @@
|
||||
import com.github.spotbugs.snom.SpotBugsTask
|
||||
import org.gradle.internal.jvm.Jvm
|
||||
|
||||
// Gradle build file
|
||||
//
|
||||
// This project was started in Eclipse and later moved to Android Studio. In the transition, both IDEs were supported.
|
||||
// Due to this, the files layout is not the usual in new projects created with Android Studio / gradle. This file
|
||||
// merges declarations usually split in two separates build.gradle file, one for global settings of the project in
|
||||
// its root folder, another one for the app module in subfolder of root.
|
||||
import com.github.spotbugs.SpotBugsTask
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.6.10'
|
||||
ext.jacoco_version = '0.8.7'
|
||||
ext.kotlin_version = '1.3.61'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven {
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||
}
|
||||
maven {
|
||||
url 'https://plugins.gradle.org/m2/'
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||
classpath 'com.hiya:jacoco-android:0.2'
|
||||
classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.4'
|
||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
||||
classpath('com.dicedmelon.gradle:jacoco-android:0.1.4') {
|
||||
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
|
||||
}
|
||||
classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.6'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0"
|
||||
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.3.0"
|
||||
classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
|
||||
classpath 'com.karumi:shot:5.11.2'
|
||||
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
|
||||
classpath "org.jacoco:org.jacoco.report:$jacoco_version"
|
||||
classpath "org.jacoco:org.jacoco.agent:$jacoco_version"
|
||||
classpath 'com.karumi:shot:3.1.0'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'checkstyle'
|
||||
apply plugin: 'pmd'
|
||||
apply plugin: 'com.hiya.jacoco-android'
|
||||
apply plugin: 'jacoco-android'
|
||||
apply plugin: 'com.github.spotbugs'
|
||||
apply plugin: 'io.gitlab.arturbosch.detekt'
|
||||
apply plugin: 'shot'
|
||||
|
||||
println "Gradle uses Java ${Jvm.current()}"
|
||||
|
||||
configurations {
|
||||
ktlint
|
||||
|
||||
all {
|
||||
exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitly
|
||||
exclude group: 'com.google.firebase', module: 'firebase-core'
|
||||
exclude group: 'com.google.firebase', module: 'firebase-analytics'
|
||||
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
|
||||
exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitely
|
||||
|
||||
// check for updates every build
|
||||
resolutionStrategy {
|
||||
cacheChangingModulesFor 0, 'seconds'
|
||||
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
|
||||
}
|
||||
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
androidxTestVersion = "1.4.0"
|
||||
daggerVersion = "2.40.5"
|
||||
markwonVersion = "4.6.2"
|
||||
jacocoVersion = "0.8.2"
|
||||
daggerVersion = "2.25.4"
|
||||
markwonVersion = "4.2.0"
|
||||
prismVersion = "2.0.0"
|
||||
androidLibraryVersion = "master-SNAPSHOT"
|
||||
mockitoVersion = "4.2.0"
|
||||
mockkVersion = "1.12.2"
|
||||
powermockVersion = "2.0.9"
|
||||
byteBuddyVersion = "1.12.7"
|
||||
espressoVersion = "3.4.0"
|
||||
workRuntime = "2.7.1"
|
||||
fidoVersion = "4.1.0"
|
||||
|
||||
ciBuild = System.getenv("CI") == "true"
|
||||
travisBuild = System.getenv("TRAVIS") == "true"
|
||||
|
||||
// allows for -Dpre-dex=false to be set
|
||||
preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven { url "https://jitpack.io" }
|
||||
mavenCentral()
|
||||
maven {
|
||||
url 'https://plugins.gradle.org/m2/'
|
||||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
|
||||
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
// semantic versioning for version code
|
||||
def versionMajor = 3
|
||||
def versionMinor = 20
|
||||
def versionMinor = 11
|
||||
def versionPatch = 0
|
||||
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 == "build") {
|
||||
apply from: 'gplay.gradle'
|
||||
System.console().println("Applying gplay.gradle")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spotbugs {
|
||||
toolVersion = '3.1.12'
|
||||
}
|
||||
|
||||
shot {
|
||||
appId = 'com.nextcloud.client'
|
||||
instrumentationTestTask = 'connectedGenericDebugAndroidTest'
|
||||
}
|
||||
|
||||
android {
|
||||
lintOptions {
|
||||
checkGeneratedSources = true
|
||||
abortOnError false
|
||||
htmlReport true
|
||||
htmlOutput file("$project.buildDir/reports/lint/lint.html")
|
||||
@@ -113,15 +119,18 @@ android {
|
||||
'IconMissingDensityFolder',
|
||||
'IconDensities',
|
||||
'GoogleAppIndexingWarning',
|
||||
'MissingDefaultResource',
|
||||
'InvalidPeriodicWorkRequestInterval' // crashes due to a bug in lint itself
|
||||
'MissingDefaultResource'
|
||||
}
|
||||
|
||||
compileSdkVersion 31
|
||||
dexOptions {
|
||||
javaMaxHeapSize "4g"
|
||||
}
|
||||
|
||||
compileSdkVersion 29
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 29
|
||||
|
||||
// arguments to be passed to functional tests
|
||||
testInstrumentationRunner "com.nextcloud.client.ScreenshotTestRunner"
|
||||
@@ -149,7 +158,7 @@ android {
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
testCoverageEnabled (project.hasProperty('coverage'))
|
||||
testCoverageEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,17 +173,12 @@ android {
|
||||
applicationId 'com.nextcloud.client'
|
||||
dimension "default"
|
||||
}
|
||||
|
||||
huawei {
|
||||
applicationId 'com.nextcloud.client'
|
||||
dimension "default"
|
||||
}
|
||||
|
||||
versionDev {
|
||||
applicationId "com.nextcloud.android.beta"
|
||||
dimension "default"
|
||||
versionCode 20200129
|
||||
versionName "20200129"
|
||||
versionCode 20200115
|
||||
versionName "20200115"
|
||||
}
|
||||
|
||||
qa {
|
||||
@@ -187,13 +191,18 @@ android {
|
||||
|
||||
testOptions {
|
||||
unitTests.returnDefaultValues = true
|
||||
animationsDisabled true
|
||||
execution 'ANDROIDX_TEST_ORCHESTRATOR'
|
||||
}
|
||||
}
|
||||
|
||||
// adapt structure from Eclipse to Gradle/Android Studio expectations;
|
||||
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
|
||||
|
||||
dexOptions {
|
||||
// Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
|
||||
preDexLibraries = preDexEnabled && !travisBuild
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
exclude 'META-INF/LICENSE.txt'
|
||||
exclude 'META-INF/LICENSE'
|
||||
@@ -229,15 +238,40 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
check.dependsOn 'checkstyle', 'spotbugsGplayDebugReport', 'pmd', 'lint', 'ktlint', 'detekt'
|
||||
android.applicationVariants.all { variant ->
|
||||
String variantName = variant.name
|
||||
String capVariantName = variantName.substring(0, 1).toUpperCase() + variantName.substring(1)
|
||||
tasks.register("spotbugs${capVariantName}", SpotBugsTask) {
|
||||
ignoreFailures = true // should continue checking
|
||||
effort = "max"
|
||||
reportLevel = "medium"
|
||||
classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/classes/")
|
||||
excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
|
||||
pluginClasspath = project.configurations.spotbugsPlugins
|
||||
source = fileTree('src/main/java')
|
||||
classpath = files()
|
||||
include '**/*.java'
|
||||
exclude '**/gen/**'
|
||||
|
||||
buildFeatures {
|
||||
dataBinding true
|
||||
viewBinding true
|
||||
reports {
|
||||
xml.enabled = false
|
||||
html.enabled = true
|
||||
html {
|
||||
destination = file("$project.buildDir/reports/spotbugs/spotbugs.html")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
check.dependsOn 'checkstyle', 'spotbugsGplayDebug', 'pmd', 'lint', 'ktlint', 'detekt'
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
dataBinding {
|
||||
enabled true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,51 +279,51 @@ dependencies {
|
||||
// dependencies for app building
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
// implementation project('nextcloud-android-library')
|
||||
implementation ("com.github.nextcloud:android-library:$androidLibraryVersion") {
|
||||
exclude group: 'org.ogce', module: 'xpp3' // unused in Android and brings wrong Junit version
|
||||
}
|
||||
|
||||
genericImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
|
||||
gplayImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
|
||||
versionDevImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
|
||||
qaImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
|
||||
compileOnly 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' // remove after entire switch to lib v2
|
||||
implementation "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
|
||||
implementation 'org.apache.jackrabbit:jackrabbit-webdav:2.13.5' // remove after entire switch to lib v2
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
implementation 'org.apache.jackrabbit:jackrabbit-webdav:2.13.1' // remove after entire switch to lib v2
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.5.0'
|
||||
implementation 'com.google.android.material:material:1.1.0-beta02'
|
||||
implementation 'com.jakewharton:disklrucache:2.0.2'
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'androidx.webkit:webkit:1.4.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.exifinterface:exifinterface:1.3.3'
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0"
|
||||
implementation "androidx.work:work-runtime:$workRuntime"
|
||||
implementation "androidx.work:work-runtime-ktx:$workRuntime"
|
||||
implementation "androidx.fragment:fragment-ktx:1.4.0"
|
||||
implementation 'com.github.albfernandez:juniversalchardet:2.3.2' // need this version for Android <7
|
||||
compileOnly 'com.google.code.findbugs:annotations:3.0.1u2'
|
||||
implementation 'commons-io:commons-io:2.11.0'
|
||||
implementation 'org.greenrobot:eventbus:3.3.1'
|
||||
implementation 'com.googlecode.ez-vcard:ez-vcard:0.11.3'
|
||||
implementation 'androidx.exifinterface:exifinterface:1.1.0'
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0"
|
||||
implementation "androidx.work:work-runtime:2.2.0"
|
||||
implementation "androidx.work:work-runtime-ktx:2.2.0"
|
||||
implementation 'com.github.albfernandez:juniversalchardet:2.0.3' // need this version for Android <7
|
||||
compileOnly 'com.google.code.findbugs:annotations:2.0.1'
|
||||
implementation 'commons-io:commons-io:2.6'
|
||||
implementation 'com.github.tobiaskaminsky:android-job:v1.2.6.1' // 'com.github.evernote:android-job:v1.2.5'
|
||||
implementation 'com.jakewharton:butterknife:10.2.1'
|
||||
kapt 'com.jakewharton:butterknife-compiler:10.2.1'
|
||||
implementation 'org.greenrobot:eventbus:3.1.1'
|
||||
implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.5'
|
||||
implementation 'org.lukhnos:nnio:0.2'
|
||||
implementation 'org.bouncycastle:bcpkix-jdk15to18:1.70'
|
||||
implementation 'com.google.code.gson:gson:2.8.9'
|
||||
implementation 'com.madgag.spongycastle:pkix:1.54.0.0'
|
||||
implementation 'com.google.code.gson:gson:2.8.6'
|
||||
implementation 'com.afollestad:sectioned-recyclerview:0.5.0'
|
||||
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
||||
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24'
|
||||
implementation 'com.github.tobiaskaminsky:qrcodescanner:0.1.2.4' // 'com.github.blikoon:QRCodeScanner:0.1.2'
|
||||
implementation 'com.google.android:flexbox:2.0.1'
|
||||
implementation 'org.parceler:parceler-api:1.1.13'
|
||||
kapt 'org.parceler:parceler:1.1.13'
|
||||
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
|
||||
implementation 'com.github.tobiaskaminsky:qrcodescanner:0.1.2.2' // 'com.github.blikoon:QRCodeScanner:0.1.2'
|
||||
implementation 'com.google.android:flexbox:2.0.0'
|
||||
implementation 'org.parceler:parceler-api:1.1.12'
|
||||
kapt 'org.parceler:parceler:1.1.12'
|
||||
implementation('com.github.bumptech.glide:glide:3.8.0') {
|
||||
exclude group: "com.android.support"
|
||||
}
|
||||
implementation 'com.caverock:androidsvg:1.4'
|
||||
implementation 'androidx.annotation:annotation:1.3.0'
|
||||
implementation 'com.vanniktech:emoji-google:0.8.0'
|
||||
implementation 'androidx.annotation:annotation:1.1.0'
|
||||
implementation 'com.google.code.gson:gson:2.8.6'
|
||||
|
||||
implementation "com.github.cotechde.hwsecurity:hwsecurity-fido:$fidoVersion"
|
||||
implementation "com.github.cotechde.hwsecurity:hwsecurity-fido2:$fidoVersion"
|
||||
implementation 'com.github.cotechde.hwsecurity:hwsecurity-fido:2.5.1'
|
||||
|
||||
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0'
|
||||
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.10.1'
|
||||
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.7'
|
||||
|
||||
implementation "com.google.dagger:dagger:$daggerVersion"
|
||||
@@ -298,13 +332,11 @@ dependencies {
|
||||
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
|
||||
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
|
||||
|
||||
ktlint "com.pinterest:ktlint:0.43.2"
|
||||
implementation 'org.conscrypt:conscrypt-android:2.5.2'
|
||||
compileOnly "org.projectlombok:lombok:1.18.10"
|
||||
annotationProcessor "org.projectlombok:lombok:1.18.10"
|
||||
|
||||
implementation 'com.google.android.exoplayer:exoplayer:2.16.1'
|
||||
|
||||
// Shimmer animation
|
||||
implementation 'com.elyeproj.libraries:loaderviewlibrary:2.0.0'
|
||||
ktlint "com.pinterest:ktlint:0.36.0"
|
||||
implementation 'org.conscrypt:conscrypt-android:2.2.1'
|
||||
|
||||
// dependencies for markdown rendering
|
||||
implementation "io.noties.markwon:core:$markwonVersion"
|
||||
@@ -317,78 +349,50 @@ dependencies {
|
||||
implementation "io.noties:prism4j:$prismVersion"
|
||||
kapt "io.noties:prism4j-bundler:$prismVersion"
|
||||
|
||||
implementation ('org.mnode.ical4j:ical4j:1.0.8') {
|
||||
['org.apache.commons','commons-logging'].each {
|
||||
exclude group: "$it"
|
||||
}
|
||||
}
|
||||
|
||||
if (!ciBuild) {
|
||||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
|
||||
}
|
||||
|
||||
// dependencies for local unit tests
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
testImplementation "org.mockito:mockito-core:$mockitoVersion"
|
||||
testImplementation "androidx.test:core:$androidxTestVersion"
|
||||
testImplementation "org.powermock:powermock-core:$powermockVersion"
|
||||
testImplementation "org.powermock:powermock-module-junit4:$powermockVersion"
|
||||
testImplementation "org.powermock:powermock-api-mockito2:$powermockVersion"
|
||||
testImplementation 'org.json:json:20211205'
|
||||
testImplementation 'junit:junit:4.13'
|
||||
testImplementation 'org.mockito:mockito-core:3.2.4'
|
||||
testImplementation 'androidx.test:core:1.2.0'
|
||||
testImplementation 'org.powermock:powermock-core:2.0.4'
|
||||
testImplementation 'org.powermock:powermock-module-junit4:2.0.4'
|
||||
testImplementation 'org.powermock:powermock-api-mockito2:2.0.4'
|
||||
testImplementation 'org.json:json:20190722'
|
||||
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
|
||||
testImplementation 'androidx.arch.core:core-testing:2.1.0'
|
||||
testImplementation "io.mockk:mockk:$mockkVersion"
|
||||
testImplementation "io.mockk:mockk-android:$mockkVersion"
|
||||
testImplementation "androidx.arch.core:core-testing:2.1.0"
|
||||
|
||||
// dependencies for instrumented tests
|
||||
// JUnit4 Rules
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation "androidx.test:rules:$androidxTestVersion"
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test:rules:1.2.0'
|
||||
// Android JUnit Runner
|
||||
androidTestImplementation "androidx.test:runner:$androidxTestVersion"
|
||||
androidTestUtil "androidx.test:orchestrator:$androidxTestVersion"
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestUtil 'androidx.test:orchestrator:1.2.0'
|
||||
|
||||
// Espresso core
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-web:$espressoVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-accessibility:$espressoVersion"
|
||||
|
||||
// Mocking support
|
||||
androidTestImplementation 'com.github.tmurakami:dexopener:2.0.5' // required to allow mocking on API 27 and older
|
||||
androidTestImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
|
||||
androidTestImplementation "org.mockito:mockito-core:$mockitoVersion"
|
||||
androidTestImplementation("org.mockito:mockito-android:$mockitoVersion") {
|
||||
exclude group: "net.bytebuddy", module: "byte-buddy-android"
|
||||
}
|
||||
androidTestImplementation "net.bytebuddy:byte-buddy:$byteBuddyVersion"
|
||||
androidTestImplementation "net.bytebuddy:byte-buddy-android:$byteBuddyVersion"
|
||||
androidTestImplementation "io.mockk:mockk-android:$mockkVersion"
|
||||
androidTestImplementation 'androidx.arch.core:core-testing:2.0.1'
|
||||
androidTestImplementation "com.facebook.testing.screenshot:core:0.13.0"
|
||||
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
|
||||
androidTestImplementation 'org.mockito:mockito-core:3.2.4'
|
||||
// UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
|
||||
// androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
||||
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
|
||||
//androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}"
|
||||
androidTestImplementation 'tools.fastlane:screengrab:2.1.1'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
androidTestImplementation('com.android.support.test.espresso:espresso-intents:3.0.2')
|
||||
androidTestImplementation 'tools.fastlane:screengrab:2.0.0'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
androidTestCompile('com.android.support.test.espresso:espresso-intents:3.0.2')
|
||||
|
||||
// jacocoAnt "org.jacoco:org.jacoco.ant:${jacocoVersion}"
|
||||
// jacocoAgent "org.jacoco:org.jacoco.agent:${jacocoVersion}"
|
||||
// androidJacocoAgent "org.jacoco:org.jacoco.agent:${jacocoVersion}"
|
||||
// androidJacocoAnt "org.jacoco:org.jacoco.ant:${jacocoVersion}"
|
||||
// androidJacocoAnt "org.jacoco:org.jacoco.core:${jacocoVersion}"
|
||||
// androidJacocoAnt "org.jacoco:org.jacoco.report:${jacocoVersion}"
|
||||
// androidJacocoAnt "org.jacoco:org.jacoco.agent:${jacocoVersion}"
|
||||
|
||||
implementation "com.github.stateless4j:stateless4j:2.6.0"
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy{
|
||||
cacheChangingModulesFor 0, 'seconds'
|
||||
force 'org.objenesis:objenesis:2.6'
|
||||
eachDependency { details ->
|
||||
if ('org.jacoco' == details.requested.group) {
|
||||
details.useVersion "$jacoco_version"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
||||
}
|
||||
|
||||
tasks.withType(Test) {
|
||||
@@ -406,18 +410,18 @@ android.applicationVariants.all { variant ->
|
||||
|
||||
tasks.register("combinedTestReport", JacocoReport) {
|
||||
|
||||
jacocoClasspath = configurations['jacocoAnt']
|
||||
|
||||
reports {
|
||||
xml.enabled true
|
||||
html.enabled true
|
||||
csv.enabled false
|
||||
xml.enabled = true
|
||||
html.enabled = true
|
||||
}
|
||||
|
||||
additionalSourceDirs.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
|
||||
sourceDirectories.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
|
||||
classDirectories.setFrom files(subprojects.sourceSets.main.output)
|
||||
executionData.setFrom project.fileTree(dir: project.buildDir, includes: [
|
||||
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
|
||||
def debugTree = fileTree(dir: "$project.buildDir/intermediates/classes/gplay/debug", excludes: fileFilter)
|
||||
def mainSrc = "$project.projectDir/src/main/java"
|
||||
|
||||
sourceDirectories = files([mainSrc])
|
||||
classDirectories = files([debugTree])
|
||||
executionData = fileTree(dir: project.buildDir, includes: [
|
||||
'jacoco/testGplayDebugUnitTest.exec', 'outputs/code-coverage/connected/flavors/GPLAY/*coverage.ec'
|
||||
])
|
||||
}
|
||||
@@ -436,14 +440,6 @@ task ktlintFormat(type: JavaExec, group: "formatting") {
|
||||
args "-F", "src/**/*.kt"
|
||||
}
|
||||
|
||||
task installGitHooks(type: Copy, group: "development") {
|
||||
description = "Install git hooks"
|
||||
from("${project.rootDir}/scripts/hooks") {
|
||||
include '*'
|
||||
}
|
||||
into '.git/hooks'
|
||||
}
|
||||
|
||||
detekt {
|
||||
reports {
|
||||
xml {
|
||||
@@ -453,37 +449,3 @@ detekt {
|
||||
config = files("detekt.yml")
|
||||
input = files("src/")
|
||||
}
|
||||
|
||||
shot {
|
||||
showOnlyFailingTestsInReports = ciBuild
|
||||
// CI environment renders some shadows slightly different from local VMs
|
||||
// Add a 0.5% tolerance to account for that
|
||||
tolerance = ciBuild ? 0.5: 0
|
||||
}
|
||||
|
||||
jacoco {
|
||||
toolVersion = "$jacoco_version"
|
||||
}
|
||||
|
||||
spotbugs {
|
||||
ignoreFailures = true // should continue checking
|
||||
effort = "max"
|
||||
reportLevel = "medium"
|
||||
}
|
||||
|
||||
tasks.withType(SpotBugsTask){task ->
|
||||
String variantNameCap = task.name.replace("spotbugs", "")
|
||||
String variantName = variantNameCap.substring(0, 1).toLowerCase() + variantNameCap.substring(1)
|
||||
|
||||
dependsOn "compile${variantNameCap}Sources"
|
||||
|
||||
excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
|
||||
classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/classes/")
|
||||
reports {
|
||||
xml.enabled = false
|
||||
html {
|
||||
enabled = true
|
||||
destination = file("$project.buildDir/reports/spotbugs/spotbugs.html")
|
||||
}
|
||||
}
|
||||
}
|
||||
+65
-13
@@ -1,3 +1,30 @@
|
||||
autoCorrect: true
|
||||
|
||||
test-pattern: # Configure exclusions for test sources
|
||||
active: true
|
||||
patterns: # Test file regexes
|
||||
- '.*/test/.*'
|
||||
- '.*/androidTest/.*'
|
||||
- '.*Test.kt'
|
||||
- '.*Spec.kt'
|
||||
- '.*Spek.kt'
|
||||
exclude-rule-sets:
|
||||
- 'comments'
|
||||
exclude-rules:
|
||||
- 'NamingRules'
|
||||
- 'WildcardImport'
|
||||
- 'MagicNumber'
|
||||
- 'MaxLineLength'
|
||||
- 'LateinitUsage'
|
||||
- 'StringLiteralDuplication'
|
||||
- 'SpreadOperator'
|
||||
- 'TooManyFunctions'
|
||||
- 'ForEachOnRange'
|
||||
- 'FunctionMaxLength'
|
||||
- 'TooGenericExceptionCaught'
|
||||
- 'TooGenericExceptionThrown'
|
||||
- 'InstanceOfCheckForException'
|
||||
|
||||
build:
|
||||
maxIssues: 10
|
||||
weights:
|
||||
@@ -56,7 +83,6 @@ complexity:
|
||||
threshold: 10
|
||||
ignoreSingleWhenExpression: false
|
||||
ignoreSimpleWhenEntries: false
|
||||
excludes: ['**/androidTest/**']
|
||||
LabeledExpression:
|
||||
active: false
|
||||
ignoredLabels: ""
|
||||
@@ -66,7 +92,6 @@ complexity:
|
||||
LongMethod:
|
||||
active: true
|
||||
threshold: 60
|
||||
excludes: ['**/androidTest/**']
|
||||
LongParameterList:
|
||||
active: true
|
||||
threshold: 6
|
||||
@@ -85,14 +110,14 @@ complexity:
|
||||
ignoreStringsRegex: '$^'
|
||||
TooManyFunctions:
|
||||
active: true
|
||||
thresholdInFiles: 15
|
||||
thresholdInClasses: 15
|
||||
thresholdInInterfaces: 15
|
||||
thresholdInObjects: 15
|
||||
thresholdInFiles: 11
|
||||
thresholdInClasses: 11
|
||||
thresholdInInterfaces: 11
|
||||
thresholdInObjects: 11
|
||||
thresholdInEnums: 11
|
||||
ignoreDeprecated: true
|
||||
ignoreDeprecated: false
|
||||
ignorePrivate: false
|
||||
ignoreOverridden: true
|
||||
ignoreOverridden: false
|
||||
|
||||
empty-blocks:
|
||||
active: true
|
||||
@@ -113,7 +138,7 @@ empty-blocks:
|
||||
active: true
|
||||
EmptyFunctionBlock:
|
||||
active: true
|
||||
ignoreOverridden: false
|
||||
ignoreOverriddenFunctions: false
|
||||
EmptyIfBlock:
|
||||
active: true
|
||||
EmptyInitBlock:
|
||||
@@ -177,18 +202,23 @@ exceptions:
|
||||
formatting:
|
||||
active: true
|
||||
android: false
|
||||
autoCorrect: true
|
||||
ChainWrapping:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
CommentSpacing:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
Filename:
|
||||
active: true
|
||||
FinalNewline:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
ImportOrdering:
|
||||
active: false
|
||||
Indentation:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
indentSize: 4
|
||||
continuationIndentSize: 4
|
||||
MaximumLineLength:
|
||||
@@ -196,49 +226,73 @@ formatting:
|
||||
maxLineLength: 120
|
||||
ModifierOrdering:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
NoBlankLineBeforeRbrace:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
NoConsecutiveBlankLines:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
NoEmptyClassBody:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
NoItParamInMultilineLambda:
|
||||
active: false
|
||||
NoLineBreakAfterElse:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
NoLineBreakBeforeAssignment:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
NoMultipleSpaces:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
NoSemicolons:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
NoTrailingSpaces:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
NoUnitReturn:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
NoUnusedImports:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
NoWildcardImports:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
PackageName:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
ParameterListWrapping:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
indentSize: 4
|
||||
SpacingAroundColon:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
SpacingAroundComma:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
SpacingAroundCurly:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
SpacingAroundKeyword:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
SpacingAroundOperators:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
SpacingAroundParens:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
SpacingAroundRangeOperator:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
StringTemplate:
|
||||
active: true
|
||||
autoCorrect: true
|
||||
|
||||
naming:
|
||||
active: true
|
||||
@@ -267,17 +321,16 @@ naming:
|
||||
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
|
||||
excludeClassPattern: '$^'
|
||||
ignoreOverridden: true
|
||||
excludes: "**/*Test.kt"
|
||||
FunctionParameterNaming:
|
||||
active: true
|
||||
parameterPattern: '[a-z][A-Za-z0-9]*'
|
||||
excludeClassPattern: '$^'
|
||||
ignoreOverridden: true
|
||||
ignoreOverriddenFunctions: true
|
||||
MatchingDeclarationName:
|
||||
active: true
|
||||
MemberNameEqualsClassName:
|
||||
active: false
|
||||
ignoreOverridden: true
|
||||
ignoreOverriddenFunction: true
|
||||
ObjectPropertyNaming:
|
||||
active: true
|
||||
constantPattern: '[A-Za-z][_A-Za-z0-9]*'
|
||||
@@ -389,7 +442,6 @@ style:
|
||||
ignoreAnnotation: false
|
||||
ignoreNamedArgument: true
|
||||
ignoreEnums: false
|
||||
excludes: "**/*Test.kt"
|
||||
MandatoryBracesIfStatements:
|
||||
active: false
|
||||
MaxLineLength:
|
||||
|
||||
@@ -1,11 +1 @@
|
||||
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m2.5 1c-0.28 0-0.5 0.22-0.5 0.5v13c0 0.28 0.22 0.5 0.5 0.5h11c0.28 0 0.5-0.22 0.5-0.5v-10.5l-3-3z"
|
||||
fill="#dc5047" />
|
||||
<g fill="#fff" aria-label="PDF">
|
||||
<path
|
||||
d="m4.9093 8.443v1.057h-0.61813v-3h1.1703q0.33791 0 0.59341 0.12363 0.25755 0.12363 0.3956 0.35234 0.13805 0.22665 0.13805 0.51717 0 0.44093-0.30288 0.69643-0.30082 0.25343-0.83448 0.25343zm0-0.50069h0.5522q0.24519 0 0.37294-0.11538 0.12981-0.11538 0.12981-0.32967 0-0.22047-0.12981-0.35646t-0.35852-0.14011h-0.56662z" />
|
||||
<path
|
||||
d="m7.011 9.5v-3h0.92308q0.3956 0 0.70673 0.17926 0.31319 0.1772 0.48832 0.50687 0.17514 0.32761 0.17514 0.74588v0.13805q0 0.41827-0.17308 0.74382-0.17102 0.32555-0.4842 0.50481-0.31319 0.17926-0.70673 0.18132zm0.61813-2.4993v2.0027h0.29876q0.36264 0 0.55426-0.23695 0.19162-0.23695 0.19574-0.67788v-0.15865q0-0.45742-0.18956-0.69231-0.18956-0.23695-0.55426-0.23695z" />
|
||||
<path d="m11.56 8.274h-1.1868v1.226h-0.61813v-3h1.9533v0.50069h-1.3352v0.77473h1.1868z" />
|
||||
</g>
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="16" viewBox="0 0 16 16" width="16" version="1.1"><path fill="#dc5047" d="m2.5 1c-0.28 0-0.5 0.22-0.5 0.5v13c0 0.28 0.22 0.5 0.5 0.5h11c0.28 0 0.5-0.22 0.5-0.5v-10.5l-3-3zm5.8 3.9s0.07 0.95-0.15 2.3c0.715 2.053 1.5 2.33 1.85 2.5 0.74-0.06 1.565-0.1 2.3 0.3 0.5 0.286 0.894 1.5-0.3 1.5-0.54-0.034-1.537-0.346-2.25-0.7-1.066 0.12-2.39 0.32-3.5 0.8-1.25 2.1-1.81 2.4-2.25 2.4-1.215-0.32-0.56-1.93-0.1-2.2 0.55-0.47 1.195-0.74 1.4-0.8 0.09-0.15 1.384-2.69 1.7-3.75-0.3-1.024-0.37-2.106-0.2-2.75 0.78-1.018 1.5-0.35 1.5 0.4zm-0.7 3.1c-0.27 1.057-1.348 3.084-1.3 3 1.105-0.485 2.1-0.63 3.2-0.8-0.526-0.235-1.146-0.25-1.9-2.2z"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 676 B |
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" viewBox="0 0 57 57" width="64" height="64"
|
||||
version="1.1" id="svg10" sodipodi:docname="circles.svg" inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
||||
<metadata id="metadata16">
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs id="defs14" />
|
||||
<sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10"
|
||||
gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920" inkscape:window-height="1141" id="namedview12" showgrid="false"
|
||||
inkscape:zoom="7.375" inkscape:cx="33.445579" inkscape:cy="41.701636" inkscape:window-x="0"
|
||||
inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="svg10" />
|
||||
<path d="M7.1 28.5A21.4 21.4 0 0 1 28.5 7.1m10.7 40A21.4 21.4 0 0 1 10 39M39.2 10A21.4 21.4 0 0 1 47 39.2"
|
||||
fill="none" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" id="path2"
|
||||
style="stroke:#000000;stroke-opacity:1;stroke-width:3.99979687;stroke-miterlimit:4;stroke-dasharray:none;fill:none;fill-opacity:1" />
|
||||
<circle cx="28.5" cy="7.1" r="6.5" fill="#fff" id="circle4" style="fill:#000000" />
|
||||
<circle cx="39.2" cy="-10" r="6.5" transform="rotate(90)" fill="#fff" id="circle6" style="fill:#000000" />
|
||||
<circle cx="39.2" cy="-47" r="6.5" transform="rotate(90)" fill="#fff" id="circle8" style="fill:#000000" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.0 KiB |
Loaded 100 of 1623 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user