
net.serenitybdd.screenplay.questions.ConsequenceGroup 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.questions;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.BaseConsequence;
import net.serenitybdd.screenplay.Question;
import net.serenitybdd.screenplay.QuestionSubject;
public class ConsequenceGroup extends BaseConsequence {
private final Question> questionGroup;
private final String subject;
public ConsequenceGroup(Question> questionGroup) {
this.questionGroup = questionGroup;
this.subject = QuestionSubject.fromClass(questionGroup.getClass()).andQuestion(questionGroup).subject();
}
@Override
public void evaluateFor(Actor actor) {
performSetupActionsAs(actor);
questionGroup.answeredBy(actor);
}
@Override
public String toString() {
String template = explanation.orElse("Then %s");
return addRecordedInputValuesTo(String.format(template, subjectText.orElse(subject)));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy