mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
* Run instrumentation tests on CI and generate unified coverage report * Fix ci * Fix failing tests and use mac machine for HAXM * Fix failing tests * Fix coverage failure * Try with ubuntu latest * Change API level to 23 * Fix Failing Test * Add prod APK generator workflow back
53 lines
No EOL
1.5 KiB
Kotlin
53 lines
No EOL
1.5 KiB
Kotlin
package fr.free.nrw.commons
|
|
|
|
import androidx.test.espresso.Espresso
|
|
import androidx.test.espresso.action.ViewActions.click
|
|
import androidx.test.espresso.assertion.ViewAssertions
|
|
import androidx.test.espresso.intent.Intents
|
|
import androidx.test.espresso.intent.Intents.intended
|
|
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
|
|
import androidx.test.espresso.matcher.ViewMatchers
|
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
|
import androidx.test.rule.ActivityTestRule
|
|
import androidx.test.runner.AndroidJUnit4
|
|
import fr.free.nrw.commons.auth.LoginActivity
|
|
import fr.free.nrw.commons.auth.SignupActivity
|
|
import org.junit.Before
|
|
import org.junit.Ignore
|
|
import org.junit.Rule
|
|
import org.junit.Test
|
|
import org.junit.runner.RunWith
|
|
|
|
@RunWith(AndroidJUnit4::class)
|
|
class SignupTest {
|
|
@get:Rule
|
|
var activityRule: ActivityTestRule<*> = ActivityTestRule(LoginActivity::class.java)
|
|
|
|
@Before
|
|
fun setup() {
|
|
UITestHelper.skipWelcome()
|
|
}
|
|
|
|
@Test
|
|
@Ignore("Fix Failing Test")
|
|
fun testSignupButton() {
|
|
try {
|
|
Intents.init()
|
|
} catch (ex: IllegalStateException) {
|
|
|
|
}
|
|
|
|
UITestHelper.sleep(3000)
|
|
Espresso.onView(withId(R.id.sign_up_button))
|
|
.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
|
|
.perform(click())
|
|
intended(hasComponent(SignupActivity::class.java.name))
|
|
Intents.release()
|
|
}
|
|
|
|
@Test
|
|
@Ignore("Fix Failing Test")
|
|
fun orientationChange() {
|
|
UITestHelper.changeOrientation(activityRule)
|
|
}
|
|
} |