net.serenitybdd.screenplay.actions.UploadToWebElement Maven / Gradle / Ivy
package net.serenitybdd.screenplay.actions;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.annotations.Step;
import org.openqa.selenium.WebElement;
import java.nio.file.Path;
public class UploadToWebElement extends UploadToField {
private final WebElement uploadField;
public UploadToWebElement(Path inputFile, WebElement uploadField) {
super(inputFile);
this.uploadField = uploadField;
}
@Override
@Step("Upload file at #inputFile to #uploadField")
public void performAs(T actor) {
uploadFile(actor).to(uploadField);
}
}