Author: andrei_exadel
Date: 2008-08-12 03:59:50 -0400 (Tue, 12 Aug 2008)
New Revision: 10038
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/pages/listShuttle/listShuttleTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ListShuttleTest.java
Log:
List Shuttle Test refactoring
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/pages/listShuttle/listShuttleTest.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/pages/listShuttle/listShuttleTest.xhtml 2008-08-12
06:46:35 UTC (rev 10037)
+++
trunk/test-applications/seleniumTest/src/main/webapp/pages/listShuttle/listShuttleTest.xhtml 2008-08-12
07:59:50 UTC (rev 10038)
@@ -11,9 +11,25 @@
</ui:define>
<ui:define name="component">
+ <script type="text/javascript">
+ function _selectItem(id) {
+ var e = $(id);
+ if (document.createEvent) {
+ evt = document.createEvent("MouseEvents");
+ evt.initMouseEvent("click", true, true, window,0, 0, 0, 0, 0, false,
false, false, false, 0, null);
+ evt.srcElement = e;
+ e.dispatchEvent(evt);
+ }else {
+ if (e.click) {
+ e.click();
+ }
+ }
+ }
+ </script>
<a4j:outputPanel>
<h:messages></h:messages>
</a4j:outputPanel>
+ <p id="crack"></p>
<h:form id="_form">
<rich:listShuttle id="ls"
sourceValue="#{listShuttle.freeItems}"
targetValue="#{listShuttle.items}" var="items"
listHeight="300"
@@ -31,7 +47,7 @@
</h:outputLink>
</rich:column>
<rich:column>
- <h:outputText
value="#{items.name}"></h:outputText>
+ <h:outputText value="#{items.name}"
id="item"></h:outputText>
</rich:column>
</rich:listShuttle>
<a4j:commandLink id="reset" value="Reset"
actionListener="#{listShuttle.reset}"
reRender="ls"></a4j:commandLink><br/>
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-08-12
06:46:35 UTC (rev 10037)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-08-12
07:59:50 UTC (rev 10038)
@@ -225,10 +225,10 @@
private void _selectItem(String itemId) {
writeStatus("Select item id: " + itemId);
try {
- clickById(itemId);
+ runScript("_selectItem('" + itemId + "')");
} catch (Exception e) {
writeStatus("Selection item id: " + itemId + "
failed.");
- Assert.fail("No item was found. Item id: " + itemId);
+ Assert.fail("No item was found. Item id: " + itemId + e);
}
}
Show replies by date