mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
sanity test now reads properties value to determine app layout feature status + small fix for tests
This commit is contained in:
parent
6badbe738d
commit
2ab0343e4f
@ -21,6 +21,7 @@ import androidx.test.espresso.IdlingPolicies
|
||||
import androidx.test.ext.junit.rules.ActivityScenarioRule
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.filters.LargeTest
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.rule.GrantPermissionRule
|
||||
import im.vector.app.R
|
||||
import im.vector.app.espresso.tools.ScreenshotFailureRule
|
||||
@ -28,6 +29,7 @@ import im.vector.app.features.MainActivity
|
||||
import im.vector.app.getString
|
||||
import im.vector.app.ui.robot.ElementRobot
|
||||
import im.vector.app.ui.robot.settings.labs.LabFeature
|
||||
import im.vector.app.ui.robot.settings.labs.LabFeaturesPreferences
|
||||
import im.vector.app.ui.robot.withDeveloperMode
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
@ -49,7 +51,14 @@ class UiAllScreensSanityTest {
|
||||
.around(GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE))
|
||||
.around(ScreenshotFailureRule())
|
||||
|
||||
private val elementRobot = ElementRobot()
|
||||
private val elementRobot = ElementRobot(
|
||||
LabFeaturesPreferences(
|
||||
InstrumentationRegistry.getInstrumentation()
|
||||
.targetContext
|
||||
.resources
|
||||
.getBoolean(R.bool.settings_labs_new_app_layout_default)
|
||||
)
|
||||
)
|
||||
|
||||
// Last passing:
|
||||
// 2020-11-09
|
||||
|
@ -32,9 +32,7 @@ class NewRoomRobot(
|
||||
private val features: VectorFeatures = DefaultVectorFeatures()
|
||||
|
||||
fun createNewRoom(block: CreateNewRoomRobot.() -> Unit) {
|
||||
if (labsPreferences.isNewAppLayoutEnabled) {
|
||||
clickOn(R.string.create_new_room)
|
||||
}
|
||||
clickOn(R.string.create_new_room)
|
||||
waitUntilViewVisible(withId(R.id.createRoomForm))
|
||||
val createNewRoomRobot = CreateNewRoomRobot()
|
||||
block(createNewRoomRobot)
|
||||
|
Loading…
Reference in New Issue
Block a user