Author: ppitonak(a)redhat.com
Date: 2009-11-12 12:34:24 -0500 (Thu, 12 Nov 2009)
New Revision: 15872
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/AbstractSeleniumRichfacesTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dragSupport/DragSupportTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/log/LogTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/outputPanel/OutputPanelTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/push/PushTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/status/StatusTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dragSupport/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/graphValidator/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/jsFunction/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/keepAlive/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/messages.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/poll/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/push/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/queue/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/script/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/status/locators.properties
Log:
* XPath locators replaced by jQuery locators
* StatusTestCase refactored so now at least two methods should pass always.
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/AbstractSeleniumRichfacesTestCase.java
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/AbstractSeleniumRichfacesTestCase.java 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/AbstractSeleniumRichfacesTestCase.java 2009-11-12
17:34:24 UTC (rev 15872)
@@ -73,7 +73,7 @@
/**
* predefined waitings to use in inheritors
*/
- protected Waiting waitModelUpdate = Wait.interval(100).timeout(60000);
+ protected Waiting waitModelUpdate = Wait.interval(100).timeout(30000);
protected Waiting waitGuiInteraction = Wait.interval(100).timeout(500);
/**
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dragSupport/DragSupportTestCase.java
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dragSupport/DragSupportTestCase.java 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dragSupport/DragSupportTestCase.java 2009-11-12
17:34:24 UTC (rev 15872)
@@ -108,8 +108,8 @@
private void accepting(int phase) {
String itemText = format(MSG_CHOICES_FRAMEWORKS, 1);
- String item = format(LOC_DIV_DRAGGED_ITEM_PREFORMATTED, itemText);
- String target = format(LOC_CHOICES_OF_DIV_TARGETS, 1);
+ String item = format(LOC_DIV_DRAGGED_ITEM_PREFORMATTED, 1);
+ String target = format(LOC_CHOICES_OF_DIV_TARGETS, 0);
if (phase == 0) {
assertTrue(selenium.isElementPresent(LOC_DIV_DRAG_INDICATOR),
@@ -119,7 +119,7 @@
}
Drag drag = new Drag(selenium, item, target);
-
+
drag.move();
if (phase == 0) {
@@ -137,7 +137,7 @@
assertTrue(Pattern.matches(MSG_REGEXP_IMGSRC_OF_MOVING, actual), format(
"The image source of indicator '{0}' doesn't match '{1}",
actual, MSG_REGEXP_IMGSRC_OF_MOVING));
}
-
+
drag.enter();
if (phase == 1) {
@@ -157,14 +157,13 @@
}
String firstInsertedItem = format(LOC_DIV_FIRST_INSERTED_ITEM_RELATIVE, target);
-
if (phase == 2) {
assertFalse(selenium.isElementPresent(firstInsertedItem),
"There was one item inserted to target, but there was expected no item");
}
drag.drop();
-
+
if (phase == 2) {
Wait.failWith("Drag indicator never disappeared when item
dropped").until(new Condition() {
public boolean isTrue() {
@@ -174,8 +173,7 @@
assertTrue(selenium.isElementPresent(firstInsertedItem),
"There was no item inserted in target after drop of accepting item");
- assertFalse(selenium.isElementPresent(item),
- "The dragged item was still in framework list after drop to accepting
target");
+ assertFalse(selenium.getText(item).equals(itemText), "The dragged item was still
in framework list after drop to accepting target");
String actual = selenium.getText(firstInsertedItem);
assertEquals(itemText, actual,
@@ -184,9 +182,8 @@
}
private void rejecting(int phase) {
- String itemText = format(MSG_CHOICES_FRAMEWORKS, 1);
- String item = format(LOC_DIV_DRAGGED_ITEM_PREFORMATTED, itemText);
- String target = format(LOC_CHOICES_OF_DIV_TARGETS, 2);
+ String item = format(LOC_DIV_DRAGGED_ITEM_PREFORMATTED, 1);
+ String target = format(LOC_CHOICES_OF_DIV_TARGETS, 1);
Drag drag = new Drag(selenium, item, target);
drag.move();
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/log/LogTestCase.java
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/log/LogTestCase.java 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/log/LogTestCase.java 2009-11-12
17:34:24 UTC (rev 15872)
@@ -81,14 +81,14 @@
}
private void fillLog() {
- final long startCount = selenium.getXpathCount(LOC_DIV_LOG_CONSOLE_ENTRY).longValue();
+ final int startCount = getJQueryCount(LOC_DIV_LOG_CONSOLE_ENTRY);
selenium.type(LOC_INPUT_TEXT, MSG_INPUT_SAMPLE);
selenium.fireEvent(LOC_INPUT_TEXT, Event.KEYUP);
Wait.failWith("Count of log entries never increase").until(new Condition() {
public boolean isTrue() {
- return selenium.getXpathCount(LOC_DIV_LOG_CONSOLE_ENTRY).longValue() >
startCount;
+ return getJQueryCount(LOC_DIV_LOG_CONSOLE_ENTRY) > startCount;
}
});
@@ -112,10 +112,10 @@
private void waitForLogStabilize() {
Wait.failWith("Log stabilized in entry count in given
time").interval(3000).timeout(9000).until(
new Condition() {
- long count = -1;
+ int count = -1;
public boolean isTrue() {
- long actual = selenium.getXpathCount(LOC_DIV_LOG_CONSOLE_ENTRY).longValue();
+ int actual = getJQueryCount(LOC_DIV_LOG_CONSOLE_ENTRY);
if (actual == count) {
return true;
}
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/outputPanel/OutputPanelTestCase.java
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/outputPanel/OutputPanelTestCase.java 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/outputPanel/OutputPanelTestCase.java 2009-11-12
17:34:24 UTC (rev 15872)
@@ -35,79 +35,80 @@
*/
public class OutputPanelTestCase extends AbstractSeleniumRichfacesTestCase {
- private String LOC_FIELDSET_HEADER = getLoc("FIELDSET_HEADER");
- private String LOC_INPUT_WRONG = getLoc("INPUT_WRONG");
- private String LOC_INPUT_CORRECT = getLoc("INPUT_CORRECT");
- private String LOC_OUTPUT_MESSAGE = getLoc("OUTPUT_MESSAGE");
+ private String LOC_FIELDSET_HEADER = getLoc("FIELDSET_HEADER");
+ private String LOC_INPUT_WRONG = getLoc("INPUT_WRONG");
+ private String LOC_INPUT_CORRECT = getLoc("INPUT_CORRECT");
+ private String LOC_OUTPUT_MESSAGE = getLoc("OUTPUT_MESSAGE");
+ private String LOC_OUTPUT_ERROR = getLoc("OUTPUT_ERROR");
- private String MSG_INPUT_CORRECT = getMsg("INPUT_CORRECT");
- private String MSG_INPUT_WRONG = getMsg("INPUT_WRONG");
- private String MSG_OUTPUT_VALIDATOR_ERROR = getMsg("OUTPUT_VALIDATOR_ERROR");
+ private String MSG_INPUT_CORRECT = getMsg("INPUT_CORRECT");
+ private String MSG_INPUT_WRONG = getMsg("INPUT_WRONG");
+
+ /**
+ * Add correct text into wrong input, checks that no text and no error
+ * message appear.
+ */
+ @Test
+ public void testCorrectTextIntoWrongInput() {
+ enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_WRONG,
+ MSG_INPUT_CORRECT, false, false);
+ }
+
+ /**
+ * Enter wrong text into wrong input, checks that no text and no error
+ * message appear.
+ */
+ @Test
+ public void testWrongTextIntoWrongInput() {
+ enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_WRONG, MSG_INPUT_WRONG,
+ false, false);
+ }
+
+ /**
+ * Enter correct text into correct input, checks that text but no error
+ * message appear.
+ */
+ @Test
+ public void testCorrectTextIntoSuccessInput() {
+ enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_CORRECT,
+ MSG_INPUT_CORRECT, true, false);
+ }
- /**
- * Add correct text into wrong input, checks that no text and no error
- * message appear.
- */
- @Test
- public void testCorrectTextIntoWrongInput() {
- enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_WRONG, MSG_INPUT_CORRECT, false,
false);
- }
+ /**
+ * Enter wrong text into correct input, checks that no text but only error
+ * message appear.
+ */
+ @Test
+ public void testWrongTextIntoSuccessInput() {
+ enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_CORRECT, MSG_INPUT_WRONG, false,
true);
+ }
- /**
- * Enter wrong text into wrong input, checks that no text and no error
- * message appear.
- */
- @Test
- public void testWrongTextIntoWrongInput() {
- enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_WRONG, MSG_INPUT_WRONG, false,
false);
- }
+ private void enterTextAndCheckOutputAndErrorMessage(String locInput, final String
msgText,
+ final boolean textShouldAppear, final boolean errorMessageShouldAppear) {
+ selenium.type(locInput, msgText);
+ selenium.fireEvent(locInput, Event.KEYUP);
- /**
- * Enter correct text into correct input, checks that text but no error
- * message appear.
- */
- @Test
- public void testCorrectTextIntoSuccessInput() {
- enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_CORRECT, MSG_INPUT_CORRECT, true,
false);
- }
+ waitModelUpdate.dontFail().until(new Condition() {
+ public boolean isTrue() {
+ if (errorMessageShouldAppear || textShouldAppear) {
+ return getJQueryCount(format(LOC_OUTPUT_MESSAGE, msgText)) > 0
+ || getJQueryCount(LOC_OUTPUT_ERROR) > 0;
+ }
+ return false;
+ }
+ });
- /**
- * Enter wrong text into correct input, checks that no text but only error
- * message appear.
- */
- @Test
- public void testWrongTextIntoSuccessInput() {
- enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_CORRECT, MSG_INPUT_WRONG, false,
true);
- }
+ assertEquals(getJQueryCount(format(LOC_OUTPUT_MESSAGE, msgText)),
textShouldAppear ? 1 : 0,
+ textShouldAppear ? "Text output should appear" : "No text
output should appear");
+ assertEquals(getJQueryCount(LOC_OUTPUT_ERROR), errorMessageShouldAppear ? 1 : 0,
+ errorMessageShouldAppear ? "Error message should appear" :
"No error message should appear");
+ }
- private void enterTextAndCheckOutputAndErrorMessage(String locInput, final String
msgText,
- final boolean textShouldAppear, final boolean errorMessageShouldAppear) {
- selenium.type(locInput, msgText);
- selenium.fireEvent(locInput, Event.KEYUP);
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Output Panel");
- waitModelUpdate.dontFail().until(new Condition() {
- public boolean isTrue() {
- if (errorMessageShouldAppear || textShouldAppear) {
- return selenium.getXpathCount(format(LOC_OUTPUT_MESSAGE, msgText)).intValue() >
0
- || selenium.getXpathCount(format(LOC_OUTPUT_MESSAGE, MSG_OUTPUT_VALIDATOR_ERROR))
- .intValue() > 0;
- }
- return false;
- }
- });
-
- assertEquals(selenium.getXpathCount(format(LOC_OUTPUT_MESSAGE, msgText)),
textShouldAppear ? 1 : 0,
- textShouldAppear ? "Text output should appear" : "No text output
should appear");
- assertEquals(selenium.getXpathCount(format(LOC_OUTPUT_MESSAGE,
MSG_OUTPUT_VALIDATOR_ERROR)),
- errorMessageShouldAppear ? 1 : 0, errorMessageShouldAppear ? "Error message
should appear"
- : "No error message should appear");
- }
-
- @SuppressWarnings("unused")
- @BeforeMethod
- private void loadPage() {
- openComponent("Output Panel");
-
- scrollIntoView(LOC_FIELDSET_HEADER, true);
- }
+ scrollIntoView(LOC_FIELDSET_HEADER, true);
+ }
}
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/push/PushTestCase.java
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/push/PushTestCase.java 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/push/PushTestCase.java 2009-11-12
17:34:24 UTC (rev 15872)
@@ -46,7 +46,7 @@
@Test
public void testPushingProgress() {
setPushingStatus(true);
-
+
checkPushingProgress();
}
@@ -67,28 +67,32 @@
@Test
public void testPushingStopAndStart() {
setPushingStatus(false);
-
+
checkPushingStopped();
setPushingStatus(true);
-
+
checkPushingProgress();
setPushingStatus(false);
-
+
checkPushingStopped();
setPushingStatus(true);
-
+
checkPushingProgress();
}
private void checkPushingProgress() {
- assertTrue(isPushingActive(), "Pushing was inactive but should be active");
-
+ Wait.failWith("Pushing was inactive but should be
active").interval(200).timeout(10000).until(new Condition() {
+ public boolean isTrue() {
+ return isPushingActive();
+ }
+ });
+
final String oldOutput = selenium.getText(LOC_OUTPUT_TEXT);
- Wait.failWith("When waiting for text change, it never
happen").interval(2500).timeout(20000).until(
+ Wait.failWith("When waiting for text change, it never
happen").interval(1000).timeout(20000).until(
new Condition() {
public boolean isTrue() {
String actualOutput = selenium.getText(LOC_OUTPUT_TEXT);
@@ -107,13 +111,17 @@
}
private void checkPushingStopped() {
- assertFalse(isPushingActive(), "Pushing was active but expected to be
inactive");
-
+ Wait.failWith("Pushing was active but should be
inactive").interval(200).timeout(10000).until(new Condition() {
+ public boolean isTrue() {
+ return !isPushingActive();
+ }
+ });
+
String expected = MSG_OUTPUT_PUSH_INACTIVE;
for (int i = 0; i < 7; i++) {
if (i > 0)
- waitFor(2500);
+ waitFor(1000);
String actual = selenium.getText(LOC_OUTPUT_TEXT);
assertEquals(actual, expected);
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/status/StatusTestCase.java
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/status/StatusTestCase.java 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/status/StatusTestCase.java 2009-11-12
17:34:24 UTC (rev 15872)
@@ -47,7 +47,7 @@
private final String MSG_STYLE_DISPLAY = getMsg("STYLE_DISPLAY");
private final String MSG_PATTERN_NAME_JOB = getMsg("PATTERN_NAME_JOB");
-
+
/**
* <p>
* This test requests update by pressing button, waiting for processing
@@ -63,7 +63,7 @@
//
https://jira.jboss.org/jira/browse/JBQA-2606
@Test
public void testTextStatus() {
- doStatusTesting(1);
+ doStatusTesting(0);
}
/**
@@ -79,7 +79,7 @@
//
https://jira.jboss.org/jira/browse/JBQA-2606
@Test
public void testImageStatus() {
- doStatusTesting(2);
+ doStatusTesting(1);
}
/**
@@ -97,30 +97,30 @@
final String locOutputStatusMessage = format(LOC_OUTPUT_STATUS_MESSAGE_PREFORMATTED,
testNumber);
final String locButtonRequest = format(LOC_BUTTON_REQUEST_PREFORMATTED, testNumber);
- // get a initial style of status field
- final String initialStyle = getStyle(locOutputStatusMessage, MSG_STYLE_DISPLAY);
-
+ assertFalse(isDisplayed(locOutputStatusMessage), "Status message should not be
visible at start.");
+
+ // prepare both needed conditions for waiting so that it will be faster
+ Condition styleCondition = new Condition() {
+ public boolean isTrue() {
+ return isDisplayed(locOutputStatusMessage);
+ }
+ };
+
+ Condition styleConditionNot = new Condition() {
+ public boolean isTrue() {
+ return !isDisplayed(locOutputStatusMessage);
+ }
+ };
+
selenium.click(locButtonRequest);
-
+
// wait for style is changed to "processing" state indicates that
// request is in progress
- waitModelUpdate.interval(10).failWith("Test timeouted when waiting for request
moves to processing state.")
- .until(new Condition() {
- public boolean isTrue() {
- String actualStyle = getStyle(locOutputStatusMessage, MSG_STYLE_DISPLAY);
- return !initialStyle.equals(actualStyle);
- }
- });
+ waitModelUpdate.interval(0).failWith("Test timeouted when waiting for request
moves to processing state.").until(styleCondition);
// wait for style is changed back to initial state after request is
// complete
- waitModelUpdate.interval(10).failWith("Timeout when waiting for request moves to
complete state.").until(
- new Condition() {
- public boolean isTrue() {
- String actual = getStyle(locOutputStatusMessage, MSG_STYLE_DISPLAY);
- return initialStyle.equals(actual);
- }
- });
+ waitModelUpdate.interval(0).failWith("Timeout when waiting for request moves to
complete state.").until(styleConditionNot);
}
/**
@@ -137,10 +137,10 @@
//
https://jira.jboss.org/jira/browse/JBQA-2606
@Test
public void testInputsStatus() {
- scrollIntoView(format(LOC_FIELDSET_PAGE_PART_PREFORMATTED, 3), true);
+ scrollIntoView(format(LOC_FIELDSET_PAGE_PART_PREFORMATTED, 2), true);
// PAGE CONTROLS
- final String locOutputStatusMessage = format(LOC_OUTPUT_STATUS_MESSAGE_PREFORMATTED,
3);
+ final String locOutputStatusMessage = format(LOC_OUTPUT_STATUS_MESSAGE_PREFORMATTED,
2);
// init buffers for typed text for each input
StringBuilder textName = new StringBuilder();
@@ -148,12 +148,24 @@
// init pattern for getting name and job from output
Pattern patternNameJob = Pattern.compile(MSG_PATTERN_NAME_JOB);
-
- // get a initial value of status message's style
- final String initialStyle = getStyle(locOutputStatusMessage, MSG_STYLE_DISPLAY);
-
+
+ assertFalse(isDisplayed(locOutputStatusMessage), "Status message should not be
visible at start.");
+
+ // prepare both needed conditions for waiting so that it will be faster
+ Condition styleCondition = new Condition() {
+ public boolean isTrue() {
+ return isDisplayed(locOutputStatusMessage);
+ }
+ };
+
+ Condition styleConditionNot = new Condition() {
+ public boolean isTrue() {
+ return !isDisplayed(locOutputStatusMessage);
+ }
+ };
+
// cycle over 30 chars and alternating between two inputs
- for (int counter = 1; counter <= 30; counter++) {
+ for (int counter = 1; counter <= 15; counter++) {
// select input and it's buffered text by state of counter
final String selectedInput = (counter % 3 == 0) ? LOC_INPUT_NAME : LOC_INPUT_JOB;
final StringBuilder selectedText = (counter % 3 == 0) ? textName : textJob;
@@ -163,13 +175,15 @@
selenium.type(selectedInput, selectedText.toString());
selenium.fireEvent(selectedInput, Event.KEYUP);
+
+ // wait for style is changed to "processing" state indicates that
+ // request is in progress
+ waitModelUpdate.interval(0).failWith("Test timeouted when waiting for
request moves to processing state.").until(styleCondition);
- // wait for display-style changes to value different than initial
- waitForDisplayChanges(locOutputStatusMessage, initialStyle, false);
-
- // wait for display-style changes to initial value
- waitForDisplayChanges(locOutputStatusMessage, initialStyle, true);
-
+ // wait for style is changed back to initial state after request is
+ // complete
+ waitModelUpdate.interval(0).failWith("Timeout when waiting for request moves to
complete state.").until(styleConditionNot);
+
String outputText = selenium.getText(LOC_OUTPUT_TEXT);
// matches output to pattern declared above?
@@ -202,7 +216,7 @@
*/
private void waitForDisplayChanges(final String locator, final String initialStyle,
final boolean shouldEqualOldValue) {
- waitModelUpdate.interval(10).until(new Condition() {
+ waitModelUpdate.interval(0).until(new Condition() {
public boolean isTrue() {
String actualStyle = getStyle(locator, MSG_STYLE_DISPLAY);
return !shouldEqualOldValue ^ initialStyle.equals(actualStyle);
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dragSupport/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dragSupport/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dragSupport/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,7 +1,7 @@
-FIELDSET_HEADER=//legend[text()\='Drag-n-Drop example']
-CHOICES_OF_DIV_TARGETS=//div[text()\='{0,choice,1\#PHP
Frameworks|2\#.NET
Frameworks|3\#ColdFusion Frameworks}']/../../div
-DIV_DRAGGED_ITEM_PREFORMATTED=//table[contains(@id,'src')]//div[text()\='{0}']
-DIV_DRAG_INDICATOR=//*[@id\='indicator']
-CLASS_DRAG_INDICATOR=//*[@id\='indicator']/@class
-IMGSRC_DRAG_INDICATOR=//*[@id\='indicator']//td[1]/img/@src
-DIV_FIRST_INSERTED_ITEM_RELATIVE={0}/*[2]/*[2]/*/*/*[1]
+FIELDSET_HEADER=jquery=legend:textEquals(Drag-n-Drop example)
+CHOICES_OF_DIV_TARGETS=jquery=div.dropTargetPanel:eq({0})
+DIV_DRAGGED_ITEM_PREFORMATTED=jquery=table[id$=src] div:nth-child({0})
+DIV_DRAG_INDICATOR=jquery=div#indicator
+CLASS_DRAG_INDICATOR=jquery=div#indicator@class
+IMGSRC_DRAG_INDICATOR=jquery=div#indicator img@src
+DIV_FIRST_INSERTED_ITEM_RELATIVE={0} td:eq(0)
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/graphValidator/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/graphValidator/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/graphValidator/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,11 +1,11 @@
-FIELDSET_HEADER_USEF_INFO=//fieldset[1]//legend[text()\='Title']
-BUTTON_SUBMIT_USER_INFO=//input[@type\='button' and @value\='Store
changes']
+FIELDSET_HEADER_USEF_INFO=jquery=fieldset:eq(0) > legend
+BUTTON_SUBMIT_USER_INFO=jquery=input[value=Store changes]
INPUT_NAME=graphValidatorForm\:name
INPUT_AGE=graphValidatorForm\:age
INPUT_EMAIL=graphValidatorForm\:email
-VALIDATION_MESSAGE_RELATIVE=//input[@id\='{0}']/../../td[3]/*[1][(a)class\='rich-message']
-LOC_FIELDSET_HEADER_ACTIVITIES=//fieldset[2]//legend[text()\='Title']
-BUTTON_SUBMIT_ACTIVITIES=//input[@type\='button' and @value\='Store my
details']
-OUTPUT_VALIDATION_MESSAGE=//form[@name\="graphValidatorForm2"]//*[@class\="rich-messages-label"]
-CLASS_VALIDATION_MESSAGE=//form[@name\="graphValidatorForm2"]/*[@class\="rich-messages"]/*/@class
-INPUT_ACTIVITY_HOURS_PREFORMATTED=//form[@id\='graphValidatorForm2']/table/tbody/tr[{0}]//input[@type\='text']
+VALIDATION_MESSAGE_RELATIVE=jquery=fieldset tr:has(input[id={0}])
span[class=rich-message]
+LOC_FIELDSET_HEADER_ACTIVITIES=jquery=fieldset:eq(1) > legend
+BUTTON_SUBMIT_ACTIVITIES=jquery=input[value=Store my details]
+OUTPUT_VALIDATION_MESSAGE=jquery=form#graphValidatorForm2 span.rich-messages-label
+CLASS_VALIDATION_MESSAGE=jquery=form#graphValidatorForm2 dt@class
+INPUT_ACTIVITY_HOURS_PREFORMATTED=jquery=form#graphValidatorForm2 > table > tbody
> tr:nth-child({0}) input.rich-spinner-input
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,11 +1,11 @@
-FIELDSET_HEADER=//legend[text()\='Include example']
-BUTTON_PREVIOUS=//*[@type\='button' and @value\='<<Previous']
-BUTTON_NEXT=//*[@type\='button' and @value\='Next >>']
-INPUT_FIRSTNAME=//*[text()\='First Name\:']/../*[2]/*[@type\='text']
-INPUT_LASTNAME=//*[text()\='Last Name\:']/../*[2]/*[@type\='text']
-INPUT_COMPANY=//*[text()\='Company\:']/../*[2]/*[@type\='text']
-INPUT_NOTES=//*[contains(@id, 'notes')]
-OUTPUT_FIRSTNAME=//*[text()\='First Name\:']/../*[2]
-OUTPUT_LASTNAME=//*[text()\='Last Name\:']/../*[2]
-OUTPUT_COMPANY=//*[text()\='Company\:']/../*[2]
-OUTPUT_NOTES=//*[text()\='Notes\:']/../*[2]
+FIELDSET_HEADER=jquery=legend:textEquals(Include example)
+BUTTON_PREVIOUS=jquery=input[value=<<Previous]
+BUTTON_NEXT=jquery=input[value=Next >>]
+INPUT_FIRSTNAME=jquery=tr[class=s1row]:eq(0) input
+INPUT_LASTNAME=jquery=tr[class=s1row]:eq(1) input
+INPUT_COMPANY=jquery=tr[class=s1row]:eq(2) input
+INPUT_NOTES=jquery=textarea[id$=notes]
+OUTPUT_FIRSTNAME=jquery=fieldset form tr:eq(0) td:eq(1)
+OUTPUT_LASTNAME=jquery=fieldset form tr:eq(1) td:eq(1)
+OUTPUT_COMPANY=jquery=fieldset form tr:eq(2) td:eq(1)
+OUTPUT_NOTES=jquery=fieldset form tr:eq(3) td:eq(1)
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/jsFunction/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/jsFunction/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/jsFunction/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,2 +1,2 @@
-SPAN_HOVER_ACTIVATED=//fieldset[1]/div[1]/table[1]//span[text()\='{0}']
-OUTPUT_NAME=//*[@id\='showname']
+SPAN_HOVER_ACTIVATED=jquery=fieldset span:textEquals({0})
+OUTPUT_NAME=jquery=span#showname
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/keepAlive/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/keepAlive/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/keepAlive/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,8 +1,8 @@
-INPUT_INCORRECT1=//fieldset/div/table/tbody/tr[2]/td[1]/form/input[@type\='text'][1]
-INPUT_INCORRECT2=//fieldset/div/table/tbody/tr[2]/td[1]/form/input[@type\='text'][2]
-BUTTON_INCORRECT=//fieldset/div/table/tbody/tr[2]/td[1]/form/*[@type\='button']
-OUTPUT_INCORRECT=//fieldset/div/table/tbody/tr[2]/td[1]/form/*[contains(@id,
'sum')]
-INPUT_CORRECT1=//fieldset/div/table/tbody/tr[2]/td[2]/form/input[@type\='text'][1]
-INPUT_CORRECT2=//fieldset/div/table/tbody/tr[2]/td[2]/form/input[@type\='text'][2]
-BUTTON_CORRECT=//fieldset/div/table/tbody/tr[2]/td[2]/form/*[@type\='button']
-OUTPUT_CORRECT=//fieldset/div/table/tbody/tr[2]/td[2]/form/*[contains(@id,
'sum')]
+INPUT_INCORRECT1=jquery=fieldset form:eq(0) input[type=text]:eq(0)
+INPUT_INCORRECT2=jquery=fieldset form:eq(0) input[type=text]:eq(1)
+BUTTON_INCORRECT=jquery=fieldset form:eq(0) input[type=button]
+OUTPUT_INCORRECT=jquery=fieldset form:eq(0) span[id*=sum]
+INPUT_CORRECT1=jquery=fieldset form:eq(1) input[type=text]:eq(0)
+INPUT_CORRECT2=jquery=fieldset form:eq(1) input[type=text]:eq(1)
+BUTTON_CORRECT=jquery=fieldset form:eq(1) input[type=button]
+OUTPUT_CORRECT=jquery=fieldset form:eq(1) span[id*=sum]
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,5 +1,5 @@
-FIELDSET_HEADER=//legend[text()\='Log demo']
-INPUT_TEXT=//input[@type\='text']
-BUTTON_CLEAR=//button[text()\='Clear']
-OUTPUT_LOG_CONSOLE //div[@id\='logConsole']
-DIV_LOG_CONSOLE_ENTRY=//div[@id\='logConsole']/div
+FIELDSET_HEADER=jquery=legend:textEquals(Log demo)
+INPUT_TEXT=jquery=input[type=text]
+BUTTON_CLEAR=jquery=button:textEquals(Clear)
+OUTPUT_LOG_CONSOLE=jquery=div#logConsole
+DIV_LOG_CONSOLE_ENTRY=jquery=div#logConsole > div
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,3 +1,3 @@
-FIELDSET_HEADER=//legend[text()\='MediaOutput example']
-ATTRIBUTE_FLASH_HREF=//a[@id\='swfLink']/@href
-ATTRIBUTE_IMAGE_SRC=//p[text()\='Dynamically generated JPEG file\:']/../img/@src
+FIELDSET_HEADER=jquery=legend:textEquals(MediaOutput example)
+ATTRIBUTE_FLASH_HREF=jquery=a#swfLink@href
+ATTRIBUTE_IMAGE_SRC=jquery=div.sample-container > img@src
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,4 +1,5 @@
-FIELDSET_HEADER=//legend[text()\='OutputPanel example']
-INPUT_WRONG=//input[@type\='text' and contains(@id,'text1')]
-INPUT_CORRECT=//input[@type\='text' and contains(@id,'text2')]
-OUTPUT_MESSAGE=//*[contains(text(),'{0}')]
+FIELDSET_HEADER=jquery=legend:textEquals(OutputPanel example)
+INPUT_WRONG=jquery=input[id$=text1]
+INPUT_CORRECT=jquery=input[id$=text2]
+OUTPUT_MESSAGE=jquery=span:textEndsWith({0})
+OUTPUT_ERROR=jquery=fieldset tr span > span
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/messages.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/messages.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/messages.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,3 +1,2 @@
INPUT_CORRECT=1234567890
INPUT_WRONG=12345678901
-OUTPUT_VALIDATOR_ERROR=Validation Error
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/poll/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/poll/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/poll/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,3 +1,3 @@
-OUTPUT_POLL_STATUS=//*[starts-with(text(), 'Polling')]
-BUTTON_POLL_CONTROL=//*[@type\='button' and contains(@id, 'control')]
-OUTPUT_SERVER_DATE=//*[starts-with(text(), 'Server Date\:')]
+OUTPUT_POLL_STATUS=jquery=table[id$=grid] table td:eq(0)
+BUTTON_POLL_CONTROL=jquery=input[type=button]
+OUTPUT_SERVER_DATE=jquery=span[id$=serverDate]
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/push/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/push/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/push/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,2 +1,2 @@
-BUTTON_POLL_CONTROL=//*[@type\='button' and (@value\='Start' or
@value\='Stop')]
-OUTPUT_TEXT=//*[text()\='Press Start to run push example' or starts-with(text(),
'Generated UUID\:')]
+BUTTON_POLL_CONTROL=jquery=input[type=button]
+OUTPUT_TEXT=jquery=table[id$=out] td:eq(0)
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/queue/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/queue/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/queue/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,12 +1,13 @@
-BUTTON_IMAGE_PREFORMATTED=//*[@id\='_{0}']
-OUTPUT_QUEUE_ITEM=//*[@id\='tr1']//*[starts-with(text(),'_{0}')]
-FIELDSET_HEADER=//legend[text()\='Queue demo']
-INPUT_TYPED_TEXT=//*[text()\='Type here\:']/../*/*[@type\='text']
-OUTPUT_TYPED_TEXT=//*[text()\='Repeated text\:']/../*/*
-OUTPUT_EVENTS_COUNT=//*[text()\='Events count\:']/../*/*
-OUTPUT_REQUESTS_COUNT=//*[text()\='Requests count\:']/../*/*
-OUTPUT_DOM_UPDATES_COUNT=//*[text()\='DOM updates count\:']/../*/*
-INPUT_REQUEST_DELAY=//*[text()\='Request delay\:']/../*/*[@type\='text']
-CHECKBOX_IGNORE_DUP_RESPONSES=//*[text()\='Ignore Duplicated
Responces']/../*/*[@type\='checkbox']
-CHECKBOX_DISABLE_QUEUE=//*[text()\='Disable
Queue']/../*/*[@type\='checkbox']
-BUTTON_APPLY_SETTINGS=//*[@type\='submit' and @value\='Apply']
+BUTTON_IMAGE_PREFORMATTED=jquery=input#_{0}
+OUTPUT_QUEUE_ITEM=jquery=#tr1 td:textStartsWith(_{0})
+
+FIELDSET_HEADER=jquery=legend:textEquals(Queue demo)
+INPUT_TYPED_TEXT=jquery=input[id=form:myinput]
+OUTPUT_TYPED_TEXT=jquery=span[id=form:outtext]
+OUTPUT_EVENTS_COUNT=jquery=span[id=form:events]
+OUTPUT_REQUESTS_COUNT=jquery=span[id=form:requests]
+OUTPUT_DOM_UPDATES_COUNT=jquery=span[id=form:updates]
+INPUT_REQUEST_DELAY=jquery=input[id=form:delay]
+CHECKBOX_IGNORE_DUP_RESPONSES=jquery=input[type=checkbox]:eq(0)
+CHECKBOX_DISABLE_QUEUE=jquery=input[type=checkbox]:eq(1)
+BUTTON_APPLY_SETTINGS=jquery=input[value=Apply]
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/script/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/script/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/script/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,9 +1,9 @@
-FIELDSET_HEADER=//legend[text()\='Script demo']
-BUTTON_HIDE=//*[@type\='submit' and @value\='Hide']
-BUTTON_SHOW=//*[@type\='submit' and @value\='Show']
-BUTTON_SUBMIT=//*[@type\='submit' and @value\='Submit']
-INPUT_NAME=//span[text()\='Name\:']/../../td[2]/input[@type\='text']
-INPUT_JOB=//span[text()\='Job\:']/../../td[2]/input[@type\='text']
-OUTPUT_NAME=//*[@id\='out']//*[starts-with(text(), 'Name\:')]
-OUTPUT_JOB=//*[@id\='out']//*[starts-with(text(), 'Job\:')]
-PANEL_HIDABLE=//div[@id\='mypanel']
+FIELDSET_HEADER=jquery=legend:textEquals(Script demo)
+BUTTON_HIDE=jquery=input[value=Hide]
+BUTTON_SHOW=jquery=input[value=Show]
+BUTTON_SUBMIT=jquery=input[value=Submit]
+INPUT_NAME=jquery=input.rsInput:eq(0)
+INPUT_JOB=jquery=input.rsInput:eq(1)
+OUTPUT_NAME=jquery=#out td:eq(3)
+OUTPUT_JOB=jquery=#out td:eq(4)
+PANEL_HIDABLE=jquery=div#mypanel
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/status/locators.properties
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/status/locators.properties 2009-11-12
12:07:03 UTC (rev 15871)
+++
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/status/locators.properties 2009-11-12
17:34:24 UTC (rev 15872)
@@ -1,6 +1,6 @@
-FIELDSET_PAGE_PART_PREFORMATTED=//fieldset[{0}]
-OUTPUT_STATUS_MESSAGE_PREFORMATTED=//fieldset[{0}]//*[contains(@id,
'status.start')]
-BUTTON_REQUEST_PREFORMATTED=//fieldset[{0}]/div//input[@type\='button']
-INPUT_NAME=//fieldset[3]//*[@type\='text' and contains(@id, 'name')]
-INPUT_JOB=//fieldset[3]//*[@type\='text' and contains(@id, 'job')]
-OUTPUT_TEXT=//*[contains(@id,'out') and starts-with(text(),'Name\:')]
\ No newline at end of file
+FIELDSET_PAGE_PART_PREFORMATTED=jquery=fieldset:eq({0})
+OUTPUT_STATUS_MESSAGE_PREFORMATTED=jquery=fieldset:eq({0}) span[id$=status.start]
+BUTTON_REQUEST_PREFORMATTED=jquery=fieldset:eq({0}) input[type=button]
+INPUT_NAME=jquery=input[id$=name]
+INPUT_JOB=jquery=input[id$=job]
+OUTPUT_TEXT=jquery=span[id$=out]
\ No newline at end of file