Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #107 from vase4kin/dev
Browse files Browse the repository at this point in the history
Release 1.2.7
  • Loading branch information
vase4kin authored Mar 27, 2018
2 parents c77c44b + 2ba7365 commit 847a076
Show file tree
Hide file tree
Showing 24 changed files with 327 additions and 154 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Circle CI](https://circleci.com/gh/vase4kin/TeamCityApp/tree/master.svg?style=shield)](https://circleci.com/gh/vase4kin/TeamCityApp/tree/master)
[![codecov](https://codecov.io/gh/vase4kin/TeamCityApp/branch/master/graph/badge.svg)](https://codecov.io/gh/vase4kin/TeamCityApp)
[![Release](https://img.shields.io/badge/release-1.2.6-blue.svg)](https://github.com/vase4kin/TeamCityApp/releases/latest)
[![Release](https://img.shields.io/badge/release-1.2.7-blue.svg)](https://github.com/vase4kin/TeamCityApp/releases/latest)

```
Expand Down
134 changes: 67 additions & 67 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.neenbedankt.android-apt'
apply from: 'jacoco.gradle'
apply from: 'spoon.gradle'
apply from: 'pmd.gradle'
Expand Down Expand Up @@ -62,6 +61,8 @@ android {
}
}

flavorDimensions "default"

productFlavors {
mock {
applicationIdSuffix = ".mock"
Expand Down Expand Up @@ -102,7 +103,6 @@ android {

lintOptions {
disable 'InvalidPackage'
disable 'IconLauncherFormat'
xmlReport false
abortOnError true
htmlOutput file("build/reports/lint-report/lint-report.html")
Expand All @@ -121,7 +121,6 @@ buildscript {

dependencies {
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.1.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.6'
classpath 'io.fabric.tools:gradle:1.+'
}
}
Expand All @@ -139,94 +138,95 @@ repositories{
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Android support libraries
compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
compile "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
compile "com.android.support:support-v13:$rootProject.supportLibraryVersion"
compile "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
compile "com.android.support:design:$rootProject.supportLibraryVersion"
compile "com.android.support:customtabs:$rootProject.supportLibraryVersion"
implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:support-v13:$rootProject.supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:design:$rootProject.supportLibraryVersion"
implementation "com.android.support:customtabs:$rootProject.supportLibraryVersion"
// Api third party libraries
compile 'com.squareup.okhttp3:okhttp:3.8.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
implementation 'com.squareup.okhttp3:okhttp:3.8.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
implementation 'com.google.code.gson:gson:2.7'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
// Drawer
compile('com.mikepenz:materialdrawer:5.9.5@aar') {
implementation('com.mikepenz:materialdrawer:5.9.5@aar') {
transitive = true
}
// Icons
compile 'com.joanzapata.iconify:android-iconify-material:2.2.2'
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
compile 'com.joanzapata.iconify:android-iconify-material-community:2.2.2'
implementation 'com.joanzapata.iconify:android-iconify-material:2.2.2'
implementation 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
implementation 'com.joanzapata.iconify:android-iconify-material-community:2.2.2'
// Dialogs
compile 'com.afollestad.material-dialogs:core:0.9.4.5'
implementation 'com.afollestad.material-dialogs:core:0.9.4.5'
// Views
compile 'tr.xip.errorview:library:3.0.0'
compile 'com.pnikosis:materialish-progress:1.7'
implementation 'tr.xip.errorview:library:3.0.0'
implementation 'com.pnikosis:materialish-progress:1.7'
// View injection
compile 'com.jakewharton:butterknife:8.8.0'
apt 'com.jakewharton:butterknife-compiler:8.8.0'
implementation 'com.jakewharton:butterknife:8.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.0'
// Event bus
compile 'org.greenrobot:eventbus:3.0.0'
implementation 'org.greenrobot:eventbus:3.0.0'
// Others
compile 'joda-time:joda-time:2.8.1'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
compile 'com.vinaysshenoy:mugen:1.0.2'
compile('com.mikepenz:aboutlibraries:5.9.7@aar') {
implementation 'joda-time:joda-time:2.8.1'
implementation 'com.bignerdranch.android:recyclerview-multiselect:0.2'
implementation 'com.vinaysshenoy:mugen:1.0.2'
implementation('com.mikepenz:aboutlibraries:5.9.7@aar') {
transitive = true
}
compile 'com.github.daniel-stoneuk:material-about-library:2.2.1'
implementation 'io.supercharge:shimmerlayout:2.1.0'
implementation 'com.github.daniel-stoneuk:material-about-library:2.2.1'
// Onboarding
compile 'uk.co.samuelwall:material-tap-target-prompt:2.0.0'
implementation 'uk.co.samuelwall:material-tap-target-prompt:2.0.0'
// Dagger
apt 'com.google.dagger:dagger-compiler:2.11'
compile 'com.google.dagger:dagger:2.11'
provided 'javax.annotation:jsr250-api:1.0'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
implementation 'com.google.dagger:dagger:2.11'
// Rx
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.3.0'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex:rxjava:1.3.0'
// Rx cache
compile "com.github.VictorAlbertos.RxCache:runtime:1.7.0-1.x"
compile 'com.github.VictorAlbertos.Jolyglot:gson:0.0.3'
implementation "com.github.VictorAlbertos.RxCache:runtime:1.7.0-1.x"
implementation 'com.github.VictorAlbertos.Jolyglot:gson:0.0.3'
// Encryption
compile 'com.facebook.conceal:conceal:1.1.3@aar'
implementation 'com.facebook.conceal:conceal:1.1.3@aar'
// Rate app library
compile 'com.github.hotchemi:android-rate:1.0.1'
implementation 'com.github.hotchemi:android-rate:1.0.1'
// Firebase
compile 'com.google.firebase:firebase-core:11.0.4'
implementation 'com.google.firebase:firebase-core:11.0.4'
// Unit tests
testCompile "org.mockito:mockito-core:$rootProject.mockitoCoreVersion"
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-junit:2.0.0.0'
testCompile "org.powermock:powermock-module-junit4:$rootProject.powerMockVersion"
testCompile "org.powermock:powermock-module-junit4-rule:$rootProject.powerMockVersion"
testCompile "org.powermock:powermock-api-mockito:$rootProject.powerMockVersion"
testCompile "org.powermock:powermock-classloading-xstream:$rootProject.powerMockVersion"
testImplementation "org.mockito:mockito-core:$rootProject.mockitoCoreVersion"
testImplementation 'junit:junit:4.12'
testImplementation 'org.hamcrest:hamcrest-junit:2.0.0.0'
testImplementation "org.powermock:powermock-module-junit4:$rootProject.powerMockVersion"
testImplementation "org.powermock:powermock-module-junit4-rule:$rootProject.powerMockVersion"
testImplementation "org.powermock:powermock-api-mockito:$rootProject.powerMockVersion"
testImplementation "org.powermock:powermock-classloading-xstream:$rootProject.powerMockVersion"
// Ui tests
androidTestCompile "com.android.support.test:runner:$rootProject.espressoRunnerVersion"
androidTestCompile "com.android.support.test:rules:$rootProject.espressoRunnerVersion"
androidTestCompile "com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion"
androidTestCompile "com.android.support.test.espresso:espresso-intents:$rootProject.espressoVersion"
androidTestCompile "com.android.support.test.espresso:espresso-contrib:$rootProject.espressoVersion"
androidTestCompile "com.android.support.test.espresso:espresso-web:$rootProject.espressoVersion"
androidTestCompile "org.mockito:mockito-core:$rootProject.mockitoCoreVersion"
androidTestCompile "com.crittercism.dexmaker:dexmaker:$rootProject.dexMakerVersion"
androidTestCompile "com.crittercism.dexmaker:dexmaker-dx:$rootProject.dexMakerVersion"
androidTestCompile "com.crittercism.dexmaker:dexmaker-mockito:$rootProject.dexMakerVersion"
androidTestCompile 'com.squareup.spoon:spoon-client:1.7.1'
androidTestCompile 'com.jraska:falcon-spoon-compat:1.0.4'
androidTestCompile 'com.github.fabioCollini:DaggerMock:0.7.0'
androidTestImplementation "com.android.support.test:runner:$rootProject.espressoRunnerVersion"
androidTestImplementation "com.android.support.test:rules:$rootProject.espressoRunnerVersion"
androidTestImplementation "com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion"
androidTestImplementation "com.android.support.test.espresso:espresso-intents:$rootProject.espressoVersion"
androidTestImplementation "com.android.support.test.espresso:espresso-contrib:$rootProject.espressoVersion"
androidTestImplementation "com.android.support.test.espresso:espresso-web:$rootProject.espressoVersion"
androidTestImplementation "org.mockito:mockito-core:$rootProject.mockitoCoreVersion"
androidTestImplementation "com.crittercism.dexmaker:dexmaker:$rootProject.dexMakerVersion"
androidTestImplementation "com.crittercism.dexmaker:dexmaker-dx:$rootProject.dexMakerVersion"
androidTestImplementation "com.crittercism.dexmaker:dexmaker-mockito:$rootProject.dexMakerVersion"
androidTestImplementation 'com.squareup.spoon:spoon-client:1.7.1'
androidTestImplementation 'com.jraska:falcon-spoon-compat:1.0.4'
androidTestImplementation 'com.github.fabioCollini:DaggerMock:0.7.0'
androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'
// Resolve conflits between apks
androidTestCompile "com.android.support:support-annotations:$rootProject.supportLibraryVersion"
androidTestCompile "com.android.support:design:$rootProject.supportLibraryVersion"
androidTestCompile "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
androidTestImplementation "com.android.support:support-annotations:$rootProject.supportLibraryVersion"
androidTestImplementation "com.android.support:design:$rootProject.supportLibraryVersion"
androidTestImplementation "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
// Crashlytics
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/jacoco.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
apply plugin: 'jacoco'

jacoco {
toolVersion = "0.7.7.201606060606"
toolVersion = "0.8.1"
reportsDir = file("$buildDir/coverage")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import android.support.test.rule.GrantPermissionRule;
import android.support.test.runner.AndroidJUnit4;

import com.azimolabs.conditionwatcher.ConditionWatcher;
import com.azimolabs.conditionwatcher.Instruction;
import com.github.vase4kin.teamcityapp.R;
import com.github.vase4kin.teamcityapp.TeamCityApplication;
import com.github.vase4kin.teamcityapp.api.TeamCityService;
Expand Down Expand Up @@ -80,6 +82,7 @@
public class ArtifactListFragmentTest {

private static final String BUILD_TYPE_NAME = "name";
private static final int TIMEOUT = 5000;

@Rule
public DaggerMockRule<AppComponent> mAppComponentDaggerRule = new DaggerMockRule<>(AppComponent.class, new AppModule((TeamCityApplication) InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext()))
Expand Down Expand Up @@ -124,6 +127,7 @@ public void setUp() {
TeamCityApplication app = (TeamCityApplication) InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext();
app.getRestApiInjector().sharedUserStorage().clearAll();
app.getRestApiInjector().sharedUserStorage().saveGuestUserAccountAndSetItAsActive(Mocks.URL);
ConditionWatcher.setTimeoutLimit(TIMEOUT);
}

@Test
Expand Down Expand Up @@ -253,9 +257,32 @@ public void testUserCanOpenArtifactWithChildren() throws Exception {
// Checking first level artifacts
onView(withId(R.id.artifact_recycler_view)).check(hasItemsCount(1));
onView(withRecyclerView(R.id.artifact_recycler_view).atPositionOnView(0, R.id.itemTitle))
.check(matches(withText("res")))
.check(matches(withText("res")));

// Clicking first level artifacts
onView(withRecyclerView(R.id.artifact_recycler_view).atPositionOnView(0, R.id.itemTitle))
.perform(click());

ConditionWatcher.waitForCondition(new Instruction() {
@Override
public String getDescription() {
return "The artifact page is not loaded";
}

@Override
public boolean checkCondition() {
boolean isResFolderClicked = false;
try {
onView(withText("res_level_deeper1")).check(matches(isDisplayed()));
isResFolderClicked = true;
} catch (Exception ignored) {
onView(withRecyclerView(R.id.artifact_recycler_view).atPosition(0))
.perform(click());
}
return isResFolderClicked;
}
});

// In case of the same recycler view ids
onView(withText("res_level_deeper1")).check(matches(isDisplayed()));
onView(withText("res_level_deeper2")).check(matches(isDisplayed()));
Expand Down Expand Up @@ -369,12 +396,39 @@ public void testUserSeeSnackBarWithErrorMessageIfArtifactWasNotDownloaded() thro
.check(matches(isDisplayed()))
.perform(click());

// Clicking on artifact to download
// Checking artifact title
onView(withRecyclerView(R.id.artifact_recycler_view)
.atPositionOnView(1, R.id.itemTitle))
.check(matches(withText("AndroidManifest.xml")))
.perform(click());

// Clicking on artifact to download
onView(withRecyclerView(R.id.artifact_recycler_view)
.atPositionOnView(1, R.id.itemTitle))
.perform(click());

ConditionWatcher.waitForCondition(new Instruction() {
@Override
public String getDescription() {
return "The artifact menu is not opened";
}

@Override
public boolean checkCondition() {
boolean isMenuOpened = false;
try {
onView(withText(R.string.artifact_download))
.check(matches(isDisplayed()));
isMenuOpened = true;
} catch (Exception ignored) {
onView(withRecyclerView(R.id.artifact_recycler_view)
.atPositionOnView(1, R.id.itemTitle))
.perform(click());
}
return isMenuOpened;
}
});

// Click on download option
onView(withText(R.string.artifact_download))
.perform(click());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.matcher.ViewMatchers.isRoot;

/**
* Source: https://github.com/square/spoon/issues/214#issuecomment-81979248
*/
Expand Down Expand Up @@ -75,6 +72,6 @@ private static Activity getActivity(View view) {
}

public static void perform(String tag, String className, String methodName) {
onView(isRoot()).perform(new FalconScreenshotAction(tag, className, methodName));
// onView(isRoot()).perform(new FalconScreenshotAction(tag, className, methodName));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import com.azimolabs.conditionwatcher.ConditionWatcher;
import com.azimolabs.conditionwatcher.Instruction;
import com.github.vase4kin.teamcityapp.R;
import com.github.vase4kin.teamcityapp.TeamCityApplication;
import com.github.vase4kin.teamcityapp.api.TeamCityService;
Expand Down Expand Up @@ -67,6 +69,7 @@
public class PropertiesFragmentTest {

private static final String NAME = "name";
private static final int TIMEOUT = 5000;

@Rule
public DaggerMockRule<AppComponent> mAppComponentDaggerRule = new DaggerMockRule<>(AppComponent.class, new AppModule((TeamCityApplication) InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext()))
Expand Down Expand Up @@ -193,6 +196,7 @@ public void testUserCanSeeEmptyPropertiesMessageIfPropertiesAreEmpty() {

@Test
public void testUserCanCopyPropertyValueFromTheList() throws Exception {
ConditionWatcher.setTimeoutLimit(TIMEOUT);
// Prepare mocks
when(mTeamCityService.build(anyString())).thenReturn(Observable.just(mBuild));

Expand All @@ -216,7 +220,28 @@ public void testUserCanCopyPropertyValueFromTheList() throws Exception {
.perform(click());

// Click on parameter
onView(withRecyclerView(R.id.properties_recycler_view).atPosition(0)).perform(click());
onView(withRecyclerView(R.id.properties_recycler_view).atPosition(0))
.perform(click());

ConditionWatcher.waitForCondition(new Instruction() {
@Override
public String getDescription() {
return "The parameters menu is not opened";
}

@Override
public boolean checkCondition() {
boolean isParameterClicked = false;
try {
onView(withText(R.string.build_element_copy)).check(matches(isDisplayed()));
isParameterClicked = true;
} catch (Exception ignored) {
onView(withRecyclerView(R.id.properties_recycler_view).atPosition(0))
.perform(click());
}
return isParameterClicked;
}
});

// Clicking on copy
onView(withText(R.string.build_element_copy)).perform(click());
Expand Down
Loading

0 comments on commit 847a076

Please sign in to comment.