net.serenitybdd.screenplay.matchers.statematchers.isClickableMatcher Maven / Gradle / Ivy
package net.serenitybdd.screenplay.matchers.statematchers;
import net.serenitybdd.core.pages.WebElementState;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
public class isClickableMatcher extends TypeSafeMatcher {
@Override
protected boolean matchesSafely(T element) {
return element.isClickable();
}
@Override
public void describeTo(Description description) {
description.appendText("an element that is clickable");
}
@Override
protected void describeMismatchSafely(T item, Description mismatchDescription) {
mismatchDescription.appendText(WebElementStateDescription.forElement(item)).appendText(" was not clickable");
}
}