1
1
package fr.free.nrw.commons
2
2
3
3
import androidx.test.espresso.Espresso.onView
4
+ import androidx.test.espresso.action.ViewActions
4
5
import androidx.test.espresso.assertion.ViewAssertions.matches
5
6
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
6
7
import androidx.test.espresso.matcher.ViewMatchers.withId
@@ -34,4 +35,39 @@ class WelcomeActivityTest {
34
35
.check(matches(not (isDisplayed())))
35
36
}
36
37
}
38
+
39
+ @Test
40
+ fun testBetaSkipButton () {
41
+ if (ConfigUtils .isBetaFlavour()) {
42
+ onView(withId(R .id.finishTutorialButton))
43
+ .perform(ViewActions .click())
44
+ assert (activityRule.activity.isDestroyed)
45
+ }
46
+ }
47
+
48
+ @Test
49
+ fun testSwipingOnce () {
50
+ onView(withId(R .id.welcomePager))
51
+ .perform(ViewActions .swipeLeft())
52
+ assert (true )
53
+ onView(withId(R .id.welcomePager))
54
+ .perform(ViewActions .swipeRight())
55
+ assert (true )
56
+ }
57
+
58
+ @Test
59
+ fun testSwipingWholeTutorial () {
60
+ onView(withId(R .id.welcomePager))
61
+ .perform(ViewActions .swipeLeft())
62
+ .perform(ViewActions .swipeLeft())
63
+ .perform(ViewActions .swipeLeft())
64
+ .perform(ViewActions .swipeLeft())
65
+ assert (true )
66
+ onView(withId(R .id.welcomePager))
67
+ .perform(ViewActions .swipeRight())
68
+ .perform(ViewActions .swipeRight())
69
+ .perform(ViewActions .swipeRight())
70
+ .perform(ViewActions .swipeRight())
71
+ assert (true )
72
+ }
37
73
}
0 commit comments