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

me.saro.selenium.model.ChromeVersionDetails.kt Maven / Gradle / Ivy

There is a newer version: 4.26.0.0
Show newest version
package me.saro.selenium.model

import com.fasterxml.jackson.module.kotlin.jsonMapper
import me.saro.selenium.model.AppProps.Companion.chromeDownloadUri
import me.saro.selenium.model.AppProps.Companion.chromeVersion
import java.net.URI

class ChromeVersionDetails(
    private val platform: String
) {
    val revision: Int
    val chromeDriverUri: String
    val chromeUri: String

    init {
        val milestone = jsonMapper().readTree(URI(chromeDownloadUri).toURL()).at("/milestones/$chromeVersion")
        revision = milestone.path("revision").asInt()
        chromeDriverUri = milestone.at("/downloads/chromedriver").first { it.path("platform").asText() == platform }.path("url").asText()
        chromeUri = milestone.at("/downloads/chrome").first { it.path("platform").asText() == platform }.path("url").asText()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy