You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by sa...@apache.org on 2018/08/27 10:02:23 UTC

[1/2] incubator-taverna-mobile git commit: Added TutorialActivity UI Test

Repository: incubator-taverna-mobile
Updated Branches:
  refs/heads/master 6b17c7c06 -> 20631c9b5


Added TutorialActivity UI Test


Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/048d8567
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/048d8567
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/048d8567

Branch: refs/heads/master
Commit: 048d8567fe43f94e64ed99862776a27b18bd03bd
Parents: 775fe17
Author: Hitesh Gautam <ga...@gmail.com>
Authored: Sun Aug 19 12:41:20 2018 +0530
Committer: Hitesh Gautam <ga...@gmail.com>
Committed: Tue Aug 21 13:02:18 2018 +0530

----------------------------------------------------------------------
 .../mobile/tutorial/TutorialActivityTest.java   | 105 +++++++++++++++++++
 1 file changed, 105 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/048d8567/app/src/androidTest/java/org/apache/taverna/mobile/tutorial/TutorialActivityTest.java
----------------------------------------------------------------------
diff --git a/app/src/androidTest/java/org/apache/taverna/mobile/tutorial/TutorialActivityTest.java b/app/src/androidTest/java/org/apache/taverna/mobile/tutorial/TutorialActivityTest.java
new file mode 100644
index 0000000..749ad5b
--- /dev/null
+++ b/app/src/androidTest/java/org/apache/taverna/mobile/tutorial/TutorialActivityTest.java
@@ -0,0 +1,105 @@
+package org.apache.taverna.mobile.tutorial;
+
+import android.support.test.espresso.intent.Intents;
+import android.support.test.rule.ActivityTestRule;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.apache.taverna.mobile.R;
+import org.apache.taverna.mobile.ui.login.LoginActivity;
+import org.apache.taverna.mobile.ui.tutorial.TutorialActivity;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static android.support.test.espresso.Espresso.onView;
+import static android.support.test.espresso.action.ViewActions.click;
+import static android.support.test.espresso.action.ViewActions.swipeLeft;
+import static android.support.test.espresso.action.ViewActions.swipeRight;
+import static android.support.test.espresso.assertion.ViewAssertions.matches;
+import static android.support.test.espresso.intent.Intents.intended;
+import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent;
+import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
+import static android.support.test.espresso.matcher.ViewMatchers.withId;
+import static android.support.test.espresso.matcher.ViewMatchers.withText;
+import static org.hamcrest.CoreMatchers.not;
+
+@RunWith(AndroidJUnit4.class)
+public class TutorialActivityTest {
+
+    @Rule
+    public ActivityTestRule<TutorialActivity> mActivityTestRule
+            = new ActivityTestRule<>(TutorialActivity.class);
+
+    @Before
+    public void setUp() {
+        mActivityTestRule.getActivity()
+                .getSupportFragmentManager().beginTransaction();
+    }
+
+    /**
+     * Check all the views present are visible
+     */
+    @Test
+    public void CheckAllViewAreVisible() throws Exception {
+
+        onView(withId(R.id.layoutDots)).check(matches((isDisplayed())));
+        onView(withId(R.id.btn_next)).check(matches((isDisplayed())));
+        onView(withId(R.id.btn_skip)).check(matches((isDisplayed())));
+        onView(withId(R.id.layoutDots)).check(matches((isDisplayed())));
+        onView(withId(R.id.slide_pager)).check(matches((isDisplayed())));
+    }
+
+    /**
+     * Checks while clicking on skip button should start login activity
+     */
+    @Test
+    public void clickingSkip_shouldStartLoginActivity() throws Exception {
+
+        Intents.init();
+        onView(withId(R.id.btn_skip)).perform(click());
+        intended(hasComponent(LoginActivity.class.getName()));
+        Intents.release();
+    }
+
+    /**
+     * Check swipes are working on tutorial screens and on last tutorial screen while clicking on
+     * GOT IT it should go to login activity
+     */
+    @Test
+    public void clickingNext_shouldGotoNextTutorial_onClickGotIt_ShouldGoToLoginActivity()
+            throws Exception {
+
+        Intents.init();
+        onView(withText(R.string.next)).check(matches(isDisplayed()));
+        onView(withId(R.id.slide_pager)).perform(swipeLeft());
+        onView(withId(R.id.slide_pager)).perform(swipeLeft());
+        onView(withId(R.id.slide_pager)).perform(swipeLeft());
+        onView(withId(R.id.slide_pager)).perform(swipeLeft());
+        onView(withText("SKIP")).check(matches(not(isDisplayed())));
+        onView(withText("GOT IT")).check(matches(isDisplayed()));
+        onView(withText("GOT IT")).perform(click());
+        intended(hasComponent(LoginActivity.class.getName()));
+        Intents.release();
+
+    }
+
+    /**
+     * First it swipes two times and then swipe back. Then this test will check while clicking
+     * on the skip button should go the login activity
+     */
+    @Test
+    public void swipeRightLeft_clickOnSkip_shouldGoToLoginActivity() throws Exception {
+
+        Intents.init();
+        onView(withText(R.string.next)).check(matches(isDisplayed()));
+        onView(withId(R.id.slide_pager)).perform(swipeLeft());
+        onView(withId(R.id.slide_pager)).perform(swipeLeft());
+        onView(withId(R.id.slide_pager)).perform(swipeRight());
+        onView(withText("SKIP")).check(matches(isDisplayed()));
+        onView(withId(R.id.btn_skip)).perform(click());
+        intended(hasComponent(LoginActivity.class.getName()));
+        Intents.release();
+    }
+
+}


[2/2] incubator-taverna-mobile git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile

Posted by sa...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile


Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/20631c9b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/20631c9b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/20631c9b

Branch: refs/heads/master
Commit: 20631c9b5f45850814465497214ead03d34b0a3a
Parents: 048d856 6b17c7c
Author: Sagar <ku...@gmail.com>
Authored: Mon Aug 27 15:32:01 2018 +0530
Committer: Sagar <ku...@gmail.com>
Committed: Mon Aug 27 15:32:01 2018 +0530

----------------------------------------------------------------------
 app/build.gradle                                |   2 +-
 .../taverna/mobile/DashboardActivityTest.java   | 278 +++++++++++++++++++
 .../taverna/mobile/login/LoginActivityTest.java |   1 +
 .../taverna/mobile/ui/DashboardActivity.java    |   2 +-
 app/src/main/res/layout/about.xml               |   1 +
 app/src/main/res/values/strings.xml             |   1 +
 build.gradle                                    |   2 +-
 7 files changed, 284 insertions(+), 3 deletions(-)
----------------------------------------------------------------------