code: public static ExpectedCondition<Boolean> attributeContains(final WebElement element,
                                                               final String attribute,
                                                               final String value) {
      return new ExpectedCondition<Boolean>() {
        private String currentValue = null;
  
        @Override
        public Boolean apply(WebDriver driver) {
          return getAttributeOrCssValue(element, attribute)
              .map(seen -> seen.contains(value))
              .orElse(false);
        }
  
        @Override
        public String toString() {
          return String.format("value to contain \"%s\". Current value: \"%s\"", value, currentValue);
        }
      };
    }
docs: An expectation for checking WebElement with given locator has attribute which contains specific
  value
  
  @param element   used to check its parameters
  @param attribute used to define css or html attribute
  @param value     used as expected attribute value
  @return Boolean true when element has css or html attribute which contains the value