protected void assertCss(WebElement element, String... cssClasses) {
        String elementClass = element.getDomAttribute("class");
        if (elementClass == null) {
            Assertions.fail("Element did not have CSS 'class' attribute.");
            return;
        }

        String[] elementClasses = elementClass.split(" ");

        for (String expectedClass : cssClasses) {
            for (String expected : expectedClass.split(" ")) {
                boolean found = false;
                for (String actual : elementClasses) {
                    if (actual.equalsIgnoreCase(expected)) {
                        found = true;
                        break;
                    }
                }

                if (!found) {
                    Assertions.fail("Element expected CSS class '" + expected + "' but was not found in '" + elementClass + "'.");
                    break;
                }
            }
        }

        // success
    }
Checks a WebElement if it has a CSS class or classes. If more than one is listed then ALL must be found on the element.

@param element the element to check
@param cssClasses the CSS class or classes to look for
primefaces-selenium/primefaces-selenium-core/src/main/java/org/primefaces/selenium/AbstractPrimePageTest.java