mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Add WelcomeActivityTest (#2636)
* Add WelcomeActivityTest * Convert WelcomeActivityTest to Kotlin
This commit is contained in:
parent
38dc0c3fc8
commit
0b6a1addfb
1 changed files with 37 additions and 0 deletions
|
|
@ -0,0 +1,37 @@
|
|||
package fr.free.nrw.commons
|
||||
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||
import androidx.test.filters.LargeTest
|
||||
import androidx.test.rule.ActivityTestRule
|
||||
import androidx.test.runner.AndroidJUnit4
|
||||
import fr.free.nrw.commons.utils.ConfigUtils
|
||||
import org.hamcrest.core.IsNot.not
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
@LargeTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class WelcomeActivityTest {
|
||||
@get:Rule
|
||||
var activityRule: ActivityTestRule<*> = ActivityTestRule(WelcomeActivity::class.java)
|
||||
|
||||
@Test
|
||||
fun ifBetaShowsSkipButton() {
|
||||
if (ConfigUtils.isBetaFlavour()) {
|
||||
onView(withId(R.id.finishTutorialButton))
|
||||
.check(matches(isDisplayed()))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun ifProdHidesSkipButton() {
|
||||
if (!ConfigUtils.isBetaFlavour()) {
|
||||
onView(withId(R.id.finishTutorialButton))
|
||||
.check(matches(not(isDisplayed())))
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue