firstPane.assertText("First tab content");
}
private void verifyStyles(TabbedPaneInspector tabbedPane, int selectedTabIndex) {
TabSetInspector tabSet = tabbedPane.tabSet();
ElementInspector firstTab = tabSet.tabs().get(0);
ElementInspector secondTab = tabSet.tabs().get(1);
ElementInspector firstPane = tabbedPane.contentPanes().get(0);
ElementInspector secondPane = tabbedPane.contentPanes().get(1);
String emptySpacePath_0 = "tbody[0]/tr[0]/td[0]";
String emptySpacePath_1 = "tbody[0]/tr[0]/td[2]";
String emptySpacePath_2 = "tbody[0]/tr[0]/td[4]";
String containerPath = "tbody[0]/tr[0]/td[0]";
// frontBorderStyle="2px solid orange"
if (selectedTabIndex == 0) {
firstTab.assertStyle("border-right: 2px solid orange; border-top: 2px solid orange");
secondTab.assertStyle("border-bottom: 2px solid orange");
} else if (selectedTabIndex == 1) {
secondTab.assertStyle("border-right: 2px solid orange; border-top: 2px solid orange");
firstTab.assertStyle("border-bottom: 2px solid orange");
}
firstPane.parentNode().assertStyle("border-right: 2px solid orange; border-bottom: 2px solid orange");
tabSet.subElement(emptySpacePath_0).assertStyle("border-bottom: 2px solid orange");
tabSet.subElement(emptySpacePath_1).assertStyle("border-bottom: 2px solid orange");
tabSet.subElement(emptySpacePath_2).assertStyle("border-bottom: 2px solid orange");
// backBorderStyle="3px dashed magenta"
if (selectedTabIndex == 0) {
secondTab.assertStyle("border-top: 3px dashed magenta; border-right: 3px dashed magenta");
} else if (selectedTabIndex == 1) {
firstTab.assertStyle("border-top: 3px dashed magenta; border-right: 3px dashed magenta");
}
// tabGapWidth="15"
tabSet.subElement(emptySpacePath_0).assertWidth(15, 0);
tabSet.subElement(emptySpacePath_1).assertWidth(15, 0);
// containerStyle="background: gray; text-decoration: underline; color: red;"
if (selectedTabIndex == 0) {
firstPane.subElement(containerPath).assertStyle("background: gray; text-decoration: underline; color: red");
} else if (selectedTabIndex == 1) {
secondPane.subElement(containerPath).assertStyle("background: gray; text-decoration: underline; color: red");
}
// selectedTabStyle="background: DarkGreen; font-weight: bold; color: white;"
if (selectedTabIndex == 0) {
firstTab.assertStyle("background: DarkGreen; font-weight: bold; color: white");
} else if (selectedTabIndex == 1) {
secondTab.assertStyle("background: DarkGreen; font-weight: bold; color: white");
}
// tabEmptySpaceStyle="background: LightBlue;"
tabSet.subElement(emptySpacePath_0).assertStyle("background: LightBlue");
tabSet.subElement(emptySpacePath_1).assertStyle("background: LightBlue");
tabSet.subElement(emptySpacePath_2).assertStyle("background: LightBlue");
// tabStyle="color: red;"
if (selectedTabIndex == 0) {
secondTab.assertStyle("color: red");
} else if (selectedTabIndex == 1) {
firstTab.assertStyle("color: red");
}
// rolloverContainerStyle="background: red; font-weight: bold; color: gray;"
if (selectedTabIndex == 0) {
firstPane.mouseOver();
firstPane.subElement(containerPath).assertStyle("background: red; font-weight: bold; color: gray");
} else if (selectedTabIndex == 1) {
secondPane.mouseOver();
secondPane.subElement(containerPath).assertStyle("background: red; font-weight: bold; color: gray");
}
// rolloverStyle="border: 2px dashed brown;"
tabbedPane.assertStyle("border: 2px dashed brown");
if (selectedTabIndex == 0)
firstPane.mouseOut();
else if (selectedTabIndex == 1)
secondPane.mouseOut();
//todo: uncomment if JSFC-2996 is in 'fixed' state
//rolloverSelectedTabStyle="background: pink;"
/*
if (selectedTabIndex == 0) {