Author: andrei_exadel
Date: 2009-01-15 13:28:58 -0500 (Thu, 15 Jan 2009)
New Revision: 12299
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
Remove JS references to prototype functions
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml 2009-01-15
18:09:30 UTC (rev 12298)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml 2009-01-15
18:28:58 UTC (rev 12299)
@@ -30,7 +30,6 @@
rendered="#{autoTestBean.rendered}"
</a4j:commandButton>
- <rich:effect></rich:effect>
</ui:define>
</ui:composition>
</html>
\ No newline at end of file
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-15
18:09:30 UTC (rev 12298)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-15
18:28:58 UTC (rev 12299)
@@ -25,6 +25,7 @@
import java.io.FileFilter;
import java.io.FileInputStream;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -1232,14 +1233,11 @@
* @param isId - Pass true if ID is string, false - if ID is expression to load
appropriate DOM element
*/
public void assertClassNames(String id, String[] classNames, String message, boolean
isId) {
+ String clazz = runScript(((isId) ?
"document.getElementById('"+id+"')" : id) +
".className");
+ List<String> classes = (clazz != null) ? Arrays.asList(clazz.split("
")) : new ArrayList<String>();
for (String s : classNames) {
- String result = null;
- if (isId) {
- result = runScript("$('" + id +
"').hasClassName('" + s + "')", false).toLowerCase();
- } else {
- result = runScript("$(" + id + ").hasClassName('"
+ s + "')", false).toLowerCase();
- }
- if (Boolean.FALSE.toString().toLowerCase().equals(result)) {
+ boolean result = classes.contains(s);
+ if (!result) {
Assert.fail(message + " Element [id=" + id + "] should
contain class name '" + s + "'");
}
}
@@ -1392,7 +1390,7 @@
}
public String getStyleAttributeString (String id, String attr) {
- return runScript(getElementById(id) + ".getStyle('" + attr +
"')");
+ return runScript("getStyle('"+id+"',
'"+attr+"')");
}