Private val is better.

This commit is contained in:
Benoit Marty 2022-09-06 15:00:55 +02:00
parent 4dc01fcfa6
commit f604b1d384
5 changed files with 4 additions and 9 deletions

View file

@ -51,8 +51,7 @@ import im.vector.app.withIdlingResource
import timber.log.Timber import timber.log.Timber
class ElementRobot { class ElementRobot {
private val features: VectorFeatures = DefaultVectorFeatures()
var features: VectorFeatures = DefaultVectorFeatures()
fun onboarding(block: OnboardingRobot.() -> Unit) { fun onboarding(block: OnboardingRobot.() -> Unit) {
block(OnboardingRobot()) block(OnboardingRobot())

View file

@ -27,8 +27,7 @@ import im.vector.app.features.VectorFeatures
class NewRoomRobot( class NewRoomRobot(
var createdRoom: Boolean = false var createdRoom: Boolean = false
) { ) {
private val features: VectorFeatures = DefaultVectorFeatures()
private var features: VectorFeatures = DefaultVectorFeatures()
fun createNewRoom(block: CreateNewRoomRobot.() -> Unit) { fun createNewRoom(block: CreateNewRoomRobot.() -> Unit) {
if (features.isNewAppLayoutEnabled()) { if (features.isNewAppLayoutEnabled()) {

View file

@ -33,7 +33,6 @@ import im.vector.app.features.DefaultVectorFeatures
import im.vector.app.waitForView import im.vector.app.waitForView
class OnboardingRobot { class OnboardingRobot {
private val defaultVectorFeatures = DefaultVectorFeatures() private val defaultVectorFeatures = DefaultVectorFeatures()
fun crawl() { fun crawl() {

View file

@ -33,8 +33,7 @@ import im.vector.app.features.VectorFeatures
import im.vector.app.features.roomdirectory.RoomDirectoryActivity import im.vector.app.features.roomdirectory.RoomDirectoryActivity
class RoomListRobot { class RoomListRobot {
private val features: VectorFeatures = DefaultVectorFeatures()
private var features: VectorFeatures = DefaultVectorFeatures()
fun openRoom(roomName: String, block: RoomDetailRobot.() -> Unit) { fun openRoom(roomName: String, block: RoomDetailRobot.() -> Unit) {
clickOn(roomName) clickOn(roomName)

View file

@ -33,8 +33,7 @@ import im.vector.app.features.VectorFeatures
import org.hamcrest.Matchers import org.hamcrest.Matchers
class SpaceRobot { class SpaceRobot {
private val features: VectorFeatures = DefaultVectorFeatures()
private var features: VectorFeatures = DefaultVectorFeatures()
fun createSpace(isFirstSpace: Boolean, block: SpaceCreateRobot.() -> Unit) { fun createSpace(isFirstSpace: Boolean, block: SpaceCreateRobot.() -> Unit) {
if (features.isNewAppLayoutEnabled()) { if (features.isNewAppLayoutEnabled()) {