maestro.orchestra.MaestroConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maestro-orchestra-models Show documentation
Show all versions of maestro-orchestra-models Show documentation
Maestro is a server-driven platform-agnostic library that allows to drive tests for both iOS and Android using the same implementation through an intuitive API.
package maestro.orchestra
import maestro.js.JsEngine
import maestro.orchestra.util.Env.evaluateScripts
// Note: The appId config is only a yaml concept for now. It'll be a larger migration to get to a point
// where appId is part of MaestroConfig (and factored out of MaestroCommands - eg: LaunchAppCommand).
data class MaestroConfig(
val appId: String? = null,
val name: String? = null,
val tags: List? = emptyList(),
val initFlow: MaestroInitFlow? = null,
val ext: Map = emptyMap(),
) {
fun evaluateScripts(jsEngine: JsEngine): MaestroConfig {
return copy(
appId = appId?.evaluateScripts(jsEngine),
name = name?.evaluateScripts(jsEngine),
initFlow = initFlow?.evaluateScripts(jsEngine),
)
}
}
data class MaestroInitFlow(
val appId: String,
val commands: List,
) {
fun evaluateScripts(jsEngine: JsEngine): MaestroInitFlow {
return copy(
appId = appId.evaluateScripts(jsEngine),
)
}
}