Fix compilation errors while trying to run instrumentation tests. (#3850)

This commit is contained in:
Mike Hurtado 2020-06-29 09:42:47 -07:00 committed by GitHub
parent dea629c2c4
commit 7caf73fb4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 15 deletions

View file

@ -14,7 +14,7 @@ import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import fr.free.nrw.commons.utils.ConfigUtils
import fr.free.nrw.commons.utils.ConfigUtils.getVersionNameWithSha
import org.hamcrest.CoreMatchers
import org.junit.Before
import org.junit.Rule
@ -36,7 +36,9 @@ class AboutActivityTest {
@Test
fun testBuildNumber() {
Espresso.onView(ViewMatchers.withId(R.id.about_version))
.check(ViewAssertions.matches(withText(ConfigUtils.getVersionNameWithSha(getApplicationContext()))))
.check(ViewAssertions.matches(
withText(getApplicationContext<CommonsApplication>().getVersionNameWithSha())
))
}
@Test