From b1bab0f553c01d99d5d377f89f64ba84e3cf1036 Mon Sep 17 00:00:00 2001 From: Madhur Gupta Date: Sat, 23 Mar 2019 18:37:51 +0530 Subject: [PATCH] Added Forgot Password Unit Test --- .../java/fr/free/nrw/commons/LoginActivityTest.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/androidTest/java/fr/free/nrw/commons/LoginActivityTest.kt b/app/src/androidTest/java/fr/free/nrw/commons/LoginActivityTest.kt index ffbff18785..a56276a18a 100644 --- a/app/src/androidTest/java/fr/free/nrw/commons/LoginActivityTest.kt +++ b/app/src/androidTest/java/fr/free/nrw/commons/LoginActivityTest.kt @@ -1,10 +1,12 @@ package fr.free.nrw.commons +import android.content.Intent import androidx.test.espresso.Espresso import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.assertion.ViewAssertions import androidx.test.espresso.intent.Intents import androidx.test.espresso.intent.Intents.intended +import androidx.test.espresso.intent.matcher.IntentMatchers.hasAction import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent import androidx.test.espresso.matcher.ViewMatchers import androidx.test.espresso.matcher.ViewMatchers.withId @@ -33,4 +35,15 @@ class LoginActivityTest { intended(hasComponent(SignupActivity::class.java.name)) Intents.release() } + + @Test + fun isForgotPasswordWorks() { + // Clicks the forgot password + Intents.init() + Espresso.onView(withId(R.id.forgotPassword)) + .check(ViewAssertions.matches(ViewMatchers.isDisplayed())) + .perform(click()) + intended(hasAction(Intent.ACTION_VIEW)) + Intents.release() + } } \ No newline at end of file