diff --git a/vector-app/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt b/vector-app/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt index ad11d953d4..d4878b8dcc 100644 --- a/vector-app/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt +++ b/vector-app/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt @@ -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 diff --git a/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt b/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt index 55142d128c..0cea26d5cc 100644 --- a/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt +++ b/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt @@ -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)