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

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

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

import net.serenitybdd.model.collect.NewList;
import net.serenitybdd.core.pages.WebElementFacade;
import net.serenitybdd.screenplay.Interaction;
import net.serenitybdd.screenplay.targets.Target;
import org.openqa.selenium.By;

import static net.serenitybdd.screenplay.Tasks.instrumented;

/**
 * If this element is a form entry element, this will reset its value.
 */
public class Clear {

    public static Interaction field(String cssOrXpathForElement) {
        return instrumented(ClearTarget.class, Target.the(cssOrXpathForElement).locatedBy(cssOrXpathForElement));
    }

    public static Interaction field(Target target) {
        return instrumented(ClearTarget.class,target);
    }

    public static Interaction field(WebElementFacade element) {
        return instrumented(ClearElement.class, element);
    }

    public static Interaction field(By... locators) {
        return instrumented(ClearBy.class, NewList.of(locators));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy