Custom condition


You can easily add custom conditions by extending class com.codeborne.selenide.Condition.

For example:

public static Condition css(final String propName, final String propValue) {
    @Override
    public boolean apply(WebElement element) {
      return propValue.equalsIgnoreCase(element.getCssValue(propName));
    }

    @Override
    public String actualValue(WebElement element) {
        return element.getCssValue(propName);
    }
};

// Example usage:
$("h1").shouldHave(css("font-size", "16px"));