Author: ppitonak(a)redhat.com
Date: 2011-10-14 12:30:17 -0400 (Fri, 14 Oct 2011)
New Revision: 22809
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java
Log:
two tests marked to be fixed in 4.Future
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java 2011-10-14
15:17:35 UTC (rev 22808)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java 2011-10-14
16:30:17 UTC (rev 22809)
@@ -41,83 +41,82 @@
* @version $Revision$
*/
public class TestRichTabPanelAddPanel1 extends AbstractMetamerTest {
-
+
private static final String SWITCH_TYPE_CLIENT = "client";
private static final String SWITCH_TYPE_SERVER = "server";
private static final String SWITCH_TYPE_AJAX = "ajax";
-
+
private static final int MAX_NEW_TAB_COUNT = 3;
private static final int STATIC_TAB_COUNT = 5;
-
+
private JQueryLocator itemContentsFormat = pjq("div[id$=tab{0}:content]");
-
+
private JQueryLocator inactiveHeadersFormat =
pjq("td[id$=tab{0}:header:inactive]");
-
+
private JQueryLocator hCreateTabBtn = pjq("input[id$=hCreateTabButton]");
private JQueryLocator a4jCreateTabBtn =
pjq("input[id$=a4jCreateTabButton]");
-
+
private JQueryLocator tabsCount = pjq("table.rf-tab-hdr-tabs
td.rf-tab-hdr-inact");
-
+
private JQueryLocator switchTypeFormat =
pjq("input[name$=switchTypeInput][value={0}]");
-
+
private JQueryLocator tabCloseFormat = pjq("td[id$=tab{0}:header:inactive]
span.rf-tab-lbl > a");
-
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath,
"faces/components/richTabPanel/addTab2.xhtml");
}
-
+
/**
* Simple create new tab (without tab switch)
+ *
* @param addTabBtn
*/
private void verifyCreateTab(JQueryLocator addTabBtn) {
-
+
int baseTabsCount = selenium.getCount(tabsCount);
-
+
// add 3 new tabs
for (int i = 1; i <= MAX_NEW_TAB_COUNT; ++i) {
selenium.click(addTabBtn);
waitGui.until(countEquals.count(baseTabsCount + i).locator(tabsCount));
}
}
-
+
/**
- * Simple test to tab delete. Create 3 new tabs and then delete them.
- * Without tab switch.
+ * Simple test to tab delete. Create 3 new tabs and then delete them. Without tab
switch.
*/
private void verifyDeleteTab() {
verifyCreateTab(a4jCreateTabBtn);
-
+
int baseTabsCount = selenium.getCount(tabsCount);
System.out.println(baseTabsCount);
for (int i = 0; i < MAX_NEW_TAB_COUNT; ++i) {
- waitGui.until(elementPresent.locator(inactiveHeadersFormat.format(
- STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - i)));
+ waitGui
+
.until(elementPresent.locator(inactiveHeadersFormat.format(STATIC_TAB_COUNT +
MAX_NEW_TAB_COUNT - i)));
selenium.fireEvent(tabCloseFormat.format(STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT
- i), Event.CLICK);
System.out.println(selenium.getCount(tabsCount));
waitGui.until(countEquals.count(baseTabsCount - 1 - i).locator(tabsCount));
}
}
-
+
private void verifyContentOfNewTab(JQueryLocator addTabBtn) {
-
+
verifyCreateTab(addTabBtn);
-
- // tab switch work at least with "client" option
+
+ // tab switch work at least with "client" option
selenium.click(switchTypeFormat.format(SWITCH_TYPE_CLIENT));
-
+
System.out.println("testSwitchTypeAjax: tab count: " +
selenium.getCount(tabsCount));
-
+
for (int i = STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - 1; i >= STATIC_TAB_COUNT;
i--) {
selenium.click(inactiveHeadersFormat.format(i + 1));
- waitGui.failWith("Tab " + (i + 1) + " doesn't display
correct content.")
- .until(textEquals.text("Content of dynamicaly created tab" + (i
+ 1))
+ waitGui.failWith("Tab " + (i + 1) + " doesn't display
correct content.").until(
+ textEquals.text("Content of dynamicaly created tab" + (i + 1))
.locator(itemContentsFormat.format(i + 1)));
}
}
-
-
+
/**
* Create new tab by clicking on h:commandButton
*/
@@ -125,7 +124,7 @@
public void testCreateTabJSF() {
verifyCreateTab(hCreateTabBtn);
}
-
+
/**
* Create new tab by clicking on a4j:commandButton
*/
@@ -133,7 +132,7 @@
public void testCreateTabAjax() {
verifyCreateTab(a4jCreateTabBtn);
}
-
+
/**
* Delete newly created tabs
*/
@@ -141,7 +140,7 @@
public void testRemoveTab() {
verifyDeleteTab();
}
-
+
/**
* Verify that all tabs displays correct content when switch tab
*/
@@ -149,34 +148,31 @@
public void testContentOfDynamicTab() {
verifyContentOfNewTab(hCreateTabBtn);
}
-
- /*
- * Test plan:
- * 1. click on 'create tab' btn 3 time and verify that new tabs appeared
- * 2. verify that switch between newly created tabs still works as in previous tabs
(staticaly created)
- * 3. verify a4j ajax btn to create new tabs
+
+ /**
+ * Test plan: 1. click on 'create tab' btn 3 time and verify that new tabs
appeared 2. verify that switch between
+ * newly created tabs still works as in previous tabs (staticaly created) 3. verify
a4j ajax btn to create new tabs
*/
-
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-11081")
public void testSwitchTypeNull() {
-
+
verifyCreateTab(hCreateTabBtn);
-
+
for (int i = STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - 1; i >= STATIC_TAB_COUNT;
i--) {
final int index = i;
guardXhr(selenium).click(inactiveHeadersFormat.format(index + 1));
- waitGui.failWith("Tab " + (index + 1) + " is not
displayed.")
- .until(isDisplayed.locator(itemContentsFormat.format(index + 1)));
+ waitGui.failWith("Tab " + (index + 1) + " is not
displayed.").until(
+ isDisplayed.locator(itemContentsFormat.format(index + 1)));
}
}
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-11081")
public void testSwitchTypeAjax() {
-
+
verifyCreateTab(hCreateTabBtn);
-
+
selenium.click(switchTypeFormat.format(SWITCH_TYPE_AJAX));
selenium.waitForPageToLoad();
@@ -185,34 +181,34 @@
@Test
public void testSwitchTypeClient() {
-
+
verifyCreateTab(hCreateTabBtn);
-
+
selenium.click(switchTypeFormat.format(SWITCH_TYPE_CLIENT));
selenium.waitForPageToLoad();
-
+
for (int i = STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - 1; i >= STATIC_TAB_COUNT;
i--) {
final int index = i;
guardNoRequest(selenium).click(inactiveHeadersFormat.format(index + 1));
- waitGui.failWith("Tab " + (index + 1) + " is not
displayed.")
- .until(isDisplayed.locator(itemContentsFormat.format(index + 1)));
+ waitGui.failWith("Tab " + (index + 1) + " is not
displayed.").until(
+ isDisplayed.locator(itemContentsFormat.format(index + 1)));
}
}
-
+
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11054")
public void testSwitchTypeServer() {
-
+
verifyCreateTab(hCreateTabBtn);
-
+
selenium.click(switchTypeFormat.format(SWITCH_TYPE_SERVER));
selenium.waitForPageToLoad();
-
+
for (int i = STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - 1; i >= STATIC_TAB_COUNT;
i--) {
final int index = i;
guardHttp(selenium).click(inactiveHeadersFormat.format(index + 1));
- waitGui.failWith("Tab " + (index + 1) + " is not
displayed.")
- .until(isDisplayed.locator(itemContentsFormat.format(index + 1)));
+ waitGui.failWith("Tab " + (index + 1) + " is not
displayed.").until(
+ isDisplayed.locator(itemContentsFormat.format(index + 1)));
}
}
Show replies by date