java.lang.Object
net.serenitybdd.screenplay.InParallel

public class InParallel extends Object
Run a series of Performable tasks in parallel with different actors
  • Method Details

    • theActors

      public static InParallel theActors(Actor... actors)
      Perform the specified tasks in parallel. For example:
           
               InParallel.theActors(johny, gina, jimmy).perform(
                       () -> johnny.attemptsTo(BookFlight.from("New York).to("London")),
                       () -> gina.attemptsTo(BookFlight.from("New York).to("Los Angeles")),
                       () -> jimmy.attemptsTo(BookFlight.from("Sydney).to("Hong Kong")),
               );
           
       
    • theActors

      public static InParallel theActors(Collection<Actor> actors)
      Useful if you have a collection or cast of actors.
    • perform

      public void perform(List<Runnable> tasks)
    • perform

      public void perform(Runnable... tasks)
    • perform

      public void perform(String stepName, Runnable... tasks)
    • eachAttemptTo

      public void eachAttemptTo(Performable... tasks)
      Have several actors perform a given task in parallel, for example:
           
           InParallel.theActors(johny, gina, jimmy).eachAttemptTo(BookFlight.from("New York).to("London"));
           
       
    • eachAttemptTo

      public void eachAttemptTo(Collection<Performable> tasks)