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

com.redhat.darcy.ui.matchers.ElementText Maven / Gradle / Ivy

Go to download

Framework for writing page objects to automate interaction with graphical user interfaces.

The newest version!
package com.redhat.darcy.ui.matchers;



import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;

import com.redhat.darcy.ui.api.elements.Text;

public class ElementText extends TypeSafeMatcher {
    
    private final Matcher matcher;
    
    public ElementText(Matcher matcher) {
        this.matcher = matcher;
    }
    
    @Override
    public void describeTo(Description description) {
        description.appendText("an Element whose text is");
        matcher.describeTo(description);
    }
    
     @Override
    protected boolean matchesSafely(T element) {
        return element.isPresent() && matcher.matches(element.getText());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy