Author: dsvyatobatsko
Date: 2008-07-18 07:12:38 -0400 (Fri, 18 Jul 2008)
New Revision: 9682
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxIncludeTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxListenerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLoadBundleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxMediaOutputTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPushTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRepeatTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxSupportTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ListShuttleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java
Log:
adapted all tests to the new fixture
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -29,8 +29,9 @@
import org.ajax4jsf.template.Template;
import org.openqa.selenium.server.SeleniumServer;
import org.testng.Assert;
+import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterSuite;
-import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
@@ -92,7 +93,7 @@
@BeforeSuite
public void startSeleniumServer() throws Exception {
- seleniumServer = new SeleniumServer();
+ seleniumServer = new SeleniumServer();
seleniumServer.start();
}
@@ -105,7 +106,7 @@
/**
* This method are invoked before selenium tests started
*/
- @BeforeTest
+ @BeforeClass
@Parameters({"browser", "filterPrefix"})
public void startSelenium(String browser, String filterPrefix) {
synchronized (MUTEX) {
@@ -125,7 +126,7 @@
/**
* This method are invoked after selenium tests completed
*/
- @AfterTest(alwaysRun=true)
+ @AfterClass(alwaysRun=true)
public void stopSelenium() {
synchronized (MUTEX) {
selenium.stop();
@@ -150,7 +151,7 @@
@AfterSuite
public void stopSeleniumServer() throws Exception {
- seleniumServer.stop();
+ seleniumServer.stop();
}
/**
@@ -163,7 +164,6 @@
}
private static final Object MUTEX = new Object();
-
/**
* Renders page
@@ -776,7 +776,7 @@
selenium.mouseUp(testElementId);
AssertTextEquals(testElementResultId, afterResult);
}
-
+
/**
* Checks whether client is FireFox
*
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -2,102 +2,66 @@
import org.ajax4jsf.bean.A4JActionParam;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxActionParameterTest extends SeleniumTestBase implements
- RichSeleniumTest {
+public class AjaxActionParameterTest extends SeleniumTestBase {
- public AjaxActionParameterTest() {
- super("http", "localhost", serverPort);
- }
+ /**
+ * Tests ajax action parameter component
+ *
+ * @param template
+ */
+ @Test
+ public void testAjaxActionParameterComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId();
+ String parameter = null;
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters( { "browser", "filterPrefix" })
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
+ String paramID = parentId + "_parameter";
+ String ajaxButttonID = parentId + "_form1:ajaxSubmit";
+ String htmlButttonID = parentId + "_form2:htmlSubmit";
- @BeforeMethod
- @Parameters( { "loadStyleStrategy", "loadScriptStrategy" })
- protected void loadConfiguration(String loadStyleStrategy,
- String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
+ // test ajax submit
+ clickById(ajaxButttonID);
+ waitForAjaxCompletion();
+ parameter = getTextById(paramID);
+ checkParameter(parameter);
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun = true)
- public void stopSelenium() {
- super.stopSelenium();
- }
+ // test html submit
+ clickCommandAndWait(htmlButttonID);
+ parameter = getTextById(paramID);
+ checkParameter(parameter);
+ }
- @Test
- public void testAjaxCommandLinkComponent() throws Exception {
- _testAjaxCommandLinkComponent(Template.SIMPLE);
- _testAjaxCommandLinkComponent(Template.DATA_TABLE);
- }
-
- /**
- * Tests ajax action parameter component
- * @param template
- */
- private void _testAjaxCommandLinkComponent(Template template) {
- renderPage(template);
- String parentId = getParentId();
- String parameter = null;
-
- String paramID = parentId + "_parameter";
- String ajaxButttonID = parentId + "_form1:ajaxSubmit";
- String htmlButttonID = parentId + "_form2:htmlSubmit";
-
- // test ajax submit
- clickById(ajaxButttonID);
- waitForAjaxCompletion();
- parameter = getTextById(paramID);
- checkParameter(parameter);
-
-
- // test html submit
- clickCommandAndWait(htmlButttonID);
- parameter = getTextById(paramID);
- checkParameter(parameter);
- }
-
- /**
- * Checks action parameter
- * @param parameter - Action Parameter value
- */
- private void checkParameter (String parameter) {
- if ("".equals(parameter)) {
- writeStatus("<a4j:actionParameter> failed. ActionListener skipped.",
true);
- Assert.fail("<a4j:actionParameter> failed. ActionListener skipped.");
- } else if (parameter.equals(A4JActionParam.ERRORS.NO_PARAM)) {
- writeStatus("<a4j:actionParameter> failed. Parameter has been not sent with
ajax request.", true);
- Assert.fail("<a4j:actionParameter> failed. Parameter has been not sent with
ajax request.");
- } else if (parameter.equals(A4JActionParam.ERRORS.NOT_ASSIGNED)) {
- writeStatus("<a4j:actionParameter> failed. Parameter value has been not
assigned to bean", true);
- Assert.fail("<a4j:actionParameter> failed. Parameter value has been not
assigned to bean");
- } else if (parameter.equals(A4JActionParam.ERRORS.INVALID_VALUE)) {
- writeStatus("<a4j:actionParameter> failed. Parameter value is
incorrect", true);
- Assert.fail("<a4j:actionParameter> failed. Parameter value is
incorrect");
- } else {
- writeStatus("<a4j:actionParameter> passed successfully");
- }
- }
+ /**
+ * Checks action parameter
+ *
+ * @param parameter -
+ * Action Parameter value
+ */
+ private void checkParameter(String parameter) {
+ if ("".equals(parameter)) {
+ writeStatus("<a4j:actionParameter> failed. ActionListener
skipped.", true);
+ Assert.fail("<a4j:actionParameter> failed. ActionListener
skipped.");
+ } else if (parameter.equals(A4JActionParam.ERRORS.NO_PARAM)) {
+ writeStatus("<a4j:actionParameter> failed. Parameter has been not
sent with ajax request.", true);
+ Assert.fail("<a4j:actionParameter> failed. Parameter has been not
sent with ajax request.");
+ } else if (parameter.equals(A4JActionParam.ERRORS.NOT_ASSIGNED)) {
+ writeStatus("<a4j:actionParameter> failed. Parameter value has
been not assigned to bean", true);
+ Assert.fail("<a4j:actionParameter> failed. Parameter value has
been not assigned to bean");
+ } else if (parameter.equals(A4JActionParam.ERRORS.INVALID_VALUE)) {
+ writeStatus("<a4j:actionParameter> failed. Parameter value is
incorrect", true);
+ Assert.fail("<a4j:actionParameter> failed. Parameter value is
incorrect");
+ } else {
+ writeStatus("<a4j:actionParameter> passed successfully");
+ }
+ }
- @Override
- public String getTestUrl() {
- return "pages/actionParam/actionParam.xhtml";
- }
+ @Override
+ public String getTestUrl() {
+ return "pages/actionParam/actionParam.xhtml";
+ }
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -8,7 +8,7 @@
public class AjaxCommandButtonTest extends SeleniumTestBase {
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxCommandButtonComponent(Template template) {
renderPage(template);
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,53 +1,15 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxCommandLinkTest extends SeleniumTestBase implements RichSeleniumTest {
+public class AjaxCommandLinkTest extends SeleniumTestBase {
- public AjaxCommandLinkTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testAjaxCommandLinkComponent() throws Exception {
- _testAjaxCommandLinkComponent(Template.SIMPLE);
- _testAjaxCommandLinkComponent(Template.DATA_TABLE);
- _testAjaxCommandLinkComponent(Template.MODAL_PANEL);
- }
-
- private void _testAjaxCommandLinkComponent(Template template) {
+ public void testAjaxCommandLinkComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,16 +1,11 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.ajax4jsf.template.TestConstants;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxFormTest extends SeleniumTestBase implements RichSeleniumTest {
+public class AjaxFormTest extends SeleniumTestBase {
private final static String TEST_URL =
"pages/ajaxForm/ajaxFormTest.xhtml";
@@ -43,24 +38,24 @@
private final static String RERENDER_ID = "rerender";
private final static String LINK_ID = "link";
-
+
@Test
- public void testAttrAjaxSubmit() throws Exception {
- renderPage(Template.SIMPLE);
-
+ public void testAttrAjaxSubmit(Template template) throws Exception {
+ renderPage(template);
+
//clickOnCheckbox(CHECK_ID_AJAXSUBMIT, BUTTON_ID);
test(BUTTON_ID, INNER_INPUT_ID,
STANDART_FORM.concat(":").concat(OUTER_INPUT_ID), TEST_FIELD_ID, true, null,
null, null, "testAttrAjaxSubmit");
}
-
+
@Test
- public void testAttrPrependId() {
- renderPage(Template.SIMPLE);
-
+ public void testAttrPrependId(Template template) {
+ renderPage(template);
+
if (!PREV_TEXT.equals(getValueById(getFullComponentId(INNER_INPUT_ID, "1"))))
{
assertFail(null, null, true, null, "testAttrPrependId");
}
}
-
+
/*@Test
public void testAttrIgnoreDupResponses() {
//TODO: will be implemented in future
@@ -70,42 +65,19 @@
public void testAttrTimeout() {
//TODO: will be implemented in future
}*/
-
+
@Test
- public void testProcessingLinks() {
- renderPage(Template.SIMPLE);
-
+ public void testProcessingLinks(Template template) {
+ renderPage(template);
+
clickOnCheckbox(CHECK_ID_RENDERED, BUTTON_ID, "2");
clickById(LINK_ID.concat("2"));
waitForAjaxCompletion();
if (!NEXT_TEXT.equals(getTextById(TEST_FIELD_ID.concat("2")))) {
assertFail(null, null, null, null, "testProcessingLinks");
}
-
}
-
- public AjaxFormTest() {
- super(TestConstants.PROTOCOL, TestConstants.HOST, serverPort);
- }
-
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
+
private String getFullComponentId(String componentId, String index) {
return FORM_ID.concat(index).concat(":").concat(componentId.concat(index));
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,128 +1,90 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
+public class AjaxHTMLCommandLinkTest extends SeleniumTestBase {
-public class AjaxHTMLCommandLinkTest extends SeleniumTestBase implements RichSeleniumTest
{
+ @Test
+ public void testAjaxHTMLCommandLinkComponent(Template template) {
+ renderPage(template);
- public AjaxHTMLCommandLinkTest() {
- super("http", "localhost", serverPort);
- }
+ String parentId = getParentId() + "_form:";
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
+ String linkId = parentId + "l1";
+ boolean immediate = false;
+ writeStatus("Click link 1");
+ setValidation(true);
+ clickById(linkId);
+ waitForAjaxCompletion();
+ waitForOnCompleteHndler();
+ checkButton(linkId, true, immediate, true, true, true);
- @Test
- public void testAjaxCommandLinkComponent() throws Exception {
- _testAjaxCommandLinkComponent(Template.SIMPLE);
- _testAjaxCommandLinkComponent(Template.DATA_TABLE);
- _testAjaxCommandLinkComponent(Template.MODAL_PANEL);
- }
+ linkId = parentId + "l2";
+ immediate = false;
+ writeStatus("Click link 2");
+ setValidation(false);
+ clickById(linkId);
+ waitForAjaxCompletion();
+ waitForOnCompleteHndler();
+ checkButton(linkId, false, immediate, false, false, false);
- private void _testAjaxCommandLinkComponent(Template template) {
- renderPage(template);
+ linkId = parentId + "l3";
+ immediate = true;
+ writeStatus("Click link 3");
+ setValidation(true);
+ clickById(linkId);
+ waitForAjaxCompletion();
+ waitForOnCompleteHndler();
+ checkButton(linkId, true, immediate, true, true, false);
- String parentId = getParentId() + "_form:";
+ linkId = parentId + "l4";
+ immediate = true;
+ writeStatus("Click link 4");
+ setValidation(false);
+ clickById(linkId);
+ waitForAjaxCompletion();
+ waitForOnCompleteHndler();
+ checkButton(linkId, true, immediate, true, true, false);
- String linkId = parentId + "l1";
- boolean immediate = false;
- writeStatus("Click link 1");
- setValidation(true);
- clickById(linkId);
- waitForAjaxCompletion();
- waitForOnCompleteHndler();
- checkButton(linkId, true, immediate, true, true, true);
-
- linkId = parentId + "l2";
- immediate = false;
- writeStatus("Click link 2");
- setValidation(false);
- clickById(linkId);
- waitForAjaxCompletion();
- waitForOnCompleteHndler();
- checkButton(linkId, false, immediate, false, false, false);
-
- linkId = parentId + "l3";
- immediate = true;
- writeStatus("Click link 3");
- setValidation(true);
- clickById(linkId);
- waitForAjaxCompletion();
- waitForOnCompleteHndler();
- checkButton(linkId, true, immediate, true, true, false);
-
- linkId = parentId + "l4";
- immediate = true;
- writeStatus("Click link 4");
- setValidation(false);
- clickById(linkId);
- waitForAjaxCompletion();
- waitForOnCompleteHndler();
- checkButton(linkId, true, immediate, true, true, false);
-
-
}
-
+
private void setValidation(boolean success) {
- StringBuffer buffer = new StringBuffer("setValidation(");
- buffer.append(success);
- buffer.append(");");
- runScript(buffer.toString());
+ StringBuffer buffer = new StringBuffer("setValidation(");
+ buffer.append(success);
+ buffer.append(");");
+ runScript(buffer.toString());
}
-
- private void waitForOnCompleteHndler () {
- waiteForCondition("_onCompleteHandler == true;", 3000);
- runScript("_onCompleteHandler = false;");
+
+ private void waitForOnCompleteHndler() {
+ waiteForCondition("_onCompleteHandler == true;", 3000);
+ runScript("_onCompleteHandler = false;");
}
-
- private void checkButton(String id, boolean testData, boolean immediate, boolean
testAction, boolean testFListener, boolean testInput) {
- writeStatus("Checking link...");
- StringBuffer buffer = new StringBuffer("checkLink('");
- buffer.append(id);
- buffer.append("',");
- buffer.append(testData);
- buffer.append(",");
- buffer.append(testAction);
- buffer.append(",");
- buffer.append(testFListener);
- buffer.append(",");
- buffer.append(testInput);
- buffer.append(");");
- String result = runScript(buffer.toString());
- if (result != null && result.length() > 0) {
- Assert.fail("<a4j:htmlCommandLink> [immediate="+immediate+"]
test failure caused by " + result);
- }
-
+
+ private void checkButton(String id, boolean testData, boolean immediate, boolean
testAction, boolean testFListener,
+ boolean testInput) {
+ writeStatus("Checking link...");
+ StringBuffer buffer = new StringBuffer("checkLink('");
+ buffer.append(id);
+ buffer.append("',");
+ buffer.append(testData);
+ buffer.append(",");
+ buffer.append(testAction);
+ buffer.append(",");
+ buffer.append(testFListener);
+ buffer.append(",");
+ buffer.append(testInput);
+ buffer.append(");");
+ String result = runScript(buffer.toString());
+ if (result != null && result.length() > 0) {
+ Assert.fail("<a4j:htmlCommandLink> [immediate=" + immediate +
"] test failure caused by " + result);
+ }
+
}
+ @Override
public String getTestUrl() {
return "pages/ajaxHTMLCommandLink/ajaxHTMLLinkTest.xhtml";
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxIncludeTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxIncludeTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxIncludeTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -46,8 +46,8 @@
public String getTestUrl() {
return "pages/ajaxInclude/ajaxIncludeTest.xhtml";
}
-
- @Test(dataProvider = "templates")
+
+ @Test
public void testAjaxInclude(Template template) throws Exception {
renderPage(template);
String include1Prefix = getParentId() + FORM2_ID + INCLUDE4_ID + ":";
@@ -71,7 +71,7 @@
}
- @Test(dataProvider = "templates")
+ @Test
public void testLayoutAttribute(Template template) throws Exception {
renderPage(template);
// inlude_1 has layout=inline(default)
@@ -108,7 +108,7 @@
clickReset();
}
- @Test(dataProvider = "templates")
+ @Test
public void testRenderedAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rendered attribute...");
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxListenerTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxListenerTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxListenerTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -6,7 +6,7 @@
public class AjaxListenerTest extends SeleniumTestBase {
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxListenerComponent(Template template) {
renderPage(template);
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLoadBundleTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLoadBundleTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLoadBundleTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -7,38 +7,43 @@
import org.testng.annotations.Test;
public class AjaxLoadBundleTest extends SeleniumTestBase {
- private static final String URL = "pages/loadBundle/loadBundle.xhtml";
- private static final String BUTTON_ID = "b1";
- private static final String SAMPLE_MESSAGE = "Error was occured.";
- private final static String FORM_ID = "form:";
- private final static String FIRST_LINK_ID = FORM_ID + "error";
- private final static String SECOND_LINK_ID = FORM_ID + "_link";
+ private static final String URL = "pages/loadBundle/loadBundle.xhtml";
- /**
- * @see org.richfaces.SeleniumTestBase#getTestUrl()
- */
- @Override
- public String getTestUrl() {
- return URL;
- }
+ private static final String BUTTON_ID = "b1";
- @Test(dataProvider = "templates")
- public void testAjaxMediaOutput(Template template) throws Exception {
- renderPage(template);
- writeStatus("Testing loadBundle component");
- String textId = getParentId() + FIRST_LINK_ID;
- AssertPresent(textId);
- AssertNotPresent(getParentId() + SECOND_LINK_ID);
- Assert.assertEquals(getTextById(textId), SAMPLE_MESSAGE);
- }
+ private static final String SAMPLE_MESSAGE = "Error was occured.";
- @Test(dataProvider = "templates")
- public void testAjaxReRender(Template template) throws Exception {
- renderPage(template);
- writeStatus("Testing loadBundle component after ajax rerender");
- String buttonId = getParentId() + FORM_ID + BUTTON_ID;
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertPresent(getParentId() + SECOND_LINK_ID);
- }
+ private final static String FORM_ID = "form:";
+
+ private final static String FIRST_LINK_ID = FORM_ID + "error";
+
+ private final static String SECOND_LINK_ID = FORM_ID + "_link";
+
+ /**
+ * @see org.richfaces.SeleniumTestBase#getTestUrl()
+ */
+ @Override
+ public String getTestUrl() {
+ return URL;
+ }
+
+ @Test
+ public void testAjaxLoadBundleComponent(Template template) throws Exception {
+ renderPage(template);
+ writeStatus("Testing loadBundle component");
+ String textId = getParentId() + FIRST_LINK_ID;
+ AssertPresent(textId);
+ AssertNotPresent(getParentId() + SECOND_LINK_ID);
+ Assert.assertEquals(getTextById(textId), SAMPLE_MESSAGE);
+ }
+
+ @Test
+ public void testAjaxReRender(Template template) throws Exception {
+ renderPage(template);
+ writeStatus("Testing loadBundle component after ajax rerender");
+ String buttonId = getParentId() + FORM_ID + BUTTON_ID;
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertPresent(getParentId() + SECOND_LINK_ID);
+ }
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -7,7 +7,7 @@
public class AjaxLogTest extends SeleniumTestBase {
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxLogLayout(Template template) {
renderPage(template);
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxMediaOutputTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxMediaOutputTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxMediaOutputTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -32,8 +32,8 @@
public String getTestUrl() {
return "pages/ajaxMediaOutput/ajaxMediaOutputTest.xhtml";
}
-
- @Test(dataProvider = "templates")
+
+ @Test
public void testAjaxMediaOutput(Template template) throws Exception {
renderPage(template);
writeStatus("Testing media output");
@@ -44,12 +44,9 @@
String tagName = runScript("getElementType('" + imageId
+"');");
Assert.assertEquals(tagName.toLowerCase(), "img");
-
-
-
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnclickEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 1;
@@ -57,7 +54,7 @@
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID +
"');");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnDblclickEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 2;
@@ -65,7 +62,7 @@
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID +
"');");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnmousedownEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 7;
@@ -73,7 +70,7 @@
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID +
"');");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnmousemoveEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 8;
@@ -81,7 +78,7 @@
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID +
"');");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnmouseoutEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 9;
@@ -89,15 +86,15 @@
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID +
"');");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnmouseoverEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 10;
super.testOnmouseoverEvent(imageId, imageId + EVENT_RESULT_ID,
EVENT_TEST_RESULT_FAILED_TEXT, EVENT_TEST_RESULT_PASSED_TEXT);
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID +
"');");
}
-
- @Test(dataProvider = "templates")
+
+ @Test
public void testOnmouseupEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 11;
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -47,7 +47,7 @@
return "pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml";
}
- @Test(dataProvider = "templates")
+ @Test
public void testLayoutAttribute(Template template) throws Exception {
renderPage(template);
// panel_1 has layout=inline(default)
@@ -84,7 +84,7 @@
clickReset();
}
- @Test(dataProvider = "templates")
+ @Test
public void testRenderedAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rendered attribute...");
@@ -104,7 +104,7 @@
clickReset();
}
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxRenderedAttribute(Template template) throws Exception {
renderPage(template);
// panel_1 has ajaxRendered=false and is reRender by b1
@@ -135,7 +135,7 @@
}
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxRenderedAttributeWithLimitToList(Template template) throws
Exception {
renderPage(template);
// panel_1 has ajaxRendered=false and is reRender by b1 with
@@ -165,7 +165,7 @@
clickReset();
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnDoubleClickEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -177,7 +177,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnKeyDownEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -189,7 +189,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnKeyPressEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -201,7 +201,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnKeyUpEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -213,7 +213,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnMouseDownEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -225,7 +225,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnMouseMoveEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -237,7 +237,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnMouseOutEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -249,7 +249,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnMouseOverEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -261,7 +261,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnMouseUpEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -273,7 +273,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnClickEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -4,56 +4,18 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
/**
* @author Andrey Markavstov
*
*/
-public class AjaxPollTest extends SeleniumTestBase implements RichSeleniumTest {
+public class AjaxPollTest extends SeleniumTestBase {
- public AjaxPollTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testAjaxPollComponent() {
- _testAjaxPollComponent(Template.SIMPLE);
- _testAjaxPollComponent(Template.DATA_TABLE);
- _testAjaxPollComponent(Template.MODAL_PANEL);
- }
-
- private void _testAjaxPollComponent(Template template) {
+ public void testAjaxPollComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
String pollId = parentId + "poll";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPushTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPushTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPushTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -7,7 +7,7 @@
public class AjaxPushTest extends SeleniumTestBase {
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxPushComponent(Template template) throws Exception {
renderPage(template);
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,51 +1,13 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxRegionTest extends SeleniumTestBase implements RichSeleniumTest {
+public class AjaxRegionTest extends SeleniumTestBase {
- public AjaxRegionTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testAjaxRegionComponent() throws Exception {
- _testAjaxRegionComponent(Template.SIMPLE);
- _testAjaxRegionComponent(Template.DATA_TABLE);
- _testAjaxRegionComponent(Template.MODAL_PANEL);
- }
-
- private void _testAjaxRegionComponent(Template template) {
+ public void testAjaxRegionComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRepeatTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRepeatTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRepeatTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -60,7 +60,7 @@
return "pages/ajaxRepeat/ajaxRepeatTest.xhtml";
}
- @Test(dataProvider = "templates")
+ @Test
public void testRerenderingRowsWithAjaxKeysAttribute(Template template) throws
Exception {
renderPage(template);
writeStatus("Testing rerendering rows with ajaxKeys attribute...");
@@ -98,7 +98,7 @@
}
}
- @Test(dataProvider = "templates")
+ @Test
public void testRerenderingRowsWithoutAjaxKeysAttribute(Template template) throws
Exception {
renderPage(template);
writeStatus("Testing rerendering rows without ajaxKeys attribute...");
@@ -125,7 +125,7 @@
}
}
- @Test(dataProvider = "templates")
+ @Test
public void testRerenderingRowsWithValidation(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rerendering rows with validation...");
@@ -159,7 +159,7 @@
}
}
- @Test(dataProvider = "templates")
+ @Test
public void testRenderedAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rendered attribute...");
@@ -181,7 +181,7 @@
assertRowsCount(0, TABLE_ID);
}
- @Test(dataProvider = "templates")
+ @Test
public void testFirstAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing first attribute...");
@@ -207,7 +207,7 @@
AssertPresent(fullInput1Id);
}
- @Test(dataProvider = "templates")
+ @Test
public void testRowsAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rows attribute...");
@@ -231,7 +231,7 @@
assertInputValue(2, INPUT_ID, "2");
}
- @Test(dataProvider = "templates")
+ @Test
public void testRowKeyVarAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rowKeyVar attribute...");
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,52 +1,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxStatusTest extends SeleniumTestBase implements RichSeleniumTest {
+public class AjaxStatusTest extends SeleniumTestBase {
- public AjaxStatusTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testAjaxStatusComponent() throws Exception {
- _testAjaxStatusComponent(Template.SIMPLE);
- _testAjaxStatusComponent(Template.DATA_TABLE);
- _testAjaxStatusComponent(Template.MODAL_PANEL);
- }
-
- private void _testAjaxStatusComponent(Template template) {
+ public void testAjaxStatusComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxSupportTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -5,108 +5,73 @@
import org.ajax4jsf.bean.A4JSupport;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
/**
* @author Andrey Markavstov
- *
+ *
*/
-public class AjaxSupportTest extends SeleniumTestBase implements
- RichSeleniumTest {
+public class AjaxSupportTest extends SeleniumTestBase {
- public AjaxSupportTest() {
- super("http", "localhost", serverPort);
- }
+ @Test
+ public void testAjaxSupportComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters( { "browser", "filterPrefix" })
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
+ String dataId = parentId + "data";
+ String linkId = parentId + "link";
+ String checkBoxId = parentId + "checkbox";
+ String command = parentId + "command";
- @BeforeMethod
- @Parameters( { "loadStyleStrategy", "loadScriptStrategy" })
- protected void loadConfiguration(String loadStyleStrategy,
- String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
+ clickById(linkId);
+ waitForAjaxCompletion();
+ String data = getTextById(dataId);
+ checkMessage(data, A4JSupport.Messages.FOR_LINK, "'onclick' ajax
support for link[id='_form:link'] failed.",
+ A4JSupport.Messages.FOR_LINK + " successful");
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun = true)
- public void stopSelenium() {
- super.stopSelenium();
- }
+ clickById(checkBoxId);
+ waitForAjaxCompletion();
+ data = getTextById(dataId);
+ checkMessage(data, A4JSupport.Messages.FOR_CHECKBOX,
+ "'onchange' ajax support for
checkbox[id='_form:checkbox'] failed.", A4JSupport.Messages.FOR_CHECKBOX
+ + " successful");
- @Test
- public void testAjaxSupportComponent() throws Exception {
- _testAjaxSupportComponent(Template.SIMPLE);
- _testAjaxSupportComponent(Template.DATA_TABLE);
- _testAjaxSupportComponent(Template.MODAL_PANEL);
- }
-
- private void _testAjaxSupportComponent(Template template) {
- renderPage(template);
- String parentId = getParentId() + "_form:";
-
- String dataId = parentId + "data";
- String linkId = parentId + "link";
- String checkBoxId = parentId + "checkbox";
- String command = parentId + "command";
-
- clickById(linkId);
- waitForAjaxCompletion();
- String data = getTextById(dataId);
- checkMessage(data, A4JSupport.Messages.FOR_LINK, "'onclick' ajax support
for link[id='_form:link'] failed.", A4JSupport.Messages.FOR_LINK + "
successful");
-
- clickById(checkBoxId);
- waitForAjaxCompletion();
- data = getTextById(dataId);
- checkMessage(data, A4JSupport.Messages.FOR_CHECKBOX, "'onchange' ajax
support for checkbox[id='_form:checkbox'] failed.",
A4JSupport.Messages.FOR_CHECKBOX+ " successful");
-
- clickById(command);
- pause(1000, command);
- if (!data.equals(getTextById(dataId))) {
- writeStatus("<a4j:support failed. 'requestDelay' attribute does not
work.");
- Assert.fail("<a4j:support failed. 'requestDelay' attribute does not
work.");
- }
- waitForAjaxCompletion();
- data = getTextById(dataId);
- checkMessage(data, A4JSupport.Messages.FOR_COMMAND, "'onclick' ajax
support for command link[id='_form:command'] failed.",
A4JSupport.Messages.FOR_COMMAND+ " successful");
-
- if (A4JSupport.Messages.FOR_SUBMIT.equals(data)) {
- writeStatus("<a4j:support failed. 'disableDefault' attribute does not
work");
- Assert.fail("<a4j:support failed. 'disableDefault' attribute does not
work.");
- }
-
-
- }
+ clickById(command);
+ pause(1000, command);
+ if (!data.equals(getTextById(dataId))) {
+ writeStatus("<a4j:support failed. 'requestDelay' attribute
does not work.");
+ Assert.fail("<a4j:support failed. 'requestDelay' attribute
does not work.");
+ }
+ waitForAjaxCompletion();
+ data = getTextById(dataId);
+ checkMessage(data, A4JSupport.Messages.FOR_COMMAND,
+ "'onclick' ajax support for command
link[id='_form:command'] failed.", A4JSupport.Messages.FOR_COMMAND
+ + " successful");
- private void checkMessage(String data, String message, String errorMessage, String
okMessage) {
- if (message.equals(data)) {
- writeStatus(okMessage);
- }else if (A4JSupport.Messages.NO_DATA.equals(data)) {
- writeStatus(errorMessage + " Caused by: action listener for <a4j:support>
skipped", true);
- Assert.fail(errorMessage + " Caused by: action listener for <a4j:support>
skipped");
- }else if ("".equals(data)) {
- writeStatus(errorMessage + "Caused by: no ajax request has been sent.",
true);
- Assert.fail(errorMessage + "Caused by: no ajax request has been sent.");
- }
- }
-
- @Override
- public String getTestUrl() {
- return "pages/ajaxSupport/ajaxSupport.xhtml";
- }
+ if (A4JSupport.Messages.FOR_SUBMIT.equals(data)) {
+ writeStatus("<a4j:support failed. 'disableDefault' attribute
does not work");
+ Assert.fail("<a4j:support failed. 'disableDefault' attribute
does not work.");
+ }
+ }
+
+ private void checkMessage(String data, String message, String errorMessage, String
okMessage) {
+ if (message.equals(data)) {
+ writeStatus(okMessage);
+ } else if (A4JSupport.Messages.NO_DATA.equals(data)) {
+ writeStatus(errorMessage + " Caused by: action listener for
<a4j:support> skipped", true);
+ Assert.fail(errorMessage + " Caused by: action listener for
<a4j:support> skipped");
+ } else if ("".equals(data)) {
+ writeStatus(errorMessage + "Caused by: no ajax request has been
sent.", true);
+ Assert.fail(errorMessage + "Caused by: no ajax request has been
sent.");
+ }
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/ajaxSupport/ajaxSupport.xhtml";
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -26,56 +26,14 @@
import org.ajax4jsf.bean.CalendarTestBean;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class CalendarTest extends SeleniumTestBase implements RichSeleniumTest {
-
- /**
- * Default constructor
- */
- public CalendarTest() {
- super("http", "localhost", serverPort);
- }
+public class CalendarTest extends SeleniumTestBase {
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testCalendarComponent() throws Exception {
- _testSelectDateComponent(Template.SIMPLE);
- _testCalendarComponent(Template.DATA_TABLE);
- _testCalendarComponent(Template.MODAL_PANEL);
- }
-
- private void _testCalendarComponent(Template template) {
+ public void testCalendarComponent(Template template) {
renderPage(template);
String containerId = getParentId() + "_form:";
@@ -102,8 +60,9 @@
Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be
visible on the component!");
}
-
- private void _testSelectDateComponent(Template template) {
+
+ @Test
+ public void testSelectDateComponent(Template template) {
renderPage(template);
Date newSelectedDate = CalendarTestBean.getDayInMay(15);
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,52 +1,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class ComboBoxTest extends SeleniumTestBase implements RichSeleniumTest {
+public class ComboBoxTest extends SeleniumTestBase {
- public ComboBoxTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testComboBoxComponent() throws Exception {
- _testComboBoxComponent(Template.SIMPLE);
- _testComboBoxComponent(Template.DATA_TABLE);
- _testComboBoxComponent(Template.MODAL_PANEL);
- }
-
- private void _testComboBoxComponent(Template template) {
+ public void testComboBoxComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -22,52 +22,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class ContextMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+public class ContextMenuTest extends SeleniumTestBase {
- public ContextMenuTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testContextMenuComponent() throws Exception {
- _testContextMenuComponent(Template.SIMPLE);
- _testContextMenuComponent(Template.DATA_TABLE);
- _testContextMenuComponent(Template.MODAL_PANEL);
- }
-
- private void _testContextMenuComponent(Template template) {
+ public void testContextMenuComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,54 +1,18 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class DataTableTest extends SeleniumTestBase implements RichSeleniumTest {
+public class DataTableTest extends SeleniumTestBase {
- public DataTableTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
public String getTestUrl() {
return "pages/dataTable/dataTableTest.xhtml";
}
@Test
- public void testDataTable() {
- _testDataTable(Template.SIMPLE);
- }
-
- private void _testDataTable(Template template) {
+ public void testDataTable(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,51 +1,13 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class DropDownMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+public class DropDownMenuTest extends SeleniumTestBase {
- public DropDownMenuTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testDropDownMenuComponent() throws Exception {
- _testDropDownMenuComponent(Template.SIMPLE);
- _testDropDownMenuComponent(Template.DATA_TABLE);
- _testDropDownMenuComponent(Template.MODAL_PANEL);
- }
-
- private void _testDropDownMenuComponent(Template template) {
+ public void testDropDownMenuComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,52 +1,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class InplaceSelectTest extends SeleniumTestBase implements RichSeleniumTest {
+public class InplaceSelectTest extends SeleniumTestBase {
- public InplaceSelectTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testInplaceSelectComponent() throws Exception {
- _testInplaceSelectComponent(Template.SIMPLE);
- _testInplaceSelectComponent(Template.DATA_TABLE);
- _testInplaceSelectComponent(Template.MODAL_PANEL);
- }
-
- private void _testInplaceSelectComponent(Template template) {
+ public void testInplaceSelectComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
@@ -103,11 +65,9 @@
selenium.fireEvent(okButton, "mousedown");
Assert.assertEquals(runScript("theLatestEvent"),
"viewactivated", "viewactivated event has not been triggered");
-// viewactivated event is not fired ... almost sure bug
-// writeStatus("Stop editing with cancel");
-// selenium.fireEvent(cancelButton, "mousedown");
-// Assert.assertEquals(runScript("theLatestEvent"),
"viewactivated", "viewactivated event has not been triggered");
-
+ writeStatus("Stop editing with cancel");
+ selenium.fireEvent(cancelButton, "mousedown");
+ Assert.assertEquals(runScript("theLatestEvent"),
"viewactivated", "viewactivated event has not been triggered");
}
public String getTestUrl() {
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -21,53 +21,16 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class InputNumberSliderTest extends SeleniumTestBase implements RichSeleniumTest
{
+public class InputNumberSliderTest extends SeleniumTestBase {
+
private static final int BAR_SCALE = 10;
- public InputNumberSliderTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testInputNumberSliderComponent() throws Exception {
- _testInputNumberSlider(Template.SIMPLE);
- _testInputNumberSlider(Template.DATA_TABLE);
-// _testInputNumberSlider(Template.MODAL_PANEL);
- }
-
- private void _testInputNumberSlider(Template template) {
+ public void testInputNumberSlider(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,54 +1,15 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class InputNumberSpinnerTest extends SeleniumTestBase implements RichSeleniumTest
{
+public class InputNumberSpinnerTest extends SeleniumTestBase {
- public InputNumberSpinnerTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testInputNumberSpinnerComponent() throws Exception {
- _testInputNumberSpinnerComponent(Template.SIMPLE);
- //it looks as if the spinner does not work inside rich:dataTable
- _testInputNumberSpinnerComponent(Template.DATA_TABLE);
- _testInputNumberSpinnerComponent(Template.MODAL_PANEL);
- }
-
- private void _testInputNumberSpinnerComponent(Template template) {
+ public void testInputNumberSpinnerComponent(Template template) {
renderPage(template);
writeStatus("check whether the spinner is invariant with respect to pair of
sequential opposite operations");
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -3,51 +3,13 @@
import static org.testng.Assert.assertEquals;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class JSFunctionTest extends SeleniumTestBase implements RichSeleniumTest {
+public class JSFunctionTest extends SeleniumTestBase {
- public JSFunctionTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testJSFunctionComponent() throws Exception {
- _testJSFunctionComponent(Template.SIMPLE);
- _testJSFunctionComponent(Template.DATA_TABLE);
- _testJSFunctionComponent(Template.MODAL_PANEL);
- }
-
- private void _testJSFunctionComponent(Template template) {
+ public void testJSFunctionComponent(Template template) {
renderPage(template);
String showNameElemId = getParentId() + "showname";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,51 +1,13 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class KeepAliveTest extends SeleniumTestBase implements RichSeleniumTest {
+public class KeepAliveTest extends SeleniumTestBase {
- public KeepAliveTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testKeepAliveComponent() throws Exception {
- _testKeepAliveComponent(Template.SIMPLE);
- _testKeepAliveComponent(Template.DATA_TABLE);
- _testKeepAliveComponent(Template.MODAL_PANEL);
- }
-
- private void _testKeepAliveComponent(Template template) {
+ public void _testKeepAliveComponent(Template template) {
renderPage(template);
String parentId = getParentId();
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ListShuttleTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -13,245 +13,250 @@
*
*/
public class ListShuttleTest extends SeleniumTestBase {
-
- String parentId;
- String availebleListId;
- String targetListId;
- String copyAllId;
- String copyId;
- String removeId;
- String removeAllId;
- String firstId;
- String upId;
- String downId;
- String lastId ;
- String submitId;
- String resetId;
- String hideId;
-
-
- @Test(dataProvider = "templates")
- public void testListShuttleComponent(Template template) {
- _testListShuttleComponent(template);
- }
-
- private void init() {
- parentId = getParentId() + "_form:";
- availebleListId = parentId + "lstbody";
- targetListId = parentId + "lstlTbody";
- copyAllId = parentId + "lscopyAll";
- copyId = parentId + "lscopy";
- removeId = parentId + "lsremove";
- removeAllId = parentId + "lsremoveAll";
- firstId = parentId + "lsfirst";
- upId = parentId + "lsup";
- downId = parentId + "lsdown";
- lastId = parentId + "lslast";
- submitId = parentId + "submit";
- resetId = parentId + "reset";
- hideId = parentId + "hide";
-
- }
-
- private void _testListShuttleComponent(Template template) {
- renderPage(template);
- init();
- reset();
-
- _checkVisibility(true);
-
- // Check count
- _assertTableRowsCount(availebleListId, 5);
- _assertTableRowsCount(targetListId, 0);
-
- // Copy all and check count
- try {
- clickById(copyAllId);
- _assertTableRowsCount(availebleListId, 0);
- _assertTableRowsCount(targetListId, 5);
- }catch (Exception e) {
- writeStatus("Test failed. Copy all does not work. Cause: " + e, true);
- Assert.fail("Test failed. Copy all does not work. Cause: " + e);
- }
+ String parentId;
- // Remove all and check count
- try {
- clickById(removeAllId);
- _assertTableRowsCount(availebleListId, 5);
- _assertTableRowsCount(targetListId, 0);
- }catch (Exception e) {
- writeStatus("Test failed. Remove all does not work. Cause: " + e, true);
- Assert.fail("Test failed. Remove all does not work. Cause: " + e);
- }
+ String availebleListId;
-
- try {
- // Copy 1st & 2nd item
- _doItemAction(parentId + "ls:0", copyId, "Copy");
- _doItemAction(parentId + "ls:1", copyId, "Copy");
- _doItemAction(parentId + "ls:2", copyId, "Copy");
-
- // Check count
- _assertTableRowsCount(availebleListId, 2);
- _assertTableRowsCount(targetListId, 3);
- }catch (Exception e) {
- writeStatus("Test failed. Copy does not work. Cause: " + e, true);
- Assert.fail("Test failed. Copy does not work. cause: " + e);
- }
-
- // Check posting to server
- _checkDataPost2Server(2,3);
-
- // Check ordering
- _checkOrdering(targetListId, "1Item1", "2Item2",
"3Item3","");
-
- // Move the first to to the last
- _doItemAction(parentId + "ls:t0", downId, "Down");
- _checkOrdering(targetListId, "2Item2", "1Item1",
"3Item3","Test failed. Down control does not work");
+ String targetListId;
+ String copyAllId;
- _doItemAction(parentId + "ls:t0", lastId, "Last");
- _checkOrdering(targetListId, "2Item2", "3Item3",
"1Item1","Test failed. Last control does not work");
-
- _doItemAction(parentId + "ls:t2", firstId, "first");
- _checkOrdering(targetListId, "3Item3", "2Item2",
"1Item1","Test failed. First control does not work");
+ String copyId;
- _doItemAction(parentId + "ls:t0", upId, "Up");
- _checkOrdering(targetListId, "3Item3", "1Item1",
"2Item2","Test failed. Up control does not work");
-
- _doItemAction(parentId + "ls:t1", removeId, "Remove");
- _checkOrdering(targetListId, "3Item3", "1Item1", null,"Test
failed. Remove control does not work");
+ String removeId;
- _assertTableRowsCount(targetListId, 2);
-
- hideControls();
- _checkVisibility(false);
+ String removeAllId;
- }
-
- private void hideControls() {
- clickAjaxCommandAndWait(hideId);
- }
-
-
- private void _checkVisibility(boolean isVisible) {
- if (isVisible) {
- AssertVisible(copyAllId);
- AssertVisible(parentId + "lsdisremoveAll");
- AssertVisible(parentId + "lsdisremove");
- AssertVisible(parentId + "lsdisremove");
-
- AssertVisible(parentId + "lsdisfirst");
- AssertVisible(parentId + "lsdisup");
- AssertVisible(parentId + "lsdisdown");
- AssertVisible(parentId + "lsdislast");
- }else {
- AssertNotRendered(copyAllId);
- AssertNotRendered(removeAllId);
- AssertNotRendered(copyId);
- AssertNotRendered(removeId);
- AssertNotRendered(firstId);
- AssertNotRendered(lastId);
- AssertNotRendered(downId);
- AssertNotRendered(upId);
- }
- }
-
- private void _checkOrdering (String listId, String first, String second, String fird,
String errorMessage) {
- try {
- if (first != null)
- _checkItemText(first, listId, 0);
- if (second != null) {
- _checkItemText(second, listId, 1);
- }
- if (fird != null) {
- _checkItemText(fird, listId, 2);
- }
- }catch (Exception e) {
- writeStatus(errorMessage, true);
- Assert.fail(errorMessage + e.getMessage());
- }
- }
-
- private void reset() {
- clickAjaxCommandAndWait(resetId);
- }
-
- private void _assertTableRowsCount(String tbId, int rows) {
- writeStatus("Check items count for list id : " + tbId);
- StringBuffer b = new StringBuffer("$('");
- b.append(tbId);
- b.append("').rows.length");
- String l = runScript(b.toString());
- int r;
- try {
- r = Integer.parseInt(l);
- if (r != rows) {
- writeStatus("Incorrect list item count in table id: " + tbId, true);
- Assert.fail("Incorrect list item count in table id: " + tbId);
- }
- }catch (Exception e) {
- writeStatus("List shuttle test failed. Cause: " + e.getMessage(), true);
- Assert.fail("List shuttle test failed. Cause: " + e);
- }
- }
-
- private void _doItemAction(String itemId, String actionId, String actionName) {
- writeStatus(actionName + " the item id: " + itemId);
- _selectItem(itemId);
- clickById(actionId);
- }
-
- private void _checkDataPost2Server(int availableCount, int targetCount) {
- writeStatus("Rerender form. List items should be changed.");
- clickAjaxCommandAndWait(submitId);
+ String firstId;
- try {
- _assertTableRowsCount(availebleListId, availableCount);
- _assertTableRowsCount(targetListId, targetCount);
- } catch (Exception e) {
- writeStatus("Data was post to server incorrectly. List data before rerendering
does not match after", true);
- Assert.fail("Data was post to server incorrectly. List data before rerendering
does not match after. Cause: " + e);
- }
- }
-
- private void _selectItem(String itemId) {
- writeStatus("Select item id: " + itemId);
- try {
- clickById(itemId);
- }catch (Exception e) {
- writeStatus("Selection item id: " + itemId + " failed.");
- Assert.fail("No item was found. Item id: " + itemId);
- }
- }
-
- private void _checkItemText(String text, String listId, int i) {
- StringBuffer b = new StringBuffer("$('");
- b.append(listId);
- b.append("').rows[");
- b.append(i);
- b.append("].id");
-
- String id = null;
- try {
- id = runScript(b.toString());
- AssertTextEquals(id, text, "Invalid item's text");
- }catch (Exception e) {
- writeStatus("Invalid item text. Item id: " + id);
- Assert.fail("Invalid item text. Item id: " + id);
- }
- }
+ String upId;
+ String downId;
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.SeleniumTestBase#getTestUrl()
- */
- @Override
- public String getTestUrl() {
- return "pages/listShuttle/listShuttleTest.xhtml";
- }
+ String lastId;
+ String submitId;
+
+ String resetId;
+
+ String hideId;
+
+ private void init() {
+ parentId = getParentId() + "_form:";
+ availebleListId = parentId + "lstbody";
+ targetListId = parentId + "lstlTbody";
+ copyAllId = parentId + "lscopyAll";
+ copyId = parentId + "lscopy";
+ removeId = parentId + "lsremove";
+ removeAllId = parentId + "lsremoveAll";
+ firstId = parentId + "lsfirst";
+ upId = parentId + "lsup";
+ downId = parentId + "lsdown";
+ lastId = parentId + "lslast";
+ submitId = parentId + "submit";
+ resetId = parentId + "reset";
+ hideId = parentId + "hide";
+
+ }
+
+ @Test
+ public void testListShuttleComponent(Template template) {
+ renderPage(template);
+ init();
+ reset();
+
+ _checkVisibility(true);
+
+ // Check count
+ _assertTableRowsCount(availebleListId, 5);
+ _assertTableRowsCount(targetListId, 0);
+
+ // Copy all and check count
+ try {
+ clickById(copyAllId);
+ _assertTableRowsCount(availebleListId, 0);
+ _assertTableRowsCount(targetListId, 5);
+ } catch (Exception e) {
+ writeStatus("Test failed. Copy all does not work. Cause: " + e,
true);
+ Assert.fail("Test failed. Copy all does not work. Cause: " + e);
+ }
+
+ // Remove all and check count
+ try {
+ clickById(removeAllId);
+ _assertTableRowsCount(availebleListId, 5);
+ _assertTableRowsCount(targetListId, 0);
+ } catch (Exception e) {
+ writeStatus("Test failed. Remove all does not work. Cause: " + e,
true);
+ Assert.fail("Test failed. Remove all does not work. Cause: " + e);
+ }
+
+ try {
+ // Copy 1st & 2nd item
+ _doItemAction(parentId + "ls:0", copyId, "Copy");
+ _doItemAction(parentId + "ls:1", copyId, "Copy");
+ _doItemAction(parentId + "ls:2", copyId, "Copy");
+
+ // Check count
+ _assertTableRowsCount(availebleListId, 2);
+ _assertTableRowsCount(targetListId, 3);
+ } catch (Exception e) {
+ writeStatus("Test failed. Copy does not work. Cause: " + e, true);
+ Assert.fail("Test failed. Copy does not work. cause: " + e);
+ }
+
+ // Check posting to server
+ _checkDataPost2Server(2, 3);
+
+ // Check ordering
+ _checkOrdering(targetListId, "1Item1", "2Item2",
"3Item3", "");
+
+ // Move the first to to the last
+ _doItemAction(parentId + "ls:t0", downId, "Down");
+ _checkOrdering(targetListId, "2Item2", "1Item1",
"3Item3", "Test failed. Down control does not work");
+
+ _doItemAction(parentId + "ls:t0", lastId, "Last");
+ _checkOrdering(targetListId, "2Item2", "3Item3",
"1Item1", "Test failed. Last control does not work");
+
+ _doItemAction(parentId + "ls:t2", firstId, "first");
+ _checkOrdering(targetListId, "3Item3", "2Item2",
"1Item1", "Test failed. First control does not work");
+
+ _doItemAction(parentId + "ls:t0", upId, "Up");
+ _checkOrdering(targetListId, "3Item3", "1Item1",
"2Item2", "Test failed. Up control does not work");
+
+ _doItemAction(parentId + "ls:t1", removeId, "Remove");
+ _checkOrdering(targetListId, "3Item3", "1Item1", null,
"Test failed. Remove control does not work");
+
+ _assertTableRowsCount(targetListId, 2);
+
+ hideControls();
+ _checkVisibility(false);
+
+ }
+
+ private void hideControls() {
+ clickAjaxCommandAndWait(hideId);
+ }
+
+ private void _checkVisibility(boolean isVisible) {
+ if (isVisible) {
+ AssertVisible(copyAllId);
+ AssertVisible(parentId + "lsdisremoveAll");
+ AssertVisible(parentId + "lsdisremove");
+ AssertVisible(parentId + "lsdisremove");
+
+ AssertVisible(parentId + "lsdisfirst");
+ AssertVisible(parentId + "lsdisup");
+ AssertVisible(parentId + "lsdisdown");
+ AssertVisible(parentId + "lsdislast");
+ } else {
+ AssertNotRendered(copyAllId);
+ AssertNotRendered(removeAllId);
+ AssertNotRendered(copyId);
+ AssertNotRendered(removeId);
+ AssertNotRendered(firstId);
+ AssertNotRendered(lastId);
+ AssertNotRendered(downId);
+ AssertNotRendered(upId);
+ }
+ }
+
+ private void _checkOrdering(String listId, String first, String second, String fird,
String errorMessage) {
+ try {
+ if (first != null)
+ _checkItemText(first, listId, 0);
+ if (second != null) {
+ _checkItemText(second, listId, 1);
+ }
+ if (fird != null) {
+ _checkItemText(fird, listId, 2);
+ }
+ } catch (Exception e) {
+ writeStatus(errorMessage, true);
+ Assert.fail(errorMessage + e.getMessage());
+ }
+ }
+
+ private void reset() {
+ clickAjaxCommandAndWait(resetId);
+ }
+
+ private void _assertTableRowsCount(String tbId, int rows) {
+ writeStatus("Check items count for list id : " + tbId);
+ StringBuffer b = new StringBuffer("$('");
+ b.append(tbId);
+ b.append("').rows.length");
+ String l = runScript(b.toString());
+ int r;
+ try {
+ r = Integer.parseInt(l);
+ if (r != rows) {
+ writeStatus("Incorrect list item count in table id: " + tbId,
true);
+ Assert.fail("Incorrect list item count in table id: " + tbId);
+ }
+ } catch (Exception e) {
+ writeStatus("List shuttle test failed. Cause: " + e.getMessage(),
true);
+ Assert.fail("List shuttle test failed. Cause: " + e);
+ }
+ }
+
+ private void _doItemAction(String itemId, String actionId, String actionName) {
+ writeStatus(actionName + " the item id: " + itemId);
+ _selectItem(itemId);
+ clickById(actionId);
+ }
+
+ private void _checkDataPost2Server(int availableCount, int targetCount) {
+ writeStatus("Rerender form. List items should be changed.");
+ clickAjaxCommandAndWait(submitId);
+
+ try {
+ _assertTableRowsCount(availebleListId, availableCount);
+ _assertTableRowsCount(targetListId, targetCount);
+ } catch (Exception e) {
+ writeStatus("Data was post to server incorrectly. List data before
rerendering does not match after", true);
+ Assert
+ .fail("Data was post to server incorrectly. List data before
rerendering does not match after. Cause: "
+ + e);
+ }
+ }
+
+ private void _selectItem(String itemId) {
+ writeStatus("Select item id: " + itemId);
+ try {
+ clickById(itemId);
+ } catch (Exception e) {
+ writeStatus("Selection item id: " + itemId + "
failed.");
+ Assert.fail("No item was found. Item id: " + itemId);
+ }
+ }
+
+ private void _checkItemText(String text, String listId, int i) {
+ StringBuffer b = new StringBuffer("$('");
+ b.append(listId);
+ b.append("').rows[");
+ b.append(i);
+ b.append("].id");
+
+ String id = null;
+ try {
+ id = runScript(b.toString());
+ AssertTextEquals(id, text, "Invalid item's text");
+ } catch (Exception e) {
+ writeStatus("Invalid item text. Item id: " + id);
+ Assert.fail("Invalid item text. Item id: " + id);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.SeleniumTestBase#getTestUrl()
+ */
+ @Override
+ public String getTestUrl() {
+ return "pages/listShuttle/listShuttleTest.xhtml";
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -3,51 +3,13 @@
import static org.testng.Assert.assertEquals;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class LoadScriptTest extends SeleniumTestBase implements RichSeleniumTest {
+public class LoadScriptTest extends SeleniumTestBase {
- public LoadScriptTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testLoadScriptComponent() throws Exception {
- _testLoadScriptComponent(Template.SIMPLE);
- _testLoadScriptComponent(Template.DATA_TABLE);
- _testLoadScriptComponent(Template.MODAL_PANEL);
- }
-
- private void _testLoadScriptComponent(Template template) {
+ public void testLoadScriptComponent(Template template) throws Exception {
renderPage(template);
String jsCall = "summarize(%1$s, %2$s);";
int opr1 = 1;
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -4,51 +4,13 @@
import static org.testng.Assert.assertEquals;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class LoadStyleTest extends SeleniumTestBase implements RichSeleniumTest {
+public class LoadStyleTest extends SeleniumTestBase {
- public LoadStyleTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testLoadStyleComponent() throws Exception {
- _testLoadStyleComponent(Template.SIMPLE);
- _testLoadStyleComponent(Template.DATA_TABLE);
- _testLoadStyleComponent(Template.MODAL_PANEL);
- }
-
- private void _testLoadStyleComponent(Template template) {
+ public void testLoadStyleComponent(Template template) {
renderPage(template);
String divId = getParentId() + "rectangle";
assertEquals(50, getWidthById(divId));
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -22,15 +22,11 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class OrderingListTest extends SeleniumTestBase implements RichSeleniumTest {
+public class OrderingListTest extends SeleniumTestBase {
private String firstButton;
private String firstButtonDisabled;
@@ -61,55 +57,11 @@
private String activeItemText;
- public OrderingListTest() {
- super("http", "localhost", serverPort);
- }
-
- public OrderingListTest(String protocol, String host, String port) {
- super(protocol, host, port);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testOrderingListComponent() throws Exception {
- _testOrderingListComponent(Template.SIMPLE);
- _testOrderingListComponent(Template.DATA_TABLE);
- _testOrderingListComponent(Template.MODAL_PANEL);
- }
-
- private void _testOrderingListComponent(Template template) {
+ public void testButtons(Template template) {
renderPage(template);
initFields();
- _testButtons();
- _testActions();
- _testJSFunctions();
- }
-
- private void _testButtons() {
writeStatus("Check if all buttons are disabled first time");
checkButtons(true, true, true, true);
@@ -134,7 +86,11 @@
Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
}
- private void _testActions() {
+ @Test
+ public void testActions(Template template) {
+ renderPage(template);
+ initFields();
+
writeStatus("Select two rows");
clickById(firstRow);
selenium.controlKeyDown();
@@ -160,7 +116,11 @@
checkButtons(true, true, false, false);
}
- private void _testJSFunctions() {
+ @Test
+ public void testJSFunctions(Template template) {
+ renderPage(template);
+ initFields();
+
writeStatus("Select one row");
clickById(thirdRow);
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -22,52 +22,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class PanelBarTest extends SeleniumTestBase implements RichSeleniumTest {
+public class PanelBarTest extends SeleniumTestBase {
- public PanelBarTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testPanelBarComponent() throws Exception {
- _testPanelBarComponent(Template.SIMPLE);
- _testPanelBarComponent(Template.DATA_TABLE);
- _testPanelBarComponent(Template.MODAL_PANEL);
- }
-
- private void _testPanelBarComponent(Template template) {
+ public void testPanelBarComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,65 +1,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class PanelMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+public class PanelMenuTest extends SeleniumTestBase {
- public PanelMenuTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testPanelMenuComponent() throws Exception {
-
- _testPanelMenuComponent(Template.SIMPLE);
- _testPanelMenuComponent(Template.DATA_TABLE);
- _testPanelMenuComponent(Template.MODAL_PANEL);
-
- _testPanelMenuComponentSingleMode(Template.SIMPLE);
- _testPanelMenuComponentSingleMode(Template.DATA_TABLE);
- _testPanelMenuComponentSingleMode(Template.MODAL_PANEL);
-
- _testPanelMenuItemAction(Template.SIMPLE);
- _testPanelMenuItemAction(Template.DATA_TABLE);
- _testPanelMenuItemAction(Template.MODAL_PANEL);
-
- _testPanelMenuClientAPI(Template.SIMPLE);
- _testPanelMenuClientAPI(Template.DATA_TABLE);
- _testPanelMenuClientAPI(Template.MODAL_PANEL);
- }
-
- private void _testPanelMenuClientAPI(Template template) {
+ public void testPanelMenuClientAPI(Template template) {
renderPage(template);
String form1 = getParentId() + "_form1:";
@@ -103,7 +52,8 @@
tearDown();
}
- private void _testPanelMenuComponent(Template template) {
+ @Test
+ public void testPanelMenuComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form1:";
@@ -174,7 +124,8 @@
tearDown();
}
- private void _testPanelMenuComponentSingleMode(Template template) {
+ @Test
+ public void testPanelMenuComponentSingleMode(Template template) {
renderPage(template);
String parentId = getParentId() + "_form2:";
@@ -244,7 +195,8 @@
tearDown();
}
- private void _testPanelMenuItemAction(Template template) {
+ @Test
+ public void testPanelMenuItemAction(Template template) {
renderPage(template);
String parentId = getParentId() + "_form";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,52 +1,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class PickListTest extends SeleniumTestBase implements RichSeleniumTest {
+public class PickListTest extends SeleniumTestBase {
- public PickListTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testPickListComponent() throws Exception {
- _testPickListComponent(Template.SIMPLE);
- _testPickListComponent(Template.DATA_TABLE);
- _testPickListComponent(Template.MODAL_PANEL);
- }
-
- private void _testPickListComponent(Template template) {
+ public void testPickListComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -1,53 +1,15 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class ProgressBarTest extends SeleniumTestBase implements RichSeleniumTest {
+public class ProgressBarTest extends SeleniumTestBase {
- public ProgressBarTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testProgressBarComponent() {
- _testProgressBarComponent(Template.SIMPLE);
- _testProgressBarComponent(Template.DATA_TABLE);
- _testProgressBarComponent(Template.MODAL_PANEL);
- }
+ public void testProgressBarComponent(Template template) {
- private void _testProgressBarComponent(Template template) {
-
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -22,52 +22,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class SimpleTogglePanelTest extends SeleniumTestBase implements RichSeleniumTest
{
+public class SimpleTogglePanelTest extends SeleniumTestBase {
- public SimpleTogglePanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testSimpleTogglePanelComponent() throws Exception {
- _testSimpleTogglePanelComponent(Template.SIMPLE);
- _testSimpleTogglePanelComponent(Template.DATA_TABLE);
- _testSimpleTogglePanelComponent(Template.MODAL_PANEL);
- }
-
- private void _testSimpleTogglePanelComponent(Template template) {
+ public void _testSimpleTogglePanelComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
String inputId = parentId + "_value";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -22,52 +22,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class SpacerTest extends SeleniumTestBase implements RichSeleniumTest {
+public class SpacerTest extends SeleniumTestBase {
- public SpacerTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testSimpleTogglePanelComponent() throws Exception {
- _testSimpleTogglePanelComponent(Template.SIMPLE);
- _testSimpleTogglePanelComponent(Template.DATA_TABLE);
- _testSimpleTogglePanelComponent(Template.MODAL_PANEL);
- }
-
- private void _testSimpleTogglePanelComponent(Template template) {
+ public void testSimpleTogglePanelComponent(Template template) {
renderPage(template);
String parentId = getParentId();
String spacerId = parentId + "sp";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -22,54 +22,16 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import com.thoughtworks.selenium.SeleniumException;
-public class TabPanelTest extends SeleniumTestBase implements RichSeleniumTest {
+public class TabPanelTest extends SeleniumTestBase {
- public TabPanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testTabPanelComponent() throws Exception {
- _testRichTabPanelComponent(Template.SIMPLE);
- _testRichTabPanelComponent(Template.DATA_TABLE);
- _testRichTabPanelComponent(Template.MODAL_PANEL);
- }
-
- private void _testRichTabPanelComponent(Template template) {
+ public void testRichTabPanelComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
String linkId = parentId + "tab2_lbl";
@@ -126,6 +88,7 @@
}
}
+ @Override
public String getTestUrl() {
return "pages/tabPanel/tabPanelTest.xhtml";
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java 2008-07-18
10:48:48 UTC (rev 9681)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java 2008-07-18
11:12:38 UTC (rev 9682)
@@ -22,54 +22,16 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import com.thoughtworks.selenium.SeleniumException;
-public class TogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
+public class TogglePanelTest extends SeleniumTestBase {
- public TogglePanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testTogglePanelComponent() throws Exception {
- _testTogglePanelComponent(Template.SIMPLE);
- _testTogglePanelComponent(Template.DATA_TABLE);
- _testTogglePanelComponent(Template.MODAL_PANEL);
- }
-
- private void _testTogglePanelComponent(Template template) {
+ public void testTogglePanelComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";