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

net.serenitybdd.screenplay.AnonymousPerformableRunnable Maven / Gradle / Ivy

The newest version!
package net.serenitybdd.screenplay;

import net.serenitybdd.markers.CanBeSilent;
import net.serenitybdd.annotations.Step;

import java.util.HashMap;
import java.util.Map;

public class AnonymousPerformableRunnable implements Performable, CanBeSilent {
    private final String title;
    private final Map fieldValues = new HashMap();
    private final Runnable actions;
    private boolean isSilent = false;

    public AnonymousPerformableRunnable(String title, Runnable actions) {
        this.title = title;
        this.actions = actions;
    }

    @Override
    @Step("!#title")
    public  void performAs(T actor) {
        actions.run();
    }

    @Override
    public boolean isSilent() {
        return isSilent;
    }

    public AnonymousPerformableRunnable withNoReporting() {
        this.isSilent = true;
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy