Author: lfryc(a)redhat.com
Date: 2009-12-14 10:24:21 -0500 (Mon, 14 Dec 2009)
New Revision: 16126
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/keepAlive/KeepAliveTestCase.java
Log:
* KeepAlive
- uncompability in handling @disabled - IE is using 'false' when enabling instead
of Firefoxe's removing of the attribute
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/keepAlive/KeepAliveTestCase.java
===================================================================
---
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/keepAlive/KeepAliveTestCase.java 2009-12-14
15:22:15 UTC (rev 16125)
+++
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/keepAlive/KeepAliveTestCase.java 2009-12-14
15:24:21 UTC (rev 16126)
@@ -66,13 +66,8 @@
selenium.fireEvent(LOC_INPUT_INCORRECT2, Event.KEYUP);
// wait for "equal sign" button became enabled (lost disabled status)
- Wait.failWith("Button \"=\" never became enabled").until(new
Condition() {
- public boolean isTrue() {
- return !selenium.isElementPresent(format("{0}/@disabled",
LOC_BUTTON_INCORRECT));
+ Wait.failWith("Button \"=\" never became enabled").until(new
ButtonDisabled(LOC_BUTTON_INCORRECT));
- }
- });
-
// try to count result
selenium.click(LOC_BUTTON_INCORRECT);
@@ -101,11 +96,7 @@
selenium.fireEvent(LOC_INPUT_CORRECT2, Event.KEYUP);
// wait for "equal sign" button became enabled (lost disabled status)
- Wait.failWith("Button \"=\" never became enabled").until(new
Condition() {
- public boolean isTrue() {
- return !selenium.isElementPresent(format("{0}/@disabled",
LOC_BUTTON_CORRECT));
- }
- });
+ Wait.failWith("Button \"=\" never became enabled").until(new
ButtonDisabled(LOC_BUTTON_CORRECT));
// try to count result
selenium.click(LOC_BUTTON_CORRECT);
@@ -119,6 +110,25 @@
}
});
}
+
+ private class ButtonDisabled implements Condition {
+ private String locButton;
+
+ public ButtonDisabled(String locButton) {
+ this.locButton = locButton;
+ }
+
+ public boolean isTrue() {
+ final String attrDisabled = format("{0} @disabled", locButton);
+
+ if (!selenium.isElementPresent(attrDisabled)) {
+ return true;
+ }
+
+ return "false".equals(selenium.getValue(attrDisabled));
+ }
+
+ }
@SuppressWarnings("unused")
@BeforeMethod
Show replies by date