mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Extend WelcomeActivityTest (#2666)
This commit is contained in:
parent
d72bd446fe
commit
fc7399cae7
1 changed files with 36 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package fr.free.nrw.commons
|
||||
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.action.ViewActions
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||
|
|
@ -34,4 +35,39 @@ class WelcomeActivityTest {
|
|||
.check(matches(not(isDisplayed())))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testBetaSkipButton() {
|
||||
if (ConfigUtils.isBetaFlavour()) {
|
||||
onView(withId(R.id.finishTutorialButton))
|
||||
.perform(ViewActions.click())
|
||||
assert(activityRule.activity.isDestroyed)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSwipingOnce() {
|
||||
onView(withId(R.id.welcomePager))
|
||||
.perform(ViewActions.swipeLeft())
|
||||
assert(true)
|
||||
onView(withId(R.id.welcomePager))
|
||||
.perform(ViewActions.swipeRight())
|
||||
assert(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSwipingWholeTutorial() {
|
||||
onView(withId(R.id.welcomePager))
|
||||
.perform(ViewActions.swipeLeft())
|
||||
.perform(ViewActions.swipeLeft())
|
||||
.perform(ViewActions.swipeLeft())
|
||||
.perform(ViewActions.swipeLeft())
|
||||
assert(true)
|
||||
onView(withId(R.id.welcomePager))
|
||||
.perform(ViewActions.swipeRight())
|
||||
.perform(ViewActions.swipeRight())
|
||||
.perform(ViewActions.swipeRight())
|
||||
.perform(ViewActions.swipeRight())
|
||||
assert(true)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue