java.lang.Object
net.serenitybdd.screenplay.playwright.interactions.Drag

public class Drag extends Object
Drag an element to another element (drag and drop).

Sample usage:

     actor.attemptsTo(
         Drag.from("#source").to("#target"),
         Drag.from(SOURCE_ELEMENT).to(TARGET_ELEMENT)
     );

     // Alternative fluent API using the/onto aliases
     actor.attemptsTo(
         Drag.the("#source").onto("#target"),
         Drag.the(SOURCE_ELEMENT).onto(TARGET_ELEMENT)
     );
 
  • Method Summary

    Modifier and Type
    Method
    Description
    static Drag
    from(String selector)
    Start a drag operation from the specified selector.
    static Drag
    from(Target source)
    Start a drag operation from the specified Target.
    net.serenitybdd.screenplay.Performable
    onto(String selector)
    Complete the drag operation by dropping onto the specified selector.
    net.serenitybdd.screenplay.Performable
    onto(Target destination)
    Complete the drag operation by dropping onto the specified Target.
    static Drag
    the(String selector)
    Start a drag operation from the specified selector.
    static Drag
    the(Target source)
    Start a drag operation from the specified Target.
    net.serenitybdd.screenplay.Performable
    to(String selector)
    Complete the drag operation by dropping onto the specified selector.
    net.serenitybdd.screenplay.Performable
    to(Target destination)
    Complete the drag operation by dropping onto the specified Target.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • from

      public static Drag from(String selector)
      Start a drag operation from the specified selector.
    • from

      public static Drag from(Target source)
      Start a drag operation from the specified Target.
    • the

      public static Drag the(String selector)
      Start a drag operation from the specified selector. Alias for from(String) providing alternative fluent API.
    • the

      public static Drag the(Target source)
      Start a drag operation from the specified Target. Alias for from(Target) providing alternative fluent API.
    • to

      public net.serenitybdd.screenplay.Performable to(String selector)
      Complete the drag operation by dropping onto the specified selector.
    • to

      public net.serenitybdd.screenplay.Performable to(Target destination)
      Complete the drag operation by dropping onto the specified Target.
    • onto

      public net.serenitybdd.screenplay.Performable onto(String selector)
      Complete the drag operation by dropping onto the specified selector. Alias for to(String) providing alternative fluent API.
    • onto

      public net.serenitybdd.screenplay.Performable onto(Target destination)
      Complete the drag operation by dropping onto the specified Target. Alias for to(Target) providing alternative fluent API.