Author: andrei_exadel
Date: 2009-02-11 04:17:30 -0500 (Wed, 11 Feb 2009)
New Revision: 12626
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
Log:
RF-6046, RF-6042, RF-6047
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-02-11
00:30:21 UTC (rev 12625)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-02-11
09:17:30 UTC (rev 12626)
@@ -73,7 +73,7 @@
this.base = base;
}
- private void navigate() {
+ public void navigate() {
base.navigate();
base.waiteForCondition("document.getElementById('_auto_test_navigation') !=
null", 10000);
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2009-02-11
00:30:21 UTC (rev 12625)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2009-02-11
09:17:30 UTC (rev 12626)
@@ -79,6 +79,60 @@
}
@Test
+ public void testOutput(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+
+ String componentId = tester.getClientId(AutoTester.COMPONENT_ID);
+ if (!"Link".equals(getHTMLById(componentId))) {
+ Assert.fail("Command link should be output as link with text defined as value
attribute");
+ }
+
+ int i =
selenium.getXpathCount("//a[(a)id='"+componentId+"']").intValue();
+ if (i != 1) {
+ Assert.fail("Command link should be rendered as <a> tag");
+ }
+
+ }
+
+ @Test
+ public void testNavigationForAjaxSingle(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(TEST_NAVIGATION_URL, template, null);
+
+ // Set ajaxSingle mode
+ tester.reset();
+ tester.setupControl(AutoTester.TestSetupEntry.ajaxSingle, true);
+ tester.clickLoad();
+
+ tester.setExtrenalValidationFailed();
+ tester.navigate();
+
+ tester.checkAction(true);
+ tester.checkActionListener(true);
+ tester.checkNestedActionListener(true);
+ tester.checkUpdateModel(false);
+ }
+
+ @Test
+ public void testNavigationForImmediate(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(TEST_NAVIGATION_URL, template, null);
+
+ // Set immediate mode
+ tester.reset();
+ tester.setupControl(AutoTester.TestSetupEntry.immediate, true);
+ tester.clickLoad();
+
+ tester.navigate();
+
+ tester.checkAction(true);
+ tester.checkActionListener(true);
+ tester.checkNestedActionListener(true);
+ tester.checkUpdateModel(false);
+ }
+
+ @Test
public void testNavigation(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(TEST_NAVIGATION_URL, template, null);
@@ -139,7 +193,7 @@
@Test
public void testAjaxCommandLinkComponent(Template template) {
- renderPage(template);
+ renderPage(template, null);
String parentId = getParentId() + "_form:";
@@ -249,5 +303,7 @@
public void navigate() {
clickById(getAutoTester(this).getClientId(AutoTester.COMPONENT_ID));
}
+
+
}
Show replies by date