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

net.serenitybdd.screenplay.actions.Drag Maven / Gradle / Ivy

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

import net.serenitybdd.screenplay.targets.Target;
import org.openqa.selenium.By;

/**
 * Selenium drag-and-drop interaction, e.g.
 * actor.attemptsTo(Drag.from("#draggable").to("#droppable"));
 */
public class Drag {

    public static DragInteraction from(Target from) {
        return new DragInteraction(from);
    }

    public static DragInteraction from(By byLocator) {
        Target from = Target.the(byLocator.toString()).located(byLocator);
        return new DragInteraction(from);
    }

    public static DragInteraction from(String xpathOrCssLocator) {
        Target from = Target.the(xpathOrCssLocator).locatedBy(xpathOrCssLocator);
        return new DragInteraction(from);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy