mirror of
https://github.com/bitwarden/android.git
synced 2026-05-10 16:45:43 -05:00
Using Compose Testing + Espresso
This commit is contained in:
@@ -293,6 +293,12 @@ dependencies {
|
||||
testImplementation(libs.robolectric.robolectric)
|
||||
testImplementation(libs.square.okhttp.mockwebserver)
|
||||
testImplementation(libs.square.turbine)
|
||||
androidTestImplementation(libs.androidx.uiautomator)
|
||||
androidTestImplementation(libs.androidx.espresso.core)
|
||||
androidTestImplementation(libs.androidx.junit.ktx)
|
||||
androidTestImplementation(libs.androidx.ui.test.junit4.android)
|
||||
androidTestImplementation("androidx.test:runner:1.6.0")
|
||||
androidTestImplementation("androidx.test:rules:1.6.0")
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
11
app/proguard-rules.pro
vendored
11
app/proguard-rules.pro
vendored
@@ -121,3 +121,14 @@
|
||||
-dontwarn com.google.errorprone.annotations.CheckReturnValue
|
||||
-dontwarn com.google.errorprone.annotations.Immutable
|
||||
-dontwarn com.google.errorprone.annotations.RestrictedApi
|
||||
|
||||
################################################################################
|
||||
# AndroidX Test Runner
|
||||
################################################################################
|
||||
|
||||
# Keep the test runner classes
|
||||
-keep class androidx.test.runner.** { *; }
|
||||
-keep class androidx.test.internal.runner.** { *; }
|
||||
-keep class androidx.test.ext.junit.** { *; }
|
||||
-keep class androidx.test.ext.** { *; }
|
||||
-keep class androidx.test.** { *; }
|
||||
|
||||
@@ -16,7 +16,7 @@ import androidx.compose.ui.test.performClick
|
||||
*/
|
||||
abstract class Page(protected val composeTestRule: ComposeTestRule) {
|
||||
companion object {
|
||||
val TIMEOUT_MILLIS = 15000L
|
||||
val TIMEOUT_MILLIS = 30000L
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package e2e.tests
|
||||
|
||||
import androidx.compose.ui.test.*
|
||||
import androidx.compose.ui.test.junit4.ComposeTestRule
|
||||
import androidx.compose.ui.test.junit4.createAndroidComposeRule
|
||||
import androidx.compose.ui.test.junit4.createEmptyComposeRule
|
||||
import androidx.test.ext.junit.rules.ActivityScenarioRule
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import com.x8bit.bitwarden.MainActivity
|
||||
import e2e.pageObjects.login.MainPage
|
||||
@@ -13,7 +16,11 @@ import org.junit.runner.RunWith
|
||||
class RealDeviceE2ETests {
|
||||
|
||||
@get:Rule
|
||||
val composeTestRule = createAndroidComposeRule<MainActivity>()
|
||||
val activityRule = ActivityScenarioRule(MainActivity::class.java)
|
||||
|
||||
// Workaround to find Compose UI elements on Espresso tests
|
||||
@get:Rule
|
||||
val composeTestRule: ComposeTestRule = createEmptyComposeRule()
|
||||
|
||||
@Test
|
||||
fun testVaultLockUnlockFlow() {
|
||||
|
||||
Reference in New Issue
Block a user