Updated to newest SDK and fixed UI-tests to run not only on a simulator, but also on real devices.

This commit is contained in:
Alexander Pacha
2016-10-31 14:17:01 +01:00
parent b321594d46
commit 468b322635
3 changed files with 12 additions and 7 deletions

View File

@@ -6,8 +6,8 @@ def code = formattedDate.toInteger() * 10000
def buildNumber = System.getenv("BITRISE_BUILD_NUMBER") as Integer ?: 0
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "org.hitlabnz.sensor_fusion_demo"
@@ -31,12 +31,12 @@ android {
}
dependencies {
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:support-v4:25.0.0'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.mockito:mockito-core:2.2.9'
androidTestCompile 'com.android.support:support-annotations:24.2.1'
androidTestCompile 'com.android.support:support-annotations:25.0.0'
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'

View File

@@ -1,6 +1,7 @@
package org.hitlabnz.sensor_fusion_demo.androidTest;
import android.app.Application;
import android.support.test.espresso.NoMatchingViewException;
import android.support.test.espresso.matcher.ViewMatchers;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
@@ -61,6 +62,10 @@ public class ApplicationTest {
}
public static void DiscardGyroscopeWarning() {
onView(withText("OK")).perform(click());
try {
onView(withText("OK")).perform(click());
} catch (NoMatchingViewException e) {
//view not displayed logic
}
}
}