summaryrefslogtreecommitdiffstats
path: root/Android/07-Graphics/GraphicsLab/tests/src/course/labs
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-03-16 18:16:21 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-11-10 17:40:55 +0100
commitd8c875ed2a82ce24c96101845a5f5fafb27ed5cc (patch)
tree078931a9da3210db1559b5e4e360f83f087881e4 /Android/07-Graphics/GraphicsLab/tests/src/course/labs
parent1e33c4940ea43093a80077fbb7249b013e35a1f1 (diff)
downloadcoursera-d8c875ed2a82ce24c96101845a5f5fafb27ed5cc.zip
coursera-d8c875ed2a82ce24c96101845a5f5fafb27ed5cc.tar.gz
Android : 07-Graphics: add
Diffstat (limited to 'Android/07-Graphics/GraphicsLab/tests/src/course/labs')
-rw-r--r--Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityFling.java47
-rw-r--r--Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityFloatOffScreen.java40
-rw-r--r--Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityMultiple.java48
-rw-r--r--Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityPop.java47
4 files changed, 182 insertions, 0 deletions
diff --git a/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityFling.java b/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityFling.java
new file mode 100644
index 0000000..4ef8d91
--- /dev/null
+++ b/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityFling.java
@@ -0,0 +1,47 @@
+package course.labs.TouchLab.test;
+
+import course.labs.GraphicsLab.BubbleActivity;
+
+import com.robotium.solo.*;
+import android.test.ActivityInstrumentationTestCase2;
+
+
+public class BubbleActivityFling extends ActivityInstrumentationTestCase2<BubbleActivity> {
+ private Solo solo;
+
+ public BubbleActivityFling() {
+ super(BubbleActivity.class);
+ }
+
+ public void setUp() throws Exception {
+ solo = new Solo(getInstrumentation());
+ getActivity();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ solo.finishOpenedActivities();
+ }
+
+ public void testRun() {
+ // Wait for activity: 'course.labs.TouchLab.BubbleActivity'
+ solo.waitForActivity(course.labs.GraphicsLab.BubbleActivity.class, 2000);
+
+ solo.sleep(1000);
+
+ // Click on action bar item
+ solo.clickOnActionBarItem(0x1);
+
+ solo.sleep(1000);
+
+ // Click to create a bubble
+ solo.clickOnScreen(100, 100);
+
+ solo.sleep(1000);
+
+ // Fling
+ solo.drag(100, 500, 100, 500, 3);
+
+ solo.sleep(2000);
+ }
+}
diff --git a/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityFloatOffScreen.java b/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityFloatOffScreen.java
new file mode 100644
index 0000000..f8b1887
--- /dev/null
+++ b/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityFloatOffScreen.java
@@ -0,0 +1,40 @@
+package course.labs.TouchLab.test;
+
+import course.labs.GraphicsLab.BubbleActivity;
+
+import com.robotium.solo.*;
+import android.test.ActivityInstrumentationTestCase2;
+
+
+public class BubbleActivityFloatOffScreen extends ActivityInstrumentationTestCase2<BubbleActivity> {
+ private Solo solo;
+
+ public BubbleActivityFloatOffScreen() {
+ super(BubbleActivity.class);
+ }
+
+ public void setUp() throws Exception {
+ solo = new Solo(getInstrumentation());
+ getActivity();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ solo.finishOpenedActivities();
+ }
+
+ public void testRun() {
+ // Wait for activity: 'course.labs.TouchLab.BubbleActivity'
+ solo.waitForActivity(course.labs.GraphicsLab.BubbleActivity.class, 2000);
+
+ // Click on action bar item
+ solo.clickOnActionBarItem(0x2);
+
+ solo.sleep(1000);
+
+ // Click to create a bubble
+ solo.clickOnScreen(500, 500);
+
+ solo.sleep(2000);
+ }
+}
diff --git a/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityMultiple.java b/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityMultiple.java
new file mode 100644
index 0000000..c525a4e
--- /dev/null
+++ b/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityMultiple.java
@@ -0,0 +1,48 @@
+package course.labs.TouchLab.test;
+
+import course.labs.GraphicsLab.BubbleActivity;
+
+import com.robotium.solo.*;
+import android.test.ActivityInstrumentationTestCase2;
+
+
+public class BubbleActivityMultiple extends ActivityInstrumentationTestCase2<BubbleActivity> {
+ private Solo solo;
+
+ public BubbleActivityMultiple() {
+ super(BubbleActivity.class);
+ }
+
+ public void setUp() throws Exception {
+ solo = new Solo(getInstrumentation());
+ getActivity();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ solo.finishOpenedActivities();
+ }
+
+ public void testRun() {
+ // Wait for activity: 'course.labs.TouchLab.BubbleActivity'
+ solo.waitForActivity(course.labs.GraphicsLab.BubbleActivity.class, 2000);
+
+ solo.sleep(1000);
+
+ // Click on action bar item
+ solo.clickOnActionBarItem(0x1);
+
+ solo.sleep(1000);
+
+ // Click to create a bubble
+ solo.clickOnScreen(250, 250);
+
+ solo.sleep(1000);
+
+ // Click to remove the same bubble
+ solo.clickOnScreen(500, 500);
+
+ solo.sleep(1000);
+
+ }
+}
diff --git a/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityPop.java b/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityPop.java
new file mode 100644
index 0000000..29cf679
--- /dev/null
+++ b/Android/07-Graphics/GraphicsLab/tests/src/course/labs/GraphicsLab/BubbleActivityPop.java
@@ -0,0 +1,47 @@
+package course.labs.TouchLab.test;
+
+import course.labs.GraphicsLab.BubbleActivity;
+
+import com.robotium.solo.*;
+import android.test.ActivityInstrumentationTestCase2;
+
+
+public class BubbleActivityPop extends ActivityInstrumentationTestCase2<BubbleActivity> {
+ private Solo solo;
+
+ public BubbleActivityPop() {
+ super(BubbleActivity.class);
+ }
+
+ public void setUp() throws Exception {
+ solo = new Solo(getInstrumentation());
+ getActivity();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ solo.finishOpenedActivities();
+ }
+
+ public void testRun() {
+ // Wait for activity: 'course.labs.TouchLab.BubbleActivity'
+ solo.waitForActivity(course.labs.GraphicsLab.BubbleActivity.class, 2000);
+
+ solo.sleep(1000);
+
+ // Click on action bar item
+ solo.clickOnActionBarItem(0x1);
+
+ solo.sleep(1000);
+
+ // Click to create a bubble
+ solo.clickOnScreen(250, 250);
+
+ solo.sleep(1000);
+
+ // Click to remove the same bubble
+ solo.clickOnScreen(250, 250);
+
+ solo.sleep(1000);
+ }
+}