Skip to content

LukynkaCZE/Astral

Repository files navigation

Astral

You can use the addStep function to add automatic steps which should be performed. Asserts can also be added as steps.

  • addStep creates a step that runs a method. Completes successfully if no exceptions are caught.
  • addRepeatStep TODO creates a step that runs a method a specified amount of times. Completes successfully if no exceptions are caught.
  • addWaitStep TODO adds a step that waits a specified amount of time before continuing to the next step.
  • addAssert creates a step that fails if the specified value does not return true.
  • addWaitUntil adds a step that attempts to run until a condition becomes true, or fails when it times out.

Example

addStep("Create user") {
    user = User("Maya", 22)
}

addStep("Fetch country") {
    user.fetchCountryFromIPAddress().thenAccept { country ->
        userCountry = country
    }
}

addWaitUntil("Wait until country is fetched", timeout = 10.seconds) { 
    userCountry != null 
}

addAssert("Country is Czech Republic") { userCountry == "Czech Republic" }

image

Installation

Kotlin DSL

repositories {
    maven {
        name = "devOS"
        url = uri("https://mvn.devos.one/releases")
    }
}

dependencies {
    implementation("cz.lukynka:astral:0.7")
}

About

Step-based kotlin testing framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages