File tree 1 file changed +36
-0
lines changed
app/src/androidTest/java/fr/free/nrw/commons
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ package fr.free.nrw.commons
2
+
3
+ import androidx.test.espresso.Espresso
4
+ import androidx.test.espresso.action.ViewActions.click
5
+ import androidx.test.espresso.assertion.ViewAssertions
6
+ import androidx.test.espresso.intent.Intents
7
+ import androidx.test.espresso.intent.Intents.intended
8
+ import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
9
+ import androidx.test.espresso.matcher.ViewMatchers
10
+ import androidx.test.espresso.matcher.ViewMatchers.withId
11
+ import androidx.test.filters.LargeTest
12
+ import androidx.test.rule.ActivityTestRule
13
+ import androidx.test.runner.AndroidJUnit4
14
+ import fr.free.nrw.commons.auth.LoginActivity
15
+ import fr.free.nrw.commons.auth.SignupActivity
16
+ import org.junit.Rule
17
+ import org.junit.Test
18
+ import org.junit.runner.RunWith
19
+
20
+ @LargeTest
21
+ @RunWith(AndroidJUnit4 ::class )
22
+ class LoginActivityTest {
23
+ @get:Rule
24
+ var activity: ActivityTestRule <* > = ActivityTestRule (LoginActivity ::class .java)
25
+
26
+ @Test
27
+ fun isSignUpButtonWorks () {
28
+ // Clicks the SignUp Button
29
+ Intents .init ()
30
+ Espresso .onView(withId(R .id.signupButton))
31
+ .check(ViewAssertions .matches(ViewMatchers .isDisplayed()))
32
+ .perform(click())
33
+ intended(hasComponent(SignupActivity ::class .java.name))
34
+ Intents .release()
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments