Driver.getPageSource() is a bad way to verify text present. Suppose you say, driver.getPageSource().contains("input");
That doesn't verify "input" is present on the screen, only that "input" is present in the html, like an input tag.
I usually verify text on an element by using xpath:
boolean textFound = false;
try {
driver.findElement(By.xpath("//*[contains(text(),'someText')]"));
textFound = true;
} catch (Exception e) {
textFound = false;
}
If you want an exact text match, just remove the contains function:
driver.findElement(By.xpath("//*[text()='someText']));