You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@taverna.apache.org by Hiteshgautam01 <gi...@git.apache.org> on 2018/06/28 22:48:40 UTC
[GitHub] incubator-taverna-mobile pull request #89: Added Login Activity UI Test
GitHub user Hiteshgautam01 opened a pull request:
https://github.com/apache/incubator-taverna-mobile/pull/89
Added Login Activity UI Test
Please make sure these boxes are checked before submitting your pull request - thanks!
- [ ] Apply the `AndroidStyle.xml` style template to your code in Android Studio.
- [ ] Run the checks with `./gradlew check` to make sure you didn't break anything
- [ ] If you have multiple commits please combine them into one commit by squashing them.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Hiteshgautam01/incubator-taverna-mobile Test_4
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-taverna-mobile/pull/89.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #89
----
commit 9c467cb760d96fb6eb705ded251bce6014c1ddee
Author: Hitesh Gautam <ga...@...>
Date: 2018-06-28T22:46:57Z
Added Login Activity Test
----
---
[GitHub] incubator-taverna-mobile pull request #89: Added Login Activity UI Test
Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:
https://github.com/apache/incubator-taverna-mobile/pull/89#discussion_r201674494
--- Diff: app/build.gradle ---
@@ -125,7 +126,13 @@ dependencies {
//Dependencies for JUNit and unit tests.
testImplementation "junit:junit:4.12"
- testImplementation "org.mockito:mockito-all:1.10.19"
+ testImplementation "org.mockito:mockito-all:$rootProject.mockito"
+ androidTestImplementation "com.android.support.test.espresso:espresso-core:$rootProject.espresso"
+ androidTestImplementation "com.android.support.test:runner:1.0.1"
--- End diff --
do the same as above for all.
---
[GitHub] incubator-taverna-mobile pull request #89: Added Login Activity UI Test
Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:
https://github.com/apache/incubator-taverna-mobile/pull/89#discussion_r207101956
--- Diff: app/src/androidTest/java/org/apache/taverna/mobile/login/LoginActivityTest.java ---
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.taverna.mobile.login;
+
+import android.support.test.espresso.Espresso;
+import android.support.test.filters.LargeTest;
+import android.support.test.rule.ActivityTestRule;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.apache.taverna.mobile.R;
+import org.apache.taverna.mobile.data.DataManager;
+import org.apache.taverna.mobile.ui.login.LoginActivity;
+import org.apache.taverna.mobile.ui.login.LoginPresenter;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static android.os.SystemClock.sleep;
+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.closeSoftKeyboard;
+import static android.support.test.espresso.action.ViewActions.typeText;
+import static android.support.test.espresso.assertion.ViewAssertions.matches;
+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.allOf;
+import static org.mockito.Mockito.mock;
+
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class LoginActivityTest {
+
+ private DataManager dataManager;
+ private LoginPresenter loginPresenter;
--- End diff --
use this to mock the API response as you have done in jUnit testing.
---
[GitHub] incubator-taverna-mobile pull request #89: Added Login Activity UI Test
Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:
https://github.com/apache/incubator-taverna-mobile/pull/89#discussion_r199381168
--- Diff: app/build.gradle ---
@@ -126,6 +127,12 @@ dependencies {
//Dependencies for JUNit and unit tests.
testImplementation "junit:junit:4.12"
testImplementation "org.mockito:mockito-all:1.10.19"
+ androidTestImplementation "com.android.support.test.espresso:espresso-core:3.0.1"
--- End diff --
declare all dependency version in one place like we have done above.
---
[GitHub] incubator-taverna-mobile pull request #89: Added Login Activity UI Test
Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:
https://github.com/apache/incubator-taverna-mobile/pull/89#discussion_r199381284
--- Diff: app/src/main/java/org/apache/taverna/mobile/ui/login/LoginFragment.java ---
@@ -104,16 +104,10 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
mEditTextEmail.addTextChangedListener(new CustomTextWatcher(mEditTextEmail));
-
--- End diff --
remove unnecessary changes
---
[GitHub] incubator-taverna-mobile pull request #89: Added Login Activity UI Test
Posted by Hiteshgautam01 <gi...@git.apache.org>.
Github user Hiteshgautam01 closed the pull request at:
https://github.com/apache/incubator-taverna-mobile/pull/89
---