JBoss Rich Faces SVN: r15582 - branches/community/3.3.X/docs/common-resources/en/src/main/css.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-09-15 12:09:14 -0400 (Tue, 15 Sep 2009)
New Revision: 15582
Modified:
branches/community/3.3.X/docs/common-resources/en/src/main/css/html-common.css
Log:
https://jira.jboss.org/jira/browse/RF-7471
added styles for tbody td p
Modified: branches/community/3.3.X/docs/common-resources/en/src/main/css/html-common.css
===================================================================
--- branches/community/3.3.X/docs/common-resources/en/src/main/css/html-common.css 2009-09-15 15:51:27 UTC (rev 15581)
+++ branches/community/3.3.X/docs/common-resources/en/src/main/css/html-common.css 2009-09-15 16:09:14 UTC (rev 15582)
@@ -46,8 +46,8 @@
display: block;
float: right;
}
+tbody td p {margin: 1px; padding: 1px;}
-
span.since sup {
color:#6e6e6e;
font-size:0.7em;
15 years, 3 months
JBoss Rich Faces SVN: r15581 - in branches/community/3.3.X/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-09-15 11:51:27 -0400 (Tue, 15 Sep 2009)
New Revision: 15581
Modified:
branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml
branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxLogTest.java
branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java
branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TooltipTest.java
Log:
RFPL-143
Modified: branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml
===================================================================
--- branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml 2009-09-15 15:05:04 UTC (rev 15580)
+++ branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml 2009-09-15 15:51:27 UTC (rev 15581)
@@ -5,7 +5,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:inputHidden id="_auto_input" value="#{autoTestBean.input}" required="true"></h:inputHidden>
- <h:outputText id="_auto_request_params" style="display: none;" value="#{requestBean.paramString}" />
+ <h:outputText id="_auto_request_params" value="#{requestBean.paramString}" />
<h:inputHidden id="_auto_process_input" value="#{autoTestBean.processInput}" valueChangeListener="#{autoTestBean.processInputChangeListener}"></h:inputHidden>
<a4j:outputPanel ajaxRendered="true">
<h:outputText id="_auto_status" value="#{autoTestBean.status}"></h:outputText>
Modified: branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxLogTest.java
===================================================================
--- branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxLogTest.java 2009-09-15 15:05:04 UTC (rev 15580)
+++ branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxLogTest.java 2009-09-15 15:51:27 UTC (rev 15581)
@@ -145,8 +145,9 @@
Assert.fail("log must be empty");
}
}
-
- @Test
+
+ //https://jira.jboss.org/jira/browse/RF-6036
+ @Test(groups=FAILURES_GROUP)
public void testStylesAndClassesAndHtmlAttributes(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
Modified: branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java
===================================================================
--- branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java 2009-09-15 15:05:04 UTC (rev 15580)
+++ branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java 2009-09-15 15:51:27 UTC (rev 15581)
@@ -187,8 +187,9 @@
selenium.click(nothingLabelItemXpath);
AssertValueEquals(componentId, "Azir");
}
-
- @Test
+
+ //https://jira.jboss.org/jira/browse/RF-6676
+ @Test(groups=FAILURES_GROUP)
public void testStylesAndClassesAndHtmlAttributes(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
Modified: branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TooltipTest.java
===================================================================
--- branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TooltipTest.java 2009-09-15 15:05:04 UTC (rev 15580)
+++ branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TooltipTest.java 2009-09-15 15:51:27 UTC (rev 15581)
@@ -99,7 +99,7 @@
writeStatus("Component retrieves data from server; 'defaultContent' facet is handled; listeners fire");
String componentId = autoTester.getClientId(AutoTester.COMPONENT_ID);
String contentId = autoTester.getClientId(AutoTester.COMPONENT_ID + "content");
- String defaultContentId = autoTester.getClientId(AutoTester.COMPONENT_ID + "defaultContent");
+ String defaultContentId = "//*[@id='" + autoTester.getClientId(AutoTester.COMPONENT_ID + "defaultContent") + "']/strong/text()";
triggerTooltip();
writeStatus("Check 'defaultContent' feature");
15 years, 3 months
JBoss Rich Faces SVN: r15580 - in branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp: stylesheet and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-09-15 11:05:04 -0400 (Tue, 15 Sep 2009)
New Revision: 15580
Modified:
branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp/layout/template.xhtml
branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp/stylesheet/photoalbum.css
Log:
Investigate and fix photoalbum tests
https://jira.jboss.org/jira/browse/RFPL-86
Modified: branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp/layout/template.xhtml
===================================================================
(Binary files differ)
Modified: branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp/stylesheet/photoalbum.css
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp/stylesheet/photoalbum.css 2009-09-15 14:06:05 UTC (rev 15579)
+++ branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp/stylesheet/photoalbum.css 2009-09-15 15:05:04 UTC (rev 15580)
@@ -1,3 +1,14 @@
+* {
+ font-family: verdana;
+ font-size: 11px;
+}
+
+html, body {
+ height: 100%;
+ margin: 0px;
+ padding: 0px;
+}
+
.main-body {
margin: 0px;
height: 100%;
15 years, 3 months
JBoss Rich Faces SVN: r15579 - branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-09-15 10:06:05 -0400 (Tue, 15 Sep 2009)
New Revision: 15579
Modified:
branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
Log:
Modified: branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
--- branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2009-09-15 12:59:18 UTC (rev 15578)
+++ branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2009-09-15 14:06:05 UTC (rev 15579)
@@ -333,7 +333,7 @@
// we want to avoid rendering toolTip content during initialy page
// displaying
AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
- if (ajaxContext != null && (ajaxContext.getAjaxAreasToRender().contains(clientId + "content") || !ajaxContext.isAjaxRequest())) {
+ if (ajaxContext != null && ajaxContext.getAjaxAreasToRender().contains(clientId + "content") ) {
responseWriter.write(value != null ? value.toString() : "");
15 years, 3 months
JBoss Rich Faces SVN: r15578 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest: pickList and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2009-09-15 08:59:18 -0400 (Tue, 15 Sep 2009)
New Revision: 15578
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelMenu/PanelMenuTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/pickList/PickListTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/suggestionBox/SuggestionBoxTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/toolBar/ToolBarTestCase.java
Log:
* test cases refactored to provide more stable results
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelMenu/PanelMenuTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelMenu/PanelMenuTestCase.java 2009-09-15 12:33:45 UTC (rev 15577)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelMenu/PanelMenuTestCase.java 2009-09-15 12:59:18 UTC (rev 15578)
@@ -27,6 +27,8 @@
import static org.testng.Assert.assertTrue;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
+import org.jboss.test.selenium.waiting.Condition;
+import org.jboss.test.selenium.waiting.Wait;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -165,10 +167,19 @@
// check items on the first level (1.1, 1.2, etc.)
for (int i = 1; i < 4; i++) {
- selenium.click(format(LOC_GROUP_N_TEXT, i));
- for (int j = 1; j < 4; j++) {
- selenium.click(format(LOC_ITEM_M_N_TEXT, i, j));
- waitFor(500); // it use Ajax mode
+ final int newI = i;
+ selenium.click(format(LOC_GROUP_N_TEXT, i));
+
+ for (int j = 1; j < 4; j++) {
+ final int newJ = j;
+ selenium.click(format(LOC_ITEM_M_N_TEXT, i, j));
+
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return format("Item {0}.{1} selected", newI, newJ).equals(selenium.getText(LOC_PANEL));
+ }
+ });
+
text = selenium.getText(LOC_PANEL);
assertEquals(text, format("Item {0}.{1} selected", i, j), MSG_CONTENT_OF_PANEL);
}
@@ -177,9 +188,16 @@
// check items on the second level (2.4.1, 2.4.2, 2.4.3)
selenium.click(format(LOC_ITEM_M_N_TEXT, 2, 4));
for (int i = 1; i < 4; i++) {
- selenium.click(format(LOC_SUBITEM_M_TEXT, i));
- waitFor(500); // it use Ajax mode
- text = selenium.getText(LOC_PANEL);
+ final int newI = i;
+ selenium.click(format(LOC_SUBITEM_M_TEXT, i));
+
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return format("Item 2.4.{0} selected", newI).equals(selenium.getText(LOC_PANEL));
+ }
+ });
+
+ text = selenium.getText(LOC_PANEL);
assertEquals(text, format("Item 2.4.{0} selected", i), MSG_CONTENT_OF_PANEL);
}
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/pickList/PickListTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/pickList/PickListTestCase.java 2009-09-15 12:33:45 UTC (rev 15577)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/pickList/PickListTestCase.java 2009-09-15 12:59:18 UTC (rev 15578)
@@ -26,6 +26,8 @@
import static org.testng.Assert.assertTrue;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
+import org.jboss.test.selenium.waiting.Condition;
+import org.jboss.test.selenium.waiting.Wait;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -87,13 +89,16 @@
public void testFirstCopySingleItem() {
scrollIntoView(LOC_FIRST_EXAMPLE_HEADER, true);
- int count = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
+ final int count = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
selenium.click(LOC_FIRST_LEFT_FIRST_ITEM);
selenium.click(LOC_FIRST_BUTTON_COPY);
- int newCount = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
- assertEquals(newCount, count - 1, "There should be less lines in the left table.");
+ Wait.failWith("There should be less lines in the left table.").until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue() == count -1;
+ }
+ });
}
// @Test
@@ -113,15 +118,18 @@
public void testFirstCopyAll() {
scrollIntoView(LOC_FIRST_EXAMPLE_HEADER, true);
- int count = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
+ final int count = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
selenium.click(LOC_FIRST_BUTTON_COPY_ALL);
+ Wait.failWith("All items from left table should be now in the right table.").until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue() == count;
+ }
+ });
+
int newCount = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
assertEquals(newCount, 0, "There should be no lines in the left table.");
-
- newCount = selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue();
- assertEquals(newCount, count, "All items from left table should be now in the right table.");
}
/**
@@ -133,13 +141,16 @@
selenium.click(LOC_FIRST_BUTTON_COPY_ALL);
- int count = selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue();
+ final int count = selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue();
selenium.click(LOC_FIRST_RIGHT_FIRST_ITEM);
selenium.click(LOC_FIRST_BUTTON_REMOVE);
- int newCount = selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue();
- assertEquals(newCount, count - 1, "There should be less lines in the right table.");
+ Wait.failWith("There should be less lines in the right table.").until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue() == count - 1;
+ }
+ });
}
// @Test
@@ -159,15 +170,18 @@
public void testFirstRemoveAll() {
scrollIntoView(LOC_FIRST_EXAMPLE_HEADER, true);
- int count = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
+ final int count = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
selenium.click(LOC_FIRST_BUTTON_COPY_ALL);
selenium.click(LOC_FIRST_BUTTON_REMOVE_ALL);
- int newCount = selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue();
- assertEquals(newCount, 0, "There should be no lines in the right table.");
-
- newCount = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
+ Wait.failWith("There should be no lines in the right table.").until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue() == 0;
+ }
+ });
+
+ int newCount = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
assertEquals(newCount, count, "All items from right table should be now in the left table.");
}
@@ -200,12 +214,15 @@
selenium.click(LOC_SECOND_LEFT_FIRST_ITEM);
selenium.click(LOC_SECOND_BUTTON_COPY);
+ Wait.failWith("There should be only one capital city.").until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getXpathCount(LOC_SECOND_CHOSEN_OPTIONS_LI).intValue() == 1;
+ }
+ });
+
int newCount = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
assertEquals(newCount, count - 1, "There should be less lines in the left table.");
- count = selenium.getXpathCount(LOC_SECOND_CHOSEN_OPTIONS_LI).intValue();
- assertEquals(count, 1, "There should be only one capital city.");
-
String capital = selenium.getText(LOC_SECOND_CHOSEN_OPTIONS_LI1);
assertEquals(capital, "Montgomery", "Capital of Alaska.");
}
@@ -227,10 +244,16 @@
public void testSecondCopyAll() {
scrollIntoView(LOC_SECOND_EXAMPLE_HEADER, true);
- int count = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
+ final int count = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
selenium.click(LOC_SECOND_BUTTON_COPY_ALL);
+ Wait.failWith("Not all capital cities were displayed in the panel.").until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getXpathCount(LOC_SECOND_CHOSEN_OPTIONS_LI).intValue() == count;
+ }
+ });
+
int newCount = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
assertEquals(newCount, 0, "There should be no lines in the left table.");
@@ -250,11 +273,17 @@
selenium.click(LOC_SECOND_BUTTON_COPY_ALL);
- int count = selenium.getXpathCount(LOC_SECOND_RIGHT_ITEMS).intValue();
+ final int count = selenium.getXpathCount(LOC_SECOND_RIGHT_ITEMS).intValue();
selenium.click(LOC_SECOND_RIGHT_FIRST_ITEM);
selenium.click(LOC_SECOND_BUTTON_REMOVE);
+ Wait.failWith("The capital city was not removed from panel.").until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getXpathCount(LOC_SECOND_CHOSEN_OPTIONS_LI).intValue() == count - 1;
+ }
+ });
+
int newCount = selenium.getXpathCount(LOC_SECOND_RIGHT_ITEMS).intValue();
assertEquals(newCount, count - 1, "There should be less lines in the right table.");
@@ -284,14 +313,17 @@
selenium.click(LOC_SECOND_BUTTON_COPY_ALL);
selenium.click(LOC_SECOND_BUTTON_REMOVE_ALL);
+ Wait.failWith("All capitals from the panel should be removed.").until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getXpathCount(LOC_SECOND_CHOSEN_OPTIONS_LI).intValue() == 0;
+ }
+ });
+
int newCount = selenium.getXpathCount(LOC_SECOND_RIGHT_ITEMS).intValue();
assertEquals(newCount, 0, "There should be no lines in the right table.");
newCount = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
assertEquals(newCount, count, "All items from right table should be now in the left table.");
-
- count = selenium.getXpathCount(LOC_SECOND_CHOSEN_OPTIONS_LI).intValue();
- assertEquals(count, 0, "All capitals from the panel should be removed.");
}
/**
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/suggestionBox/SuggestionBoxTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/suggestionBox/SuggestionBoxTestCase.java 2009-09-15 12:33:45 UTC (rev 15577)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/suggestionBox/SuggestionBoxTestCase.java 2009-09-15 12:59:18 UTC (rev 15578)
@@ -25,6 +25,8 @@
import static org.testng.Assert.assertEquals;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
+import org.jboss.test.selenium.waiting.Condition;
+import org.jboss.test.selenium.waiting.Wait;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -189,17 +191,32 @@
scrollIntoView(LOC_FIRST_INPUT, true);
selenium.type(LOC_FIRST_BORDER_INPUT, "3");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_BORDER_STYLE, "border-width") == 3;
+ }
+ });
+
int width = getValue(LOC_FIRST_BORDER_STYLE, "border-width");
assertEquals(width, 3, format(MSG_SUGGESTION_BOX_BORDER_PREFORMATTED, 3));
selenium.type(LOC_FIRST_BORDER_INPUT, "5");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_BORDER_STYLE, "border-width") == 5;
+ }
+ });
+
width = getValue(LOC_FIRST_BORDER_STYLE, "border-width");
assertEquals(width, 5, format(MSG_SUGGESTION_BOX_BORDER_PREFORMATTED, 5));
selenium.type(LOC_FIRST_BORDER_INPUT, "7"); // 7 -> 5
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_BORDER_STYLE, "border-width") == 5;
+ }
+ });
+
width = getValue(LOC_FIRST_BORDER_STYLE, "border-width");
assertEquals(width, 5, format(MSG_SUGGESTION_BOX_BORDER_PREFORMATTED, 7));
}
@@ -212,22 +229,42 @@
scrollIntoView(LOC_FIRST_INPUT, true);
selenium.type(LOC_FIRST_WIDTH_INPUT, "150");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_WIDTH_STYLE, "width") == 150;
+ }
+ });
+
int width = getValue(LOC_FIRST_WIDTH_STYLE, "width");
assertEquals(width, 150, format(MSG_SUGGESTION_BOX_WIDTH_PREFORMATTED, 150));
selenium.type(LOC_FIRST_WIDTH_INPUT, "350");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_WIDTH_STYLE, "width") == 350;
+ }
+ });
+
width = getValue(LOC_FIRST_WIDTH_STYLE, "width");
assertEquals(width, 350, format(MSG_SUGGESTION_BOX_WIDTH_PREFORMATTED, 350));
selenium.type(LOC_FIRST_WIDTH_INPUT, "400"); // 400 -> 350
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_WIDTH_STYLE, "width") == 350;
+ }
+ });
+
width = getValue(LOC_FIRST_WIDTH_STYLE, "width");
assertEquals(width, 350, format(MSG_SUGGESTION_BOX_WIDTH_PREFORMATTED, 400));
selenium.type(LOC_FIRST_WIDTH_INPUT, "176"); // 176 -> 200
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_WIDTH_STYLE, "width") == 200;
+ }
+ });
+
width = getValue(LOC_FIRST_WIDTH_STYLE, "width");
assertEquals(width, 200, format(MSG_SUGGESTION_BOX_WIDTH_PREFORMATTED, 176));
}
@@ -240,22 +277,42 @@
scrollIntoView(LOC_FIRST_INPUT, true);
selenium.type(LOC_FIRST_HEIGHT_INPUT, "100");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_HEIGHT_STYLE, "height") == 100;
+ }
+ });
+
int height = getValue(LOC_FIRST_HEIGHT_STYLE, "height");
assertEquals(height, 100, format(MSG_SUGGESTION_BOX_HEIGHT_PREFORMATTED, 100));
selenium.type(LOC_FIRST_HEIGHT_INPUT, "300");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_HEIGHT_STYLE, "height") == 300;
+ }
+ });
+
height = getValue(LOC_FIRST_HEIGHT_STYLE, "height");
assertEquals(height, 300, format(MSG_SUGGESTION_BOX_HEIGHT_PREFORMATTED, 300));
selenium.type(LOC_FIRST_HEIGHT_INPUT, "400"); // 400 -> 300
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_HEIGHT_STYLE, "height") == 300;
+ }
+ });
+
height = getValue(LOC_FIRST_HEIGHT_STYLE, "height");
assertEquals(height, 300, format(MSG_SUGGESTION_BOX_HEIGHT_PREFORMATTED, 400));
selenium.type(LOC_FIRST_HEIGHT_INPUT, "176"); // 176 -> 200
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_HEIGHT_STYLE, "height") == 200;
+ }
+ });
+
height = getValue(LOC_FIRST_HEIGHT_STYLE, "height");
assertEquals(height, 200, format(MSG_SUGGESTION_BOX_HEIGHT_PREFORMATTED, 176));
}
@@ -269,28 +326,48 @@
scrollIntoView(LOC_FIRST_INPUT, true);
selenium.type(LOC_FIRST_SHADOW_DEPTH_INPUT, "3");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "top") == 3;
+ }
+ });
+
int top = getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "top");
assertEquals(top, 3, format(MSG_SUGGESTION_BOX_SHADOW_DEPTH_PREFORMATTED, 3));
int left = getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "left");
assertEquals(left, 3, format(MSG_SUGGESTION_BOX_SHADOW_DEPTH_PREFORMATTED, 3));
selenium.type(LOC_FIRST_SHADOW_DEPTH_INPUT, "5");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "top") == 5;
+ }
+ });
+
top = getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "top");
assertEquals(top, 5, format(MSG_SUGGESTION_BOX_SHADOW_DEPTH_PREFORMATTED, 5));
left = getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "left");
assertEquals(left, 5, format(MSG_SUGGESTION_BOX_SHADOW_DEPTH_PREFORMATTED, 5));
selenium.type(LOC_FIRST_SHADOW_DEPTH_INPUT, "6");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "top") == 6;
+ }
+ });
+
top = getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "top");
assertEquals(top, 6, format(MSG_SUGGESTION_BOX_SHADOW_DEPTH_PREFORMATTED, 6));
left = getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "left");
assertEquals(left, 6, format(MSG_SUGGESTION_BOX_SHADOW_DEPTH_PREFORMATTED, 6));
selenium.type(LOC_FIRST_SHADOW_DEPTH_INPUT, "7"); // 7 -> 6
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "top") == 6;
+ }
+ });
+
top = getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "top");
assertEquals(top, 6, format(MSG_SUGGESTION_BOX_SHADOW_DEPTH_PREFORMATTED, 7));
left = getValue(LOC_FIRST_SHADOW_DEPTH_STYLE, "left");
@@ -305,22 +382,42 @@
scrollIntoView(LOC_FIRST_INPUT, true);
selenium.type(LOC_FIRST_SHADOW_OPACITY_INPUT, "1");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getOpacity(LOC_FIRST_SHADOW_OPACITY_STYLE) == 0.1;
+ }
+ });
+
double opacity = getOpacity(LOC_FIRST_SHADOW_OPACITY_STYLE);
assertEquals(opacity, 0.1, format(MSG_SUGGESTION_BOX_SHADOW_OPACITY_PREFORMATTED, 1));
selenium.type(LOC_FIRST_SHADOW_OPACITY_INPUT, "5");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getOpacity(LOC_FIRST_SHADOW_OPACITY_STYLE) == 0.5;
+ }
+ });
+
opacity = getOpacity(LOC_FIRST_SHADOW_OPACITY_STYLE);
assertEquals(opacity, 0.5, format(MSG_SUGGESTION_BOX_SHADOW_OPACITY_PREFORMATTED, 5));
selenium.type(LOC_FIRST_SHADOW_OPACITY_INPUT, "9");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getOpacity(LOC_FIRST_SHADOW_OPACITY_STYLE) == 0.9;
+ }
+ });
+
opacity = getOpacity(LOC_FIRST_SHADOW_OPACITY_STYLE);
assertEquals(opacity, 0.9, format(MSG_SUGGESTION_BOX_SHADOW_OPACITY_PREFORMATTED, 9));
selenium.type(LOC_FIRST_SHADOW_OPACITY_INPUT, "11"); // 11 -> 9
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return getOpacity(LOC_FIRST_SHADOW_OPACITY_STYLE) == 0.9;
+ }
+ });
+
opacity = getOpacity(LOC_FIRST_SHADOW_OPACITY_STYLE);
assertEquals(opacity, 0.9, format(MSG_SUGGESTION_BOX_SHADOW_OPACITY_PREFORMATTED, 11));
}
@@ -333,22 +430,42 @@
scrollIntoView(LOC_FIRST_INPUT, true);
selenium.type(LOC_FIRST_CELLPADDING_INPUT, "1");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return Integer.parseInt(selenium.getAttribute(LOC_FIRST_CELLPADDING)) == 1;
+ }
+ });
+
int cellpadding = Integer.parseInt(selenium.getAttribute(LOC_FIRST_CELLPADDING));
assertEquals(cellpadding, 1, format(MSG_SUGGESTION_BOX_CELLPADDING_PREFORMATTED, 1));
selenium.type(LOC_FIRST_CELLPADDING_INPUT, "10");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return Integer.parseInt(selenium.getAttribute(LOC_FIRST_CELLPADDING)) == 10;
+ }
+ });
+
cellpadding = Integer.parseInt(selenium.getAttribute(LOC_FIRST_CELLPADDING));
assertEquals(cellpadding, 10, format(MSG_SUGGESTION_BOX_CELLPADDING_PREFORMATTED, 10));
selenium.type(LOC_FIRST_CELLPADDING_INPUT, "20");
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return Integer.parseInt(selenium.getAttribute(LOC_FIRST_CELLPADDING)) == 20;
+ }
+ });
+
cellpadding = Integer.parseInt(selenium.getAttribute(LOC_FIRST_CELLPADDING));
assertEquals(cellpadding, 20, format(MSG_SUGGESTION_BOX_CELLPADDING_PREFORMATTED, 20));
selenium.type(LOC_FIRST_CELLPADDING_INPUT, "25"); // 25 -> 20
- waitFor(1500);
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return Integer.parseInt(selenium.getAttribute(LOC_FIRST_CELLPADDING)) == 20;
+ }
+ });
+
cellpadding = Integer.parseInt(selenium.getAttribute(LOC_FIRST_CELLPADDING));
assertEquals(cellpadding, 20, format(MSG_SUGGESTION_BOX_CELLPADDING_PREFORMATTED, 25));
}
@@ -402,9 +519,11 @@
waitForTextEquals(format(LOC_SECOND_SUGGESTION_BOX_PREFORMATTED, 3), "Madison");
selenium.click(format(LOC_SECOND_SUGGESTION_BOX_PREFORMATTED, 3)); // Madison
- waitFor(700);
- String state = selenium.getText(LOC_SECOND_STATE);
- assertEquals(state, "Maine,Wisconsin", MSG_AUGUSTA_MADISON_MAINE_WISCONSIN);
+ Wait.failWith(MSG_AUGUSTA_MADISON_MAINE_WISCONSIN).until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getText(LOC_SECOND_STATE).equals("Maine,Wisconsin");
+ }
+ });
}
/**
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/toolBar/ToolBarTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/toolBar/ToolBarTestCase.java 2009-09-15 12:33:45 UTC (rev 15577)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/toolBar/ToolBarTestCase.java 2009-09-15 12:59:18 UTC (rev 15578)
@@ -115,36 +115,51 @@
@Test
public void testThirdToolBarGroupSeparators() {
scrollIntoView(format(LOC_EXAMPLE_N_HEADER, 3), true);
- String text;
-
+
// select line
selenium.click(format(LOC_THIRD_TOOLBAR_GROUP_SEPARATOR_N, 1));
- waitForElement(LOC_GROUP_SEPARATOR_IMG);
+
+ Wait.failWith(format(MSG_GROUP_SEPARATOR_S, "LineSeparatorImage")).until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getAttribute(LOC_GROUP_SEPARATOR_IMG + "@src").contains("LineSeparatorImage");
+ }
+ });
+
assertTrue(selenium.isElementPresent(LOC_GROUP_SEPARATOR_IMG), MSG_THERE_IS_NO_GROUP_SEPARATOR);
- text = selenium.getAttribute(LOC_GROUP_SEPARATOR_IMG + "@src");
- assertTrue(text.contains("LineSeparatorImage"), format(MSG_GROUP_SEPARATOR_S, "LineSeparatorImage"));
-
+
// select grid
selenium.click(format(LOC_THIRD_TOOLBAR_GROUP_SEPARATOR_N, 2));
- waitForElement(LOC_GROUP_SEPARATOR_IMG);
+
+ Wait.failWith(format(MSG_GROUP_SEPARATOR_S, "GridSeparatorImage")).until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getAttribute(LOC_GROUP_SEPARATOR_IMG + "@src").contains("GridSeparatorImage");
+ }
+ });
+
assertTrue(selenium.isElementPresent(LOC_GROUP_SEPARATOR_IMG), MSG_THERE_IS_NO_GROUP_SEPARATOR);
- text = selenium.getAttribute(LOC_GROUP_SEPARATOR_IMG + "@src");
- assertTrue(text.contains("GridSeparatorImage"), format(MSG_GROUP_SEPARATOR_S, "GridSeparatorImage"));
-
+
// select disc
selenium.click(format(LOC_THIRD_TOOLBAR_GROUP_SEPARATOR_N, 3));
- waitForElement(LOC_GROUP_SEPARATOR_IMG);
+
+ Wait.failWith(format(MSG_GROUP_SEPARATOR_S, "DotSeparatorImage")).until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getAttribute(LOC_GROUP_SEPARATOR_IMG + "@src").contains("DotSeparatorImage");
+ }
+ });
+
assertTrue(selenium.isElementPresent(LOC_GROUP_SEPARATOR_IMG), MSG_THERE_IS_NO_GROUP_SEPARATOR);
- text = selenium.getAttribute(LOC_GROUP_SEPARATOR_IMG + "@src");
- assertTrue(text.contains("DotSeparatorImage"), format(MSG_GROUP_SEPARATOR_S, "DotSeparatorImage"));
-
+
// select square
selenium.click(format(LOC_THIRD_TOOLBAR_GROUP_SEPARATOR_N, 4));
- waitForElement(LOC_GROUP_SEPARATOR_IMG);
+
+ Wait.failWith(format(MSG_GROUP_SEPARATOR_S, "SquareSeparatorImage")).until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getAttribute(LOC_GROUP_SEPARATOR_IMG + "@src").contains("SquareSeparatorImage");
+ }
+ });
+
assertTrue(selenium.isElementPresent(LOC_GROUP_SEPARATOR_IMG), MSG_THERE_IS_NO_GROUP_SEPARATOR);
- text = selenium.getAttribute(LOC_GROUP_SEPARATOR_IMG + "@src");
- assertTrue(text.contains("SquareSeparatorImage"), format(MSG_GROUP_SEPARATOR_S, "SquareSeparatorImage"));
-
+
// select none
selenium.click(format(LOC_THIRD_TOOLBAR_GROUP_SEPARATOR_N, 5));
Wait.failWith(MSG_THERE_IS_GROUP_SEPARATOR).until(new Condition() {
@@ -160,35 +175,50 @@
@Test
public void testToolBarItemSeparators() {
scrollIntoView(format(LOC_EXAMPLE_N_HEADER, 3), true);
- String text;
-
+
// select line
selenium.click(format(LOC_THIRD_TOOLBAR_ITEM_SEPARATOR_N, 1));
- waitForElement(LOC_ITEM_SEPARATOR_IMG);
+
+ Wait.failWith(format(MSG_ITEM_SEPARATOR_S, "LineSeparatorImage")).until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getAttribute(LOC_ITEM_SEPARATOR_IMG + "@src").contains("LineSeparatorImage");
+ }
+ });
+
assertTrue(selenium.isElementPresent(LOC_ITEM_SEPARATOR_IMG), MSG_THERE_IS_NO_ITEM_SEPARATOR);
- text = selenium.getAttribute(LOC_ITEM_SEPARATOR_IMG + "@src");
- assertTrue(text.contains("LineSeparatorImage"), format(MSG_ITEM_SEPARATOR_S, "LineSeparatorImage"));
-
+
// select grid
selenium.click(format(LOC_THIRD_TOOLBAR_ITEM_SEPARATOR_N, 2));
- waitForElement(LOC_ITEM_SEPARATOR_IMG);
+
+ Wait.failWith(format(MSG_ITEM_SEPARATOR_S, "GridSeparatorImage")).until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getAttribute(LOC_ITEM_SEPARATOR_IMG + "@src").contains("GridSeparatorImage");
+ }
+ });
+
assertTrue(selenium.isElementPresent(LOC_ITEM_SEPARATOR_IMG), MSG_THERE_IS_NO_ITEM_SEPARATOR);
- text = selenium.getAttribute(LOC_ITEM_SEPARATOR_IMG + "@src");
- assertTrue(text.contains("GridSeparatorImage"), format(MSG_ITEM_SEPARATOR_S, "GridSeparatorImage"));
-
+
// select disc
selenium.click(format(LOC_THIRD_TOOLBAR_ITEM_SEPARATOR_N, 3));
- waitForElement(LOC_ITEM_SEPARATOR_IMG);
+
+ Wait.failWith(format(MSG_ITEM_SEPARATOR_S, "DotSeparatorImage")).until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getAttribute(LOC_ITEM_SEPARATOR_IMG + "@src").contains("DotSeparatorImage");
+ }
+ });
+
assertTrue(selenium.isElementPresent(LOC_ITEM_SEPARATOR_IMG), MSG_THERE_IS_NO_ITEM_SEPARATOR);
- text = selenium.getAttribute(LOC_ITEM_SEPARATOR_IMG + "@src");
- assertTrue(text.contains("DotSeparatorImage"), format(MSG_ITEM_SEPARATOR_S, "DotSeparatorImage"));
// select square
selenium.click(format(LOC_THIRD_TOOLBAR_ITEM_SEPARATOR_N, 4));
- waitForElement(LOC_ITEM_SEPARATOR_IMG);
+
+ Wait.failWith(format(MSG_ITEM_SEPARATOR_S, "SquareSeparatorImage")).until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getAttribute(LOC_ITEM_SEPARATOR_IMG + "@src").contains("SquareSeparatorImage");
+ }
+ });
+
assertTrue(selenium.isElementPresent(LOC_ITEM_SEPARATOR_IMG), MSG_THERE_IS_NO_ITEM_SEPARATOR);
- text = selenium.getAttribute(LOC_ITEM_SEPARATOR_IMG + "@src");
- assertTrue(text.contains("SquareSeparatorImage"), format(MSG_ITEM_SEPARATOR_S, "SquareSeparatorImage"));
// select none
selenium.click(format(LOC_THIRD_TOOLBAR_ITEM_SEPARATOR_N, 5));
15 years, 3 months
JBoss Rich Faces SVN: r15577 - branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dataFilterSlider.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-09-15 08:33:45 -0400 (Tue, 15 Sep 2009)
New Revision: 15577
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dataFilterSlider/locators.properties
Log:
- dataFilterSlider - forgotten commit of locators
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dataFilterSlider/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dataFilterSlider/locators.properties 2009-09-15 12:30:29 UTC (rev 15576)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dataFilterSlider/locators.properties 2009-09-15 12:33:45 UTC (rev 15577)
@@ -5,3 +5,4 @@
INPUT_MAX_PRICE=//*[@type\='text' and contains(@class,'rich-dataFilterSlider-input-field')]
DIV_SLIDER_HANDLE=//*[contains(@class,'rich-dataFilterSlider-handle')]
DIV_SLIDER_TRACK=//*[contains(@class,'rich-dataFilterSlider-track')]
+TABLE_FILTERED_CAR_LIST=//*[contains(@id,'carList') and */@class\='rich-table-thead']
15 years, 3 months
JBoss Rich Faces SVN: r15576 - branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/queue.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-09-15 08:30:29 -0400 (Tue, 15 Sep 2009)
New Revision: 15576
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/queue/QueueTestCase.java
Log:
- QueueTestCase - removed wait for 1 second precedding waiting for item appears in queue, because it's possible then item from queue disappear sooner than 1sec and so waiting for the item appears fails
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/queue/QueueTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/queue/QueueTestCase.java 2009-09-15 12:28:09 UTC (rev 15575)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/queue/QueueTestCase.java 2009-09-15 12:30:29 UTC (rev 15576)
@@ -48,10 +48,6 @@
selenium.click(locButtonImage);
- scrollIntoView(locButtonImage, true);
-
- waitFor(1000);
-
scrollIntoView(locQueueItem, false);
waitModelUpdate.failWith(format("The enqueued item isn't present '{0}'", locQueueItem)).until(
15 years, 3 months
JBoss Rich Faces SVN: r15575 - branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dataFilterSlider.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-09-15 08:28:09 -0400 (Tue, 15 Sep 2009)
New Revision: 15575
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dataFilterSlider/DataFilterSliderTestCase.java
Log:
- dataFilterSlider - added debugging code taking screenshot when result set (table) is empty
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dataFilterSlider/DataFilterSliderTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dataFilterSlider/DataFilterSliderTestCase.java 2009-09-15 11:46:26 UTC (rev 15574)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dataFilterSlider/DataFilterSliderTestCase.java 2009-09-15 12:28:09 UTC (rev 15575)
@@ -21,6 +21,7 @@
*******************************************************************************/
package org.jboss.richfaces.integrationTest.dataFilterSlider;
+import java.io.File;
import java.util.LinkedList;
import java.util.List;
@@ -45,6 +46,7 @@
private final String LOC_DIV_SLIDER_HANDLE = getLoc("DIV_SLIDER_HANDLE");
private final String LOC_DIV_SLIDER_TRACK = getLoc("DIV_SLIDER_TRACK");
private final String LOC_INPUT_MAX_PRICE = getLoc("INPUT_MAX_PRICE");
+ private final String LOC_TABLE_FILTERED_CAR_LIST = getLoc("TABLE_FILTERED_CAR_LIST");
private final int MSG_COUNT_MAX_ROWS = Integer.valueOf(getMsg("COUNT_MAX_ROWS"));
private final String MSG_CHOICES_OF_BRANDS = getMsg("CHOICES_OF_BRANDS");
@@ -90,6 +92,13 @@
assertTrue(allMileages.size() >= MSG_COUNT_MAX_ROWS || allMileages.containsAll(highMileages));
assertTrue(highMileages.size() >= MSG_COUNT_MAX_ROWS || highMileages.containsAll(lowMileages));
assertTrue(lowMileages.size() >= MSG_COUNT_MAX_ROWS || lowMileages.containsAll(lowestMileages));
+ // TODO remove taking screenshot when lowestMileages is empty
+ if (lowestMileages.isEmpty()) {
+ scrollIntoView(LOC_DIV_SLIDER_TRACK, true);
+ selenium.captureScreenshot(new File("screenshot-" + this.getClass().getSimpleName() + "-01.png").toString());
+ scrollIntoView(LOC_TABLE_FILTERED_CAR_LIST, true);
+ selenium.captureScreenshot(new File("screenshot-" + this.getClass().getSimpleName() + "-02.png").toString());
+ }
// check that there is at least one mileage greater than slider minimum
assertFalse(lowestMileages.isEmpty());
}
@@ -133,7 +142,8 @@
private List<Integer> testSlider(String percentage) {
clickSliderAtPercent(Integer.valueOf(percentage));
int maxMileage = getCurrentMileageFromInput();
- return checkAllMileagesMaxAndReturnItsList(maxMileage);
+ List<Integer> result = checkAllMileagesMaxAndReturnItsList(maxMileage);
+ return result;
}
private List<Integer> checkAllMileagesMaxAndReturnItsList(int maxMileage) {
15 years, 3 months
JBoss Rich Faces SVN: r15574 - branches/community/3.3.X/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-09-15 07:46:26 -0400 (Tue, 15 Sep 2009)
New Revision: 15574
Modified:
branches/community/3.3.X/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
https://jira.jboss.org/jira/browse/RF-7724
Modified: branches/community/3.3.X/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- branches/community/3.3.X/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2009-09-15 11:32:11 UTC (rev 15573)
+++ branches/community/3.3.X/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2009-09-15 11:46:26 UTC (rev 15574)
@@ -792,6 +792,13 @@
this.getUpdatedChoices(event);
}
} else {
+ if (this.isSelectedItemsUpdated)
+ {
+ //call user listner
+ this.isSelectedItemsUpdated = false;
+ this.callOnObjectChangeListener(event);
+ }
+
this.active = false;
this.hide();
}
@@ -1051,7 +1058,7 @@
//call user listner
this.isSelectedItemsUpdated = false;
this.callOnObjectChangeListener(event);
- }
+ }
LOG.debug("Choices updated");
}
15 years, 3 months
JBoss Rich Faces SVN: r15573 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest: fileUpload and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2009-09-15 07:32:11 -0400 (Tue, 15 Sep 2009)
New Revision: 15573
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dropDownMenu/HorizontalMenuTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/fileUpload/FileUploadTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/progressBar/ProgressBarTestCase.java
Log:
* test cases refactored to provide more stable results
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dropDownMenu/HorizontalMenuTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dropDownMenu/HorizontalMenuTestCase.java 2009-09-15 10:28:18 UTC (rev 15572)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dropDownMenu/HorizontalMenuTestCase.java 2009-09-15 11:32:11 UTC (rev 15573)
@@ -27,6 +27,8 @@
import static org.testng.Assert.assertTrue;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
+import org.jboss.test.selenium.waiting.Condition;
+import org.jboss.test.selenium.waiting.Wait;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -71,10 +73,12 @@
@Test
public void testMenuItem() {
selenium.click(LOC_FIRST_MENU_NEW);
- waitFor(400);
- String text = selenium.getText(LOC_FIRST_CURRENT_SELECTION);
- assertEquals(text, MSG_FIRST_CURRENT_SELECTION_NEW, "Text shown in current selection.");
+ Wait.failWith("Text shown in current selection.").until(new Condition() {
+ public boolean isTrue() {
+ return MSG_FIRST_CURRENT_SELECTION_NEW.equals(selenium.getText(LOC_FIRST_CURRENT_SELECTION));
+ }
+ });
}
/**
@@ -83,10 +87,12 @@
@Test
public void testMenuGroup() {
selenium.click(LOC_FIRST_MENU_SAVE_ALL);
- waitFor(400);
- String text = selenium.getText(LOC_FIRST_CURRENT_SELECTION);
- assertEquals(text, MSG_FIRST_CURRENT_SELECTION_SAVE_ALL, "Text shown in 'Current Selection:'");
+ Wait.failWith("Text shown in current Selection.").until(new Condition() {
+ public boolean isTrue() {
+ return MSG_FIRST_CURRENT_SELECTION_SAVE_ALL.equals(selenium.getText(LOC_FIRST_CURRENT_SELECTION));
+ }
+ });
}
/**
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/fileUpload/FileUploadTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/fileUpload/FileUploadTestCase.java 2009-09-15 10:28:18 UTC (rev 15572)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/fileUpload/FileUploadTestCase.java 2009-09-15 11:32:11 UTC (rev 15573)
@@ -303,7 +303,12 @@
selenium.attachFile(format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_BIG);
selenium.click(LOC_UPLOAD_BUTTON);
- waitFor(2000);
+
+ Wait.failWith(MSG_RIGHT_PANEL_NUMBER_OF_ITEMS).until(new Condition() {
+ public boolean isTrue() {
+ return selenium.getXpathCount(LOC_UPLOADED_LIST_TR).intValue() == 1;
+ }
+ });
String text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_NAME, 1));
assertEquals(text, "selenium-test" + Color.YELLOW.getRGB() + ".jpg", format(MSG_LEFT_PANEL_NAME_N, 1));
@@ -319,9 +324,6 @@
assertEquals(text, "Done", format(MSG_LEFT_PANEL_DONE_N, 2));
text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_DONE, 2));
assertEquals(text, "File size restricted", format(MSG_LEFT_PANEL_DONE_N, 2));
-
- int count = selenium.getXpathCount(LOC_UPLOADED_LIST_TR).intValue();
- assertEquals(count, 1, MSG_RIGHT_PANEL_NUMBER_OF_ITEMS);
}
/**
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java 2009-09-15 10:28:18 UTC (rev 15572)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java 2009-09-15 11:32:11 UTC (rev 15573)
@@ -29,6 +29,8 @@
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
import org.jboss.test.selenium.utils.URLUtils;
+import org.jboss.test.selenium.waiting.Condition;
+import org.jboss.test.selenium.waiting.Wait;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -98,7 +100,7 @@
int position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
assertEquals(position, MSG_INITIAL_STATE_SHADOW_SLIDER_HANDLE, "Size of the shadow.");
- assertImageHash(MSG_INITIAL_STATE_HASH);
+ assertEquals(getImageHash(), MSG_INITIAL_STATE_HASH, "Hash of the image.");
}
/**
@@ -108,13 +110,22 @@
public void testChangeText() {
selenium.type(LOC_INPUT_TEXT, "XoXoXoXoX");
selenium.typeKeys(LOC_INPUT_TEXT, " "); // why is this necessary?
- waitFor(1500);
- assertImageHash(MSG_CHANGE_TEXT_HASH_1);
+ Wait.failWith("Hash of the image.").until(new Condition() {
+ public boolean isTrue() {
+ return getImageHash().equals(MSG_CHANGE_TEXT_HASH_1);
+ }
+ });
+
selenium.type(LOC_INPUT_TEXT, "Red Hat");
selenium.typeKeys(LOC_INPUT_TEXT, " "); // why is this necessary?
- waitFor(1500);
- assertImageHash(MSG_CHANGE_TEXT_HASH_2);
+
+ Wait.failWith("Hash of the image.").until(new Condition() {
+ public boolean isTrue() {
+ return getImageHash().equals(MSG_CHANGE_TEXT_HASH_2);
+ }
+ });
+
}
/**
@@ -124,15 +135,21 @@
public void testChangeColor() {
selenium.type(LOC_INPUT_COLOR, "fbff00");
selenium.click(LOC_BUTTON_APPLY_COLOR);
+
+ Wait.failWith("Hash of the image.").until(new Condition() {
+ public boolean isTrue() {
+ return getImageHash().equals(MSG_CHANGE_COLOR_HASH_1);
+ }
+ });
- waitFor(1500);
- assertImageHash(MSG_CHANGE_COLOR_HASH_1);
-
selenium.type(LOC_INPUT_COLOR, "00ffbb");
selenium.click(LOC_BUTTON_APPLY_COLOR);
-
- waitFor(1500);
- assertImageHash(MSG_CHANGE_COLOR_HASH_2);
+
+ Wait.failWith("Hash of the image.").until(new Condition() {
+ public boolean isTrue() {
+ return getImageHash().equals(MSG_CHANGE_COLOR_HASH_2);
+ }
+ });
}
/**
@@ -145,24 +162,33 @@
int position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
assertEquals(position, MSG_CHANGE_SHADOW_SLIDER_HANDLE_1, "Position of the slider's handle.");
- waitFor(1500);
- assertImageHash(MSG_CHANGE_SHADOW_HASH_1);
+ Wait.failWith("Hash of the image.").until(new Condition() {
+ public boolean isTrue() {
+ return getImageHash().equals(MSG_CHANGE_SHADOW_HASH_1);
+ }
+ });
selenium.mouseDownAt(LOC_SHADOW_SLIDER, "96,0");
selenium.mouseUp(LOC_SHADOW_SLIDER);
position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
assertEquals(position, MSG_CHANGE_SHADOW_SLIDER_HANDLE_2, "Position of the slider's handle.");
- waitFor(1500);
- assertImageHash(MSG_CHANGE_SHADOW_HASH_2);
-
+ Wait.failWith("Hash of the image.").until(new Condition() {
+ public boolean isTrue() {
+ return getImageHash().equals(MSG_CHANGE_SHADOW_HASH_2);
+ }
+ });
+
selenium.mouseDownAt(LOC_SHADOW_SLIDER, "191,0");
selenium.mouseUp(LOC_SHADOW_SLIDER);
position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
assertEquals(position, MSG_CHANGE_SHADOW_SLIDER_HANDLE_3, "Position of the slider's handle.");
- waitFor(1500);
- assertImageHash(MSG_CHANGE_SHADOW_HASH_3);
+ Wait.failWith("Hash of the image.").until(new Condition() {
+ public boolean isTrue() {
+ return getImageHash().equals(MSG_CHANGE_SHADOW_HASH_3);
+ }
+ });
}
/**
@@ -175,8 +201,11 @@
selenium.type(LOC_INPUT_COLOR, "894bd6");
selenium.click(LOC_BUTTON_APPLY_COLOR);
- waitFor(1500);
- assertImageHash(MSG_CHANGE_TEXT_AND_COLOR_HASH);
+ Wait.failWith("Hash of the image.").until(new Condition() {
+ public boolean isTrue() {
+ return getImageHash().equals(MSG_CHANGE_TEXT_AND_COLOR_HASH);
+ }
+ });
}
/**
@@ -191,8 +220,11 @@
int position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
assertEquals(position, MSG_CHANGE_TEXT_AND_SHADOW_SLIDER_HANDLE, "Position of the slider's handle.");
- waitFor(1500);
- assertImageHash(MSG_CHANGE_TEXT_AND_SHADOW_HASH);
+ Wait.failWith("Hash of the image.").until(new Condition() {
+ public boolean isTrue() {
+ return getImageHash().equals(MSG_CHANGE_TEXT_AND_SHADOW_HASH);
+ }
+ });
}
/**
@@ -208,8 +240,11 @@
int position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
assertEquals(position, MSG_CHANGE_COLOR_AND_SHADOW_SLIDER_HANDLE, "Position of the slider's handle.");
- waitFor(1500);
- assertImageHash(MSG_CHANGE_COLOR_AND_SHADOW_HASH);
+ Wait.failWith("Hash of the image.").until(new Condition() {
+ public boolean isTrue() {
+ return getImageHash().equals(MSG_CHANGE_COLOR_AND_SHADOW_HASH);
+ }
+ });
}
/**
@@ -227,8 +262,11 @@
int position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
assertEquals(position, MSG_CHANGE_ALL_SLIDER_HANDLE, "Position of the slider's handle.");
- waitFor(1500);
- assertImageHash(MSG_CHANGE_ALL_HASH);
+ Wait.failWith("Hash of the image.").until(new Condition() {
+ public boolean isTrue() {
+ return getImageHash().equals(MSG_CHANGE_ALL_HASH);
+ }
+ });
}
/**
@@ -271,28 +309,25 @@
abstractTestSource(1, "View PaintData.java Source", strings);
}
- /**
- * Verifies the hash code of the displayed image.
- *
- * @param hashCode
- * expected hash code of the image
- */
- private void assertImageHash(String hashCode) {
- // create URL of the image
- int index = selenium.getLocation().indexOf('/', 7);
- String tmp = selenium.getLocation().substring(0, index);
- tmp += selenium.getAttribute(LOC_IMAGE + "@src");
+ /**
+ * Returns hash code of the image.
+ */
+ private String getImageHash() {
+ // create URL of the image
+ int index = selenium.getLocation().indexOf('/', 7);
+ String tmp = selenium.getLocation().substring(0, index);
+ tmp += selenium.getAttribute(LOC_IMAGE + "@src");
- try {
- tmp = URLUtils.resourceMd5Digest(tmp);
- } catch (IOException e) {
- e.printStackTrace();
- fail(e.getMessage());
- }
-
- assertEquals(tmp, hashCode, "Hash of the image.");
- }
-
+ try {
+ return URLUtils.resourceMd5Digest(tmp);
+ } catch (IOException e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+
+ return null;
+ }
+
/**
* Loads the page containing the component.
*/
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/progressBar/ProgressBarTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/progressBar/ProgressBarTestCase.java 2009-09-15 10:28:18 UTC (rev 15572)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/progressBar/ProgressBarTestCase.java 2009-09-15 11:32:11 UTC (rev 15573)
@@ -26,6 +26,8 @@
import static org.testng.Assert.assertTrue;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
+import org.jboss.test.selenium.waiting.Condition;
+import org.jboss.test.selenium.waiting.Wait;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -47,6 +49,26 @@
private final String LOC_SECOND_LABEL_INITIAL = getLoc("SECOND_LABEL_INITIAL");
private final String LOC_SECOND_PROGRESS_BAR_STYLE = getLoc("SECOND_PROGRESS_BAR_STYLE");
+ private class ProgressBarCondition implements Condition {
+ private int oldValue;
+ private int newValue;
+ private String locator;
+
+ public ProgressBarCondition(int oldValue, String locator) {
+ this.oldValue = oldValue;
+ this.locator = locator;
+ }
+
+ public int getNewValue() {
+ return newValue;
+ }
+
+ public boolean isTrue() {
+ newValue = (int) Double.parseDouble(getStyle(locator, "width").replace("px", ""));
+ return newValue > oldValue;
+ }
+ }
+
/**
* Tests the first example. It checks that the button is visible and then it
* click on the button. The process starts and the test checks 3 times that
@@ -61,18 +83,17 @@
selenium.click(LOC_FIRST_BUTTON);
- waitFor(500);
- present = selenium.isElementPresent(LOC_FIRST_BUTTON);
- assertFalse(present, "Button \"Restart Process\" should not be present on the page.");
+ Wait.failWith("Button \"Restart Process\" should not be present on the page.").until(new Condition() {
+ public boolean isTrue() {
+ return !selenium.isElementPresent(LOC_FIRST_BUTTON);
+ }
+ });
- int value1 = 0;
- int value2 = 0;
-
- for (int i = 0; i < 6; i++) {
- waitFor(2000);
- value2 = value1;
- value1 = (int) Double.parseDouble(getStyle(LOC_FIRST_PROGRESS_BAR_STYLE, "width").replace("px", ""));
- assertTrue(value1 > value2, "Progress bar should move to the right.");
+ int oldValue = 0;
+ for (int i = 0; i < 4; i++) {
+ ProgressBarCondition condition = new ProgressBarCondition(oldValue, LOC_FIRST_PROGRESS_BAR_STYLE);
+ Wait.timeout(3000).failWith("Progress bar should move to the right.").until(condition);
+ oldValue = condition.getNewValue();
}
}
@@ -91,21 +112,23 @@
selenium.click(LOC_SECOND_BUTTON);
- int current = 0;
- int previous = 0;
- waitFor(2200);
+ int oldValue = 0;
+ waitFor(3000);
- for (int i = 0; i < 10; i++) {
- waitFor(2000);
- current = (int) Double.parseDouble(getStyle(LOC_SECOND_PROGRESS_BAR_STYLE, "width").replace("px", ""));
- assertTrue(current >= previous, "Progress of the progress bar -- the current value should be greater then the one 2 seconds ago.");
- previous = current;
+ for (int i = 0; i < 4; i++) {
+ ProgressBarCondition condition = new ProgressBarCondition(oldValue, LOC_SECOND_PROGRESS_BAR_STYLE);
+ Wait.timeout(6000).failWith(format("Progress bar should move to the right {0} times.", i + 1)).until(
+ condition);
+ oldValue = condition.getNewValue();
}
- waitFor(82000);
+ Wait.timeout(120000).interval(6000).failWith("Finished label should be visible.").until(new Condition() {
+ public boolean isTrue() {
+ return isDisplayed(LOC_SECOND_LABEL_FINISHED);
+ }
+ });
assertFalse(isDisplayed(LOC_SECOND_LABEL_INITIAL), "Initial label should not be visible.");
- assertTrue(isDisplayed(LOC_SECOND_LABEL_FINISHED), "Finished label should be visible.");
}
/**
15 years, 3 months