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

net.serenitybdd.screenplay.conditions.Check Maven / Gradle / Ivy

There is a newer version: 4.2.9
Show newest version
package net.serenitybdd.screenplay.conditions;

import net.serenitybdd.screenplay.Question;
import org.hamcrest.Matcher;

public class Check {
    public static ConditionalPerformable whether(Boolean condition) {
        return new ConditionalPerformableOnBoolean(condition);
    }

    public static ConditionalPerformable whether(Question condition) {
        return new ConditionalPerformableOnQuestion(condition);
    }

    public static  ConditionalPerformable whether(Question question, Matcher matcher) {
        Question condition = actor -> matcher.matches(question.answeredBy(actor));

        return new ConditionalPerformableOnQuestion(condition);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy