code: public static ExpectedCondition<Boolean> textToBePresentInElementValue(final WebElement element,
                                                                           final String text) {
  
      return new ExpectedCondition<Boolean>() {
        @Override
        public Boolean apply(WebDriver driver) {
          try {
            String elementText = element.getAttribute("value");
            if (elementText != null) {
              return elementText.contains(text);
            }
            return false;
          } catch (StaleElementReferenceException e) {
            return null;
          }
        }
  
        @Override
        public String toString() {
          return String.format("text ('%s') to be the value of element %s", text, element);
        }
      };
    }
docs: An expectation for checking if the given text is present in the specified elements value
  attribute.
  
  @param element the WebElement
  @param text    to be present in the element's value attribute
  @return true once the element's value attribute contains the given text