protected void assertText(WebElement element, String text) {
        String actual = normalizeSpace(element.getText()).trim();
        String expected = normalizeSpace(text).trim();
        Assertions.assertEquals(expected, actual);
    }
Asserts text of a web element and cleanses it of whitespace issues due to different WebDriver results.

@param element the element to check its text
@param text the text expected in the element
primefaces-selenium/primefaces-selenium-core/src/main/java/org/primefaces/selenium/AbstractPrimePageTest.java