File tree 1 file changed +37
-0
lines changed
app/src/androidTest/java/fr/free/nrw/commons
1 file changed +37
-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.onView
4
+ import androidx.test.espresso.assertion.ViewAssertions.matches
5
+ import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
6
+ import androidx.test.espresso.matcher.ViewMatchers.withId
7
+ import androidx.test.filters.LargeTest
8
+ import androidx.test.rule.ActivityTestRule
9
+ import androidx.test.runner.AndroidJUnit4
10
+ import fr.free.nrw.commons.utils.ConfigUtils
11
+ import org.hamcrest.core.IsNot.not
12
+ import org.junit.Rule
13
+ import org.junit.Test
14
+ import org.junit.runner.RunWith
15
+
16
+ @LargeTest
17
+ @RunWith(AndroidJUnit4 ::class )
18
+ class WelcomeActivityTest {
19
+ @get:Rule
20
+ var activityRule: ActivityTestRule <* > = ActivityTestRule (WelcomeActivity ::class .java)
21
+
22
+ @Test
23
+ fun ifBetaShowsSkipButton () {
24
+ if (ConfigUtils .isBetaFlavour()) {
25
+ onView(withId(R .id.finishTutorialButton))
26
+ .check(matches(isDisplayed()))
27
+ }
28
+ }
29
+
30
+ @Test
31
+ fun ifProdHidesSkipButton () {
32
+ if (! ConfigUtils .isBetaFlavour()) {
33
+ onView(withId(R .id.finishTutorialButton))
34
+ .check(matches(not (isDisplayed())))
35
+ }
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments