
net.serenitybdd.screenplay.Task Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of serenity-screenplay Show documentation
Show all versions of serenity-screenplay Show documentation
Support for the User Journey pattern in Serenity
package net.serenitybdd.screenplay;
import net.serenitybdd.core.steps.Instrumented;
import java.util.Arrays;
import java.util.function.Consumer;
/**
* A marker class to indicate that a Performable represents a higher level business task,
* rather than a system interaction.
*/
public interface Task extends Performable {
static AnonymousTask where(T... steps) {
return Instrumented.instanceOf(AnonymousTask.class).withProperties(HumanReadableTaskName.forCurrentMethod(), Arrays.asList(steps));
}
static TaskBuilder called(String title) { return new TaskBuilder(title); }
/**
* Create a new Performable Task made up of a list of Performables.
*/
static AnonymousTask where(String title, T... steps) {
return Instrumented.instanceOf(AnonymousTask.class).withProperties(title, Arrays.asList(steps));
}
static AnonymousPerformableFunction where(Consumer performableOperation) {
return Instrumented.instanceOf(AnonymousPerformableFunction.class).withProperties(HumanReadableTaskName.forCurrentMethod(),
performableOperation);
}
static AnonymousPerformableFunction where(String title, Consumer performableOperation) {
return Instrumented.instanceOf(AnonymousPerformableFunction.class).withProperties(title, performableOperation);
}
static AnonymousPerformableRunnable thatPerforms(Runnable performableOperation) {
return Instrumented.instanceOf(AnonymousPerformableRunnable.class).withProperties(HumanReadableTaskName.forCurrentMethod(), performableOperation);
}
static AnonymousPerformableRunnable thatPerforms(String title, Runnable performableOperation) {
return Instrumented.instanceOf(AnonymousPerformableRunnable.class).withProperties(title, performableOperation);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy