// 4) Make sure tooltip is currently hidden (style contains 'display: none')
String hiddenStyle = tooltip1.getStyleAttribute();
assertTrue("Tooltip not hidden as expected: ["+hiddenStyle+"]",
hiddenStyle.contains("display:none") || hiddenStyle.contains("display: none"));
// 5) Lookup backing bean and current tooltip counter
ToolTipData toolTipData = (ToolTipData)server.getManagedBeanValue("#{toolTipData}");
assertNotNull("Couldn't find ToolTipData managed bean",toolTipData);
int startVal = toolTipData.getTooltipCounterWithoutMod();
// 6) Move mouse over div to make tooltip display
// Yes, all three of these are required.
parentDiv.mouseOver();
parentDiv.mouseMove();
parentSubDiv.mouseOver();
parentSubDiv.click();
// 0.5 delay on tooltip - so wait a sec
Thread.sleep(1000);
// 7) Make sure tooltip is currently visible (style does not contain 'display: none')
String visibleStyle = tooltip1.getStyleAttribute();
assertFalse("Tooltip not visible as expected: ["+visibleStyle+"]",
visibleStyle.contains("display:none") || visibleStyle.contains("display: none"));
// 8) Our tooltip counter should have increased by 1
toolTipData = (ToolTipData)server.getManagedBeanValue("#{toolTipData}");
int endVal = toolTipData.getTooltipCounterWithoutMod();
assertEquals("toolTipCounter did not increment as expected",startVal+1,endVal);
}