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

net.serenitybdd.screenplay.ensure.SoftlyEnsure.kt Maven / Gradle / Ivy

There is a newer version: 4.2.12
Show newest version
@file:JvmName("SoftlyEnsure")

package net.serenitybdd.screenplay.ensure

import net.serenitybdd.markers.IsSilent
import net.serenitybdd.screenplay.Actor
import net.serenitybdd.screenplay.Performable

/**
 * Start recording failed Ensure statements as soft assertions
 */
fun start(): Performable = StartSoftAssertions()

/**
 * Throw any cumulated soft assertions in an AssertionError
 */
fun finish(): Performable = FinishSoftAssertions()

class StartSoftAssertions : Performable, IsSilent {
    override fun  performAs(actor: T) {
        BlackBox.startSoftAssertions()
    }
}

class FinishSoftAssertions : Performable, IsSilent {
    override fun  performAs(actor: T) {
        BlackBox.reportAnySoftAssertions()
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy