All Downloads are FREE. Search and download functionalities are using the official Maven repository.

maestro.orchestra.yaml.YamlScrollUntilVisible.kt Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.39.2
Show newest version
package maestro.orchestra.yaml

import com.fasterxml.jackson.annotation.JsonFormat
import maestro.ScrollDirection
import maestro.orchestra.ScrollUntilVisibleCommand

data class YamlScrollUntilVisible(
    @JsonFormat(with = [JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_PROPERTIES])
    val direction: ScrollDirection = ScrollDirection.DOWN,
    val element: YamlElementSelectorUnion,
    val timeout: Long = ScrollUntilVisibleCommand.DEFAULT_TIMEOUT_IN_MILLIS,
    val speed: Int = ScrollUntilVisibleCommand.DEFAULT_SCROLL_DURATION,
    val visibilityPercentage: Int = ScrollUntilVisibleCommand.DEFAULT_ELEMENT_VISIBILITY_PERCENTAGE,
    val centerElement: Boolean = ScrollUntilVisibleCommand.DEFAULT_CENTER_ELEMENT,
    val label: String? = null
) {
    fun speedToDuration(): Long {
        return (1000 * (100 - speed).toDouble() / 100).toLong() + 1
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy