Permalink
Browse files

OI Countdown Test: Prepare for Jenkins server.

git-svn-id: https://openintents.googlecode.com/svn/trunk@4209 72b678ce-9140-0410-bee8-679b907dd61a
  • Loading branch information...
1 parent 91c94aa commit 6bfdcc33915e15af8248be01a4a58a38384ce3f0 @peli0101 peli0101 committed Feb 26, 2012
View
@@ -4,6 +4,6 @@
<classpathentry kind="src" path="gen"/>
<classpathentry combineaccessrules="false" kind="src" path="/OI Countdown"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="lib" path="libs/robotium-solo-2.5.jar"/>
+ <classpathentry kind="lib" path="libs/robotium-solo-3.1.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
@@ -16,4 +16,8 @@
<uses-library android:name="android.test.runner" />
</application>
+ <!-- Instrumentation for Jenkins server -->
+ <instrumentation
+ android:targetPackage="org.openintents.countdown"
+ android:name="pl.polidea.instrumentation.PolideaInstrumentationTestRunner" />
</manifest>
@@ -0,0 +1,18 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+# 'source.dir' for the location of your java source folder and
+# 'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+# 'key.store' for the location of your keystore and
+# 'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
+tested.project.dir=../Countdown
View
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="CountdownTest" default="help">
+ <!--
+ #############################################
+ Import tasks from common build script.
+ ############################################# -->
+
+ <!-- Private build properties are not shared via svn,
+ developers must have their own copy. -->
+ <property file="build-private.properties" />
+
+ <!-- Root directory of all OpenIntents files. -->
+ <property name="source.base" value="../.." />
+
+ <!-- Path for common ant script. -->
+ <property name="build.common.dir" value="${source.base}/distribution/ant" />
+
+ <!-- All definitions are imported from a central location -->
+ <import file="${build.common.dir}/test_build_common.xml" />
+</project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -8,6 +8,7 @@
import android.app.Activity;
import android.content.Intent;
import android.test.InstrumentationTestCase;
+import android.test.suitebuilder.annotation.Smoke;
import android.view.View;
import android.widget.DatePicker;
import android.widget.TimePicker;
@@ -41,13 +42,42 @@ protected void setUp() throws Exception {
@Override
public void tearDown() throws Exception {
try {
- solo.finalize(); //Robotium will finish all the activities that have been open
+ this.solo.finishOpenedActivities();
} catch (Throwable e) {
e.printStackTrace();
}
super.tearDown();
}
-
+
+ private String getAppString(int resId) {
+ return activity.getString(resId);
+ }
+
+ @Smoke
+ public void test000Eula() {
+ String accept = getAppString(org.openintents.distribution.R.string.oi_distribution_eula_accept);
+ String cancel = getAppString(org.openintents.distribution.R.string.oi_distribution_eula_refuse);
+ boolean existsAccept = solo.searchButton(accept);
+ boolean existsCancel = solo.searchButton(cancel);
+
+ if (existsAccept && existsCancel) {
+ solo.clickOnButton(accept);
+ }
+ }
+
+ @Smoke
+ public void test001RecentChanges() {
+ String recentChanges = getAppString(org.openintents.distribution.R.string.oi_distribution_newversion_recent_changes);
+ String cont = getAppString(org.openintents.distribution.R.string.oi_distribution_newversion_continue);
+ while(solo.scrollUp());
+ boolean existsRecentChanges = solo.searchText(recentChanges);
+ boolean existsCont = solo.searchButton(cont);
+
+ if (existsRecentChanges && existsCont) {
+ solo.clickOnButton(cont);
+ }
+ }
+
/*
* Test adding a countdown
*/

0 comments on commit 6bfdcc3

Please sign in to comment.