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

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

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

import org.hamcrest.Matcher;

import static net.serenitybdd.screenplay.GivenWhenThen.seeThat;

/**
 * An InteractiveConsequence is a convenience class designed to make it easier to write consequences that need to be
 * preceded by actions, for example when performing a number of soft assertions on a page.
 */
public class InteractiveConsequence {

        private Performable[] actions;

        public InteractiveConsequence(Performable[] actions) {
            this.actions = actions;
        }

        public static InteractiveConsequence attemptTo(Performable... actions) {
            return new InteractiveConsequence(actions);
        }

        public  Consequence thenCheckThat(Question actual, Matcher expected) {
            return seeThat(actual, expected).after(actions);
        }
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy