JBoss Rich Faces SVN: r15512 - management/planning.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-09-09 13:08:16 -0400 (Wed, 09 Sep 2009)
New Revision: 15512
Modified:
management/planning/richfaces_4x_components_priority_list.ods
Log:
Added splitter component
Modified: management/planning/richfaces_4x_components_priority_list.ods
===================================================================
(Binary files differ)
15 years, 4 months
JBoss Rich Faces SVN: r15511 - management/planning.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-09-09 12:55:34 -0400 (Wed, 09 Sep 2009)
New Revision: 15511
Modified:
management/planning/richfaces_4x_components_priority_list.ods
Log:
Components priority list updated by Ilya's suggestions
Modified: management/planning/richfaces_4x_components_priority_list.ods
===================================================================
(Binary files differ)
15 years, 4 months
JBoss Rich Faces SVN: r15510 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-09-09 12:25:42 -0400 (Wed, 09 Sep 2009)
New Revision: 15510
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
https://jira.jboss.org/jira/browse/RF-7388
partial rendering is documented
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2009-09-09 16:04:24 UTC (rev 15509)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2009-09-09 16:25:42 UTC (rev 15510)
@@ -113,6 +113,37 @@
automatically. </para>
</formalpara>
</section>
+
+ <section>
+ <title>Partial Rendering</title>
+ <para>
+ RichFaces framework enhances the JSF framework with partial rendering of the components with Ajax capability enabled.
+ This means that only the part of the page that should be affected by some change is updated. Ajax capability of the components can be enabled by the <emphasis><property>"mode"</property></emphasis>, <emphasis><property>"switchType"</property></emphasis> etc. set to "ajax".
+ This approach prevents multiple page refreshes, which minimized server load.
+ </para>
+ <para>
+ A good example that can illustrate this feature is rendering of the tabs of the <emphasis role="bold"><property><rich:tabPanel></property></emphasis>.
+ By default the component updates the whole page to display the content of the tab which is clicked on, to enable partial rendering the <emphasis><property>"switchType"</property></emphasis> attribute set to "ajax" should be used.
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:tabPanel switchType="ajax">
+ <rich:tab label="Tab 1">
+ Content of Tab 1
+ </rich:tab>
+ <rich:tab label="Tab 2">
+ Content of Tab 2
+ </rich:tab>
+ <rich:tab label="Tab 3">
+ Content of Tab 3
+ </rich:tab>
+</rich:tabPanel>
+...]]></programlisting>
+
+ </section>
+
+
+
+
<section id="IntegralParts" role="new">
<?dbhtml filename="IntegralParts.html"?>
<title>RichFaces Integral Parts</title>
15 years, 4 months
JBoss Rich Faces SVN: r15509 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-09-09 12:04:24 -0400 (Wed, 09 Sep 2009)
New Revision: 15509
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_support.xml
Log:
https://jira.jboss.org/jira/browse/RF-7275 - programlisting was fixed
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_support.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_support.xml 2009-09-09 15:40:08 UTC (rev 15508)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_support.xml 2009-09-09 16:04:24 UTC (rev 15509)
@@ -112,8 +112,8 @@
<programlisting role="JAVA"><![CDATA[...
public class PlanetsMoons {
private String currentPlanet="";
- public List<SelectItem> planetsList = new ArrayList<SelectItem>();
- public List<String> moonsList = new ArrayList<String>();
+ public List<SelectItem> planetsList = new ArrayList<SelectItem>();
+ public List<String> moonsList = new ArrayList<String>();
private static final String [] EARTH = {"The Moon"};
private static final String [] MARS = {"Deimos", "Phobos"};
private static final String [] JUPITER = {"Europa", "Gamymede", "Callisto"};
@@ -137,7 +137,7 @@
}else{
currentItems = JUPITER;
}
- for (int i = 0; i < currentItems.length; i++) {
+ for (int i = 0; i < currentItems.length; i++) {
moonsList.add(currentItems[i]);
}
}
15 years, 4 months
JBoss Rich Faces SVN: r15508 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-09-09 11:40:08 -0400 (Wed, 09 Sep 2009)
New Revision: 15508
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_tabPanel.xml
Log:
https://jira.jboss.org/jira/browse/RF-7388
corrected a mistake
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_tabPanel.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_tabPanel.xml 2009-09-09 14:57:41 UTC (rev 15507)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_tabPanel.xml 2009-09-09 15:40:08 UTC (rev 15508)
@@ -58,7 +58,7 @@
</listitem>
<listitem>
<para>
- <code>AJAX</code>
+ <code>Ajax</code>
</para>
</listitem>
@@ -92,7 +92,7 @@
<itemizedlist>
<listitem>
<para>
- <code>Server</code> (DEFAULT)</para>
+ <code>server</code> (DEFAULT)</para>
<para>The common submission is performed around
<property>tabPanel</property> and a page
is completely rendered on a called panel. Only one
@@ -101,7 +101,7 @@
</listitem>
<listitem>
<para>
- <code>Ajax</code>
+ <code>ajax</code>
</para>
<para>AJAX form submission is performed around the
<property>tabPanel</property>, content
@@ -112,7 +112,7 @@
</listitem>
<listitem>
<para>
- <code>Client</code>
+ <code>client</code>
</para>
<para> All <property>tabPanels</property> are uploaded on
the client side. The switching from the active to
15 years, 4 months
JBoss Rich Faces SVN: r15507 - branches/community/3.3.X/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-09-09 10:57:41 -0400 (Wed, 09 Sep 2009)
New Revision: 15507
Added:
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/modalPanel1.png
Log:
RF-7804: Rich Output component group description review --> rich:modalPanel
Added: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/modalPanel1.png
===================================================================
(Binary files differ)
Property changes on: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/modalPanel1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 4 months
JBoss Rich Faces SVN: r15506 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test: java/org/jboss/richfaces/integrationTest/inputNumberSlider and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2009-09-09 10:52:04 -0400 (Wed, 09 Sep 2009)
New Revision: 15506
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/inplaceSelect/InplaceSelectTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/inputNumberSlider/InputNumberSliderTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inplaceSelect/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inplaceSelect/messages.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inputNumberSlider/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inputNumberSlider/messages.properties
Log:
* InplaceSelectTestCase and InputNumberSliderTestCase refactored
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/inplaceSelect/InplaceSelectTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/inplaceSelect/InplaceSelectTestCase.java 2009-09-09 13:44:10 UTC (rev 15505)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/inplaceSelect/InplaceSelectTestCase.java 2009-09-09 14:52:04 UTC (rev 15506)
@@ -1,226 +1,264 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
package org.jboss.richfaces.integrationTest.inplaceSelect;
import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
-import java.awt.event.KeyEvent;
-
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Test case that tests the inplace select component.
- * <ul>
- * <li><b>TODO</b> test cancel buttons
- * </ul>
*
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
+// TODO test cancel buttons
public class InplaceSelectTestCase extends AbstractSeleniumRichfacesTestCase {
- // messages
- private final String MSG_COMPONENT_DESCRIPTION = getMess("COMPONENT_DESCRIPTION");
- private final String MSG_CLICK_HERE_TO_EDIT = getMess("CLICK_HERE_TO_EDIT");
- private final String MSG_DOUBLE_CLICK_TO_EDIT = getMess("DOUBLE_CLICK_TO_EDIT");
- private final String MSG_READ_ONLY = getMess("READ_ONLY");
- private final String MSG_DISPLAY_NONE = getMess("DISPLAY_NONE");
- private final String MSG_OPTION4_SELECTED = getMess("OPTION4_SELECTED");
- private final String MSG_ARKANSAS_SELECTED = getMess("ARKANSAS_SELECTED");
- private final String MSG_LITTLE_ROCK = getMess("LITTLE_ROCK");
- private final String MSG_COUNT_OF_ITEMS = getMess("COUNT_OF_ITEMS");
+ // messages
+ private final String MSG_CLICK_HERE_TO_EDIT = getMsg("CLICK_HERE_TO_EDIT");
+ private final String MSG_DOUBLE_CLICK_TO_EDIT = getMsg("DOUBLE_CLICK_TO_EDIT");
+ private final String MSG_READ_ONLY = getMsg("READ_ONLY");
+ private final String MSG_DISPLAY_NONE = getMsg("DISPLAY_NONE");
+ private final String MSG_OPTION4_SELECTED = getMsg("OPTION4_SELECTED");
+ private final String MSG_ARKANSAS_SELECTED = getMsg("ARKANSAS_SELECTED");
+ private final String MSG_LITTLE_ROCK = getMsg("LITTLE_ROCK");
+ private final String MSG_COUNT_OF_ITEMS = getMsg("COUNT_OF_ITEMS");
- // locators
- private final String LOC_FIRST = getLoc("FIRST");
- private final String LOC_FIRST_INPUT_1 = getLoc("FIRST_INPUT_1");
- private final String LOC_FIRST_INPUT_2 = getLoc("FIRST_INPUT_2");
- private final String LOC_FIRST_SELECT_VIEW = getLoc("FIRST_SELECT_VIEW");
- private final String LOC_FIRST_LIST_SPAN = getLoc("FIRST_LIST_SPAN");
- private final String LOC_FIRST_LIST_SPAN_N = getLoc("FIRST_LIST_SPAN_N");
- private final String LOC_SECOND_OK_BUTTON = getLoc("SECOND_OK_BUTTON");
+ // locators
+ private final String LOC_FIRST = getLoc("FIRST");
+ private final String LOC_FIRST_INPUT_1 = getLoc("FIRST_INPUT_1");
+ private final String LOC_FIRST_INPUT_2 = getLoc("FIRST_INPUT_2");
+ private final String LOC_FIRST_SELECT_VIEW = getLoc("FIRST_SELECT_VIEW");
+ private final String LOC_FIRST_LIST_SPAN = getLoc("FIRST_LIST_SPAN");
+ private final String LOC_FIRST_LIST_SPAN_N = getLoc("FIRST_LIST_SPAN_N");
+ private final String LOC_SECOND_OK_BUTTON = getLoc("SECOND_OK_BUTTON");
- private final String LOC_SECOND = getLoc("SECOND");
- private final String LOC_SECOND_INPUT_1 = getLoc("SECOND_INPUT_1");
- private final String LOC_SECOND_INPUT_2 = getLoc("SECOND_INPUT_2");
- private final String LOC_SECOND_LIST_SPAN = getLoc("SECOND_LIST_SPAN");
- private final String LOC_SECOND_LIST_SPAN_N = getLoc("SECOND_LIST_SPAN_N");
+ private final String LOC_SECOND = getLoc("SECOND");
+ private final String LOC_SECOND_INPUT_1 = getLoc("SECOND_INPUT_1");
+ private final String LOC_SECOND_INPUT_2 = getLoc("SECOND_INPUT_2");
+ private final String LOC_SECOND_LIST_SPAN = getLoc("SECOND_LIST_SPAN");
+ private final String LOC_SECOND_LIST_SPAN_N = getLoc("SECOND_LIST_SPAN_N");
- private final String LOC_THIRD = getLoc("THIRD");
- private final String LOC_THIRD_INPUT_1 = getLoc("THIRD_INPUT_1");
- private final String LOC_THIRD_INPUT_2 = getLoc("THIRD_INPUT_2");
- private final String LOC_THIRD_LIST_SPAN = getLoc("THIRD_LIST_SPAN");
- private final String LOC_THIRD_LIST_SPAN_N = getLoc("THIRD_LIST_SPAN_N");
- private final String LOC_THIRD_CAPITAL = getLoc("THIRD_CAPITAL");
- private final String LOC_THIRD_SAVE_BUTTON = getLoc("THIRD_SAVE_BUTTON");
+ private final String LOC_THIRD = getLoc("THIRD");
+ private final String LOC_THIRD_INPUT_1 = getLoc("THIRD_INPUT_1");
+ private final String LOC_THIRD_INPUT_2 = getLoc("THIRD_INPUT_2");
+ private final String LOC_THIRD_LIST_SPAN = getLoc("THIRD_LIST_SPAN");
+ private final String LOC_THIRD_LIST_SPAN_N = getLoc("THIRD_LIST_SPAN_N");
+ private final String LOC_THIRD_CAPITAL = getLoc("THIRD_CAPITAL");
+ private final String LOC_THIRD_SAVE_BUTTON = getLoc("THIRD_SAVE_BUTTON");
- /**
- * Tests the first example. It checks the "readonly" and "style" attribute
- * of the inplace select. Then it clicks into and out of the component and
- * verifies that nothing changed. Consequently it checks the number of items
- * in the component. In the end it selects the fourth item from the inplace
- * select and checks the text.
- */
- @Test
- public void testFirstInput() {
- scrollIntoView(LOC_FIRST, true);
+ /**
+ * Tests the first example. It checks the "readonly" and "style" attribute
+ * of the inplace select. Then it clicks into and out of the component and
+ * verifies that nothing changed. Consequently it checks the number of items
+ * in the component. In the end it selects the fourth item from the inplace
+ * select and checks the text.
+ */
+ @Test
+ public void testFirstInput() {
+ scrollIntoView(LOC_FIRST, true);
- String text = selenium.getText(LOC_FIRST);
- assertTrue(text.equals("Click here to edit"), MSG_CLICK_HERE_TO_EDIT);
+ String text = selenium.getText(LOC_FIRST);
+ assertTrue(text.equals("Click here to edit"), MSG_CLICK_HERE_TO_EDIT);
- String attr = selenium.getAttribute(LOC_FIRST_INPUT_1 + "@readonly");
- assertTrue(attr.equals("readonly"), MSG_READ_ONLY);
+ String attr = selenium.getAttribute(LOC_FIRST_INPUT_1 + "@readonly");
+ assertTrue(attr.equals("readonly"), MSG_READ_ONLY);
- attr = selenium.getAttribute(LOC_FIRST_INPUT_2 + "@style");
- assertTrue(attr.contains("display: none;"), MSG_DISPLAY_NONE);
+ assertFalse(isDisplayed(LOC_FIRST_INPUT_2), MSG_DISPLAY_NONE);
- // expand and collapse the inplace select
- selenium.click(LOC_FIRST_INPUT_1);
- selenium.click(LOC_FIRST_INPUT_2);
+ // expand and collapse the inplace select
+ selenium.click(LOC_FIRST_INPUT_1);
+ selenium.click(LOC_FIRST_INPUT_2);
- text = selenium.getText(LOC_FIRST);
- assertTrue(text.equals("Click here to edit"), MSG_CLICK_HERE_TO_EDIT);
+ text = selenium.getText(LOC_FIRST);
+ assertTrue(text.equals("Click here to edit"), MSG_CLICK_HERE_TO_EDIT);
- // expand the component and select "Option 4"
- selenium.click(LOC_FIRST);
-
- int count = selenium.getXpathCount(LOC_FIRST_LIST_SPAN).intValue();
- assertEquals(count, 5, MSG_COUNT_OF_ITEMS);
-
- selenium.mouseMove(String.format(LOC_FIRST_LIST_SPAN_N, 4));
+ // expand the component and select "Option 4"
+ selenium.click(LOC_FIRST);
- // TODO explore whether this isn't too low-level
- selenium.getEval(format("selenium.browserbot.findElement(\"{0}\").component.save()", LOC_FIRST_SELECT_VIEW));
+ int count = selenium.getXpathCount(LOC_FIRST_LIST_SPAN).intValue();
+ assertEquals(count, 5, MSG_COUNT_OF_ITEMS);
- // another way to select it
- // selenium.selectWindow(null); // select the main window
- // selenium.windowFocus();
- // selenium.keyPressNative(Integer.toString(KeyEvent.VK_ENTER));
+ selenium.mouseMove(format(LOC_FIRST_LIST_SPAN_N, 4));
- text = selenium.getText(LOC_FIRST);
- assertTrue(text.equals("Option 4"), MSG_OPTION4_SELECTED);
- }
+ // TODO explore whether this isn't too low-level
+ selenium.getEval(format("selenium.browserbot.findElement(\"{0}\").component.save()", LOC_FIRST_SELECT_VIEW));
- /**
- * Tests the second example. It checks the "readonly" and "style" attribute
- * of the inplace select. Then it clicks into and out of the component and
- * verifies that nothing changed. Consequently it checks the number of items
- * in the component. In the end it selects the fourth item from the inplace
- * select and checks the text.
- */
- @Test
- public void testSecondInput() {
- scrollIntoView(LOC_SECOND, true);
+ // another way to select it
+ // selenium.selectWindow(null); // select the main window
+ // selenium.windowFocus();
+ // selenium.keyPressNative(Integer.toString(KeyEvent.VK_ENTER));
- String text = selenium.getText(LOC_SECOND);
- assertTrue(text.equals("Double Click to edit"),
- MSG_DOUBLE_CLICK_TO_EDIT);
+ text = selenium.getText(LOC_FIRST);
+ assertTrue(text.equals("Option 4"), MSG_OPTION4_SELECTED);
+ }
- String attr = selenium.getAttribute(LOC_SECOND_INPUT_1 + "@readonly");
- assertTrue(attr.equals("readonly"), MSG_READ_ONLY);
+ /**
+ * Tests the second example. It checks the "readonly" and "style" attribute
+ * of the inplace select. Then it clicks into and out of the component and
+ * verifies that nothing changed. Consequently it checks the number of items
+ * in the component. In the end it selects the fourth item from the inplace
+ * select and checks the text.
+ */
+ @Test
+ public void testSecondInput() {
+ scrollIntoView(LOC_SECOND, true);
- attr = selenium.getAttribute(LOC_SECOND_INPUT_2 + "@style");
- assertTrue(attr.contains("display: none;"), MSG_DISPLAY_NONE);
+ String text = selenium.getText(LOC_SECOND);
+ assertTrue(text.equals("Double Click to edit"), MSG_DOUBLE_CLICK_TO_EDIT);
- // expand and collapse the inplace select
- selenium.click(LOC_SECOND_INPUT_1);
- selenium.click(LOC_SECOND_INPUT_2);
+ String attr = selenium.getAttribute(LOC_SECOND_INPUT_1 + "@readonly");
+ assertTrue(attr.equals("readonly"), MSG_READ_ONLY);
- int count = selenium.getXpathCount(LOC_SECOND_LIST_SPAN).intValue();
- assertEquals(count, 50, MSG_COUNT_OF_ITEMS);
+ assertFalse(isDisplayed(LOC_SECOND_INPUT_2), MSG_DISPLAY_NONE);
- text = selenium.getText(LOC_SECOND);
- assertTrue(text.equals("Double Click to edit"),
- MSG_DOUBLE_CLICK_TO_EDIT);
+ // expand and collapse the inplace select
+ selenium.click(LOC_SECOND_INPUT_1);
+ selenium.click(LOC_SECOND_INPUT_2);
- // expand the inplace select and click "Arkansas"
- selenium.mouseMove(String.format(LOC_SECOND_LIST_SPAN_N, 4));
- selenium.mouseDown(LOC_SECOND_OK_BUTTON);
+ int count = selenium.getXpathCount(LOC_SECOND_LIST_SPAN).intValue();
+ assertEquals(count, 50, MSG_COUNT_OF_ITEMS);
- text = selenium.getText(LOC_SECOND);
- assertTrue(text.equals("Arkansas"), MSG_ARKANSAS_SELECTED);
- }
+ text = selenium.getText(LOC_SECOND);
+ assertTrue(text.equals("Double Click to edit"), MSG_DOUBLE_CLICK_TO_EDIT);
- /**
- * Tests the third example. It checks the "readonly" and "style" attribute
- * of the inplace select. Then it clicks into and out of the component and
- * verifies that nothing changed. Consequently it checks the number of items
- * in the component. In the end it selects the fourth item from the inplace
- * select and checks the text.
- */
- @Test
- public void testThirdInput() {
- scrollIntoView(LOC_THIRD, true);
+ // expand the inplace select and click "Arkansas"
+ selenium.mouseMove(format(LOC_SECOND_LIST_SPAN_N, 4));
+ selenium.mouseDown(LOC_SECOND_OK_BUTTON);
- String text = selenium.getText(LOC_THIRD);
- assertTrue(text.equals("Click here to edit"), MSG_CLICK_HERE_TO_EDIT);
+ text = selenium.getText(LOC_SECOND);
+ assertTrue(text.equals("Arkansas"), MSG_ARKANSAS_SELECTED);
+ }
- String attr = selenium.getAttribute(LOC_THIRD_INPUT_1 + "@readonly");
- assertTrue(attr.equals("readonly"), MSG_READ_ONLY);
+ /**
+ * Tests the third example. It checks the "readonly" and "style" attribute
+ * of the inplace select. Then it clicks into and out of the component and
+ * verifies that nothing changed. Consequently it checks the number of items
+ * in the component. In the end it selects the fourth item from the inplace
+ * select and checks the text.
+ */
+ @Test
+ public void testThirdInput() {
+ scrollIntoView(LOC_THIRD, true);
- attr = selenium.getAttribute(LOC_THIRD_INPUT_2 + "@style");
- assertTrue(attr.contains("display: none;"), MSG_DISPLAY_NONE);
+ String text = selenium.getText(LOC_THIRD);
+ assertTrue(text.equals("Click here to edit"), MSG_CLICK_HERE_TO_EDIT);
- // expand and collapse the inplace select
- selenium.click(LOC_THIRD_INPUT_1);
- selenium.click(LOC_THIRD_INPUT_2);
+ String attr = selenium.getAttribute(LOC_THIRD_INPUT_1 + "@readonly");
+ assertTrue(attr.equals("readonly"), MSG_READ_ONLY);
- int count = selenium.getXpathCount(LOC_THIRD_LIST_SPAN).intValue();
- assertEquals(count, 50, MSG_COUNT_OF_ITEMS);
+ assertFalse(isDisplayed(LOC_THIRD_INPUT_2), MSG_DISPLAY_NONE);
- text = selenium.getText(LOC_THIRD);
- assertTrue(text.endsWith("Click here to edit"), MSG_CLICK_HERE_TO_EDIT);
+ // expand and collapse the inplace select
+ selenium.click(LOC_THIRD_INPUT_1);
+ selenium.click(LOC_THIRD_INPUT_2);
- // remember for waiting
- text = selenium.getText(LOC_THIRD_CAPITAL);
-
- // select "Arkansas"
- selenium.mouseMove(String.format(LOC_THIRD_LIST_SPAN_N, 4));
- selenium.mouseDown(LOC_THIRD_SAVE_BUTTON);
+ int count = selenium.getXpathCount(LOC_THIRD_LIST_SPAN).intValue();
+ assertEquals(count, 50, MSG_COUNT_OF_ITEMS);
- // wait for remembered value change
- text = waitForTextChangesAndReturn(LOC_THIRD_CAPITAL, text);
- assertTrue(text.endsWith("Little Rock"), MSG_LITTLE_ROCK);
-
- text = selenium.getText(LOC_THIRD);
- assertTrue(text.equals("Arkansas"), MSG_ARKANSAS_SELECTED);
- }
+ text = selenium.getText(LOC_THIRD);
+ assertTrue(text.endsWith("Click here to edit"), MSG_CLICK_HERE_TO_EDIT);
- /**
- * Tests the "View Source". It checks that the source code is not visible,
- * clicks on the link, and checks the first 2 components of source code,
- * i.e. that the source code begins with "<ui:composition".
- */
- @Test
- public void testFirstInputSource() {
- abstractTestSource(1, 1, "<", "ui:composition");
- }
+ // remember for waiting
+ text = selenium.getText(LOC_THIRD_CAPITAL);
- /**
- * Tests the "View Source". It checks that the source code is not visible,
- * clicks on the link, and checks the first 2 components of source code,
- * i.e. that the source code begins with "<ui:composition".
- */
- @Test
- public void testSecondInputSource() {
- abstractTestSource(2, 2, "<", "ui:composition");
- }
+ // select "Arkansas"
+ selenium.mouseMove(format(LOC_THIRD_LIST_SPAN_N, 4));
+ selenium.mouseDown(LOC_THIRD_SAVE_BUTTON);
- /**
- * Tests the "View Source". It checks that the source code is not visible,
- * clicks on the link, and checks the first 2 components of source code,
- * i.e. that the source code begins with "<ui:composition".
- */
- @Test
- public void testThirdInputSource() {
- abstractTestSource(3, 1, "<", "ui:composition");
- }
+ // wait for remembered value change
+ text = waitForTextChangesAndReturn(LOC_THIRD_CAPITAL, text);
+ assertTrue(text.endsWith("Little Rock"), MSG_LITTLE_ROCK);
- /**
- * Loads the page containing the calendar component.
- */
- @BeforeMethod
- private void loadPage() {
- super.loadPage("richInputs", 7, 1, MSG_COMPONENT_DESCRIPTION);
- }
+ text = selenium.getText(LOC_THIRD);
+ assertTrue(text.equals("Arkansas"), MSG_ARKANSAS_SELECTED);
+ }
+
+ /**
+ * Tests the "View Source" in the first example. It checks that the source
+ * code is not visible, clicks on the link, and checks 7 lines of source
+ * code.
+ */
+ @Test
+ public void testFirstExampleSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<rich:inplaceSelect value=\"#{inplaceComponentsBean.inputValue}\"",
+ "defaultLabel=\"Click here to edit\">", "<f:selectItem itemValue=\"0\" itemLabel=\"Option 1\" />",
+ "</rich:inplaceSelect>", "<rich:spacer width=\"100%\" height=\"20px\"/>", "</ui:composition>", };
+
+ abstractTestSource(1, "View Source", strings);
+ }
+
+ /**
+ * Tests the "View Source" in the second example. It checks that the source
+ * code is not visible, clicks on the link, and checks 10 lines of source
+ * code.
+ */
+ @Test
+ public void testSecondExampleSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"", "<style>",
+ "<h:panelGroup style=\"width:200px;\" layout=\"block\">",
+ "<rich:inplaceSelect value=\"#{inplaceComponentsBean.inputValue}\"",
+ "defaultLabel=\"Double Click to edit\" openOnEdit=\"true\"",
+ "showControls=\"true\" editEvent=\"ondblclick\" layout=\"block\"",
+ "viewClass=\"inplace\" changedClass=\"inplace\"",
+ "changedHoverClass=\"hover\" viewHoverClass=\"hover\">",
+ " <f:selectItems value=\"#{capitalsBean.capitalsOptions}\" />",
+ "<rich:spacer width=\"100%\" height=\"20px\" />", };
+
+ abstractTestSource(2, "View Source", strings);
+ }
+
+ /**
+ * Tests the "View Source" in the third example. It checks that the source
+ * code is not visible, clicks on the link, and checks 17 lines of source
+ * code.
+ */
+ @Test
+ public void testThirdExampleSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"", "<style>",
+ "<h:panelGrid columns=\"3\" width=\"500px;\">",
+ "<rich:inplaceSelect value=\"#{inplaceComponentsBean.inputValue}\"",
+ "defaultLabel=\"Click here to edit\" showControls=\"true\"",
+ "controlsHorizontalPosition=\"left\" controlsVerticalPosition=\"bottom\"", "id=\"inplaceSelect\">",
+ "<f:facet name=\"controls\">", "<button onmousedown=\"#{rich:component('inplaceSelect')}.save();\"",
+ "type=\"button\">Save</button>",
+ "<button onmousedown=\"#{rich:component('inplaceSelect')}.cancel();\"",
+ "type=\"button\">Cancel</button>", "<f:selectItems value=\"#{capitalsBean.capitalsOptions}\" />",
+ "<a4j:support event=\"onviewactivated\" reRender=\"output\" />", "<h:outputText id=\"output\"",
+ "value=\"Current State Capital: #{inplaceComponentsBean.inputValue}\"",
+ "style=\"font-weight:bold;\" />", };
+
+ abstractTestSource(3, "View Source", strings);
+ }
+
+ /**
+ * Loads the page containing the calendar component.
+ */
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Inplace Select");
+ }
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/inputNumberSlider/InputNumberSliderTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/inputNumberSlider/InputNumberSliderTestCase.java 2009-09-09 13:44:10 UTC (rev 15505)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/inputNumberSlider/InputNumberSliderTestCase.java 2009-09-09 14:52:04 UTC (rev 15506)
@@ -1,3 +1,21 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
package org.jboss.richfaces.integrationTest.inputNumberSlider;
import static org.testng.Assert.assertEquals;
@@ -18,42 +36,33 @@
AbstractSeleniumRichfacesTestCase {
// messages
- private final String MSG_COMPONENT_DESCRIPTION = getMess("COMPONENT_DESCRIPTION");
- private final String MSG_HANDLE_N_PX = getMess("HANDLE_N_PX");
- private final String MSG_TIP_N_PX = getMess("TIP_N_PX");
- private final String MSG_TIP_SHOULD_BE_VISIBLE = getMess("TIP_SHOULD_BE_VISIBLE");
- private final String MSG_TIP_SHOULD_NOT_BE_VISIBLE = getMess("TIP_SHOULD_NOT_BE_VISIBLE");
- private final String MSG_OFFSETS_SHOULD_BE_THE_SAME = getMess("OFFSETS_SHOULD_BE_THE_SAME");
- private final String MSG_TIP_FIRST_HALF = getMess("TIP_FIRST_HALF");
- private final String MSG_TIP_SECOND_HALF = getMess("TIP_SECOND_HALF");
- private final String MSG_HANDLE_FIRST_HALF = getMess("HANDLE_FIRST_HALF");
- private final String MSG_HANDLE_SECOND_HALF = getMess("HANDLE_SECOND_HALF");
- private final String MSG_VALUE_IN_INPUT = getMess("VALUE_IN_INPUT");
+ private final String MSG_HANDLE_N_PX = getMsg("HANDLE_N_PX");
+ private final String MSG_TIP_N_PX = getMsg("TIP_N_PX");
+ private final String MSG_TIP_SHOULD_BE_VISIBLE = getMsg("TIP_SHOULD_BE_VISIBLE");
+ private final String MSG_TIP_SHOULD_NOT_BE_VISIBLE = getMsg("TIP_SHOULD_NOT_BE_VISIBLE");
+ private final String MSG_OFFSETS_SHOULD_BE_THE_SAME = getMsg("OFFSETS_SHOULD_BE_THE_SAME");
+ private final String MSG_TIP_FIRST_HALF = getMsg("TIP_FIRST_HALF");
+ private final String MSG_TIP_SECOND_HALF = getMsg("TIP_SECOND_HALF");
+ private final String MSG_HANDLE_FIRST_HALF = getMsg("HANDLE_FIRST_HALF");
+ private final String MSG_HANDLE_SECOND_HALF = getMsg("HANDLE_SECOND_HALF");
+ private final String MSG_VALUE_IN_INPUT = getMsg("VALUE_IN_INPUT");
// locators
- private final String LOC_FIRST = String.format(getLoc("SLIDER_N"), 1);
- private final String LOC_FIRST_HANDLE = String.format(
- getLoc("SLIDER_N_HANDLE"), 1);
- private final String LOC_FIRST_TIP = String.format(getLoc("SLIDER_N_TIP"),
- 1);
- private final String LOC_FIRST_INPUT = String.format(
- getLoc("SLIDER_N_INPUT"), 1);
+ private final String LOC_EXAMPLE_HEADER = getLoc("EXAMPLE_HEADER");
+ private final String LOC_FIRST = format(getLoc("SLIDER_N"), 1);
+ private final String LOC_FIRST_HANDLE = format(getLoc("SLIDER_N_HANDLE"), 1);
+ private final String LOC_FIRST_TIP = format(getLoc("SLIDER_N_TIP"), 1);
+ private final String LOC_FIRST_INPUT = format(getLoc("SLIDER_N_INPUT"), 1);
- private final String LOC_SECOND = String.format(getLoc("SLIDER_N"), 2);
- private final String LOC_SECOND_HANDLE = String.format(
- getLoc("SLIDER_N_HANDLE"), 2);
- private final String LOC_SECOND_TIP = String.format(getLoc("SLIDER_N_TIP"),
- 2);
- private final String LOC_SECOND_INPUT = String.format(
- getLoc("SLIDER_N_INPUT"), 2);
+ private final String LOC_SECOND = format(getLoc("SLIDER_N"), 2);
+ private final String LOC_SECOND_HANDLE = format(getLoc("SLIDER_N_HANDLE"), 2);
+ private final String LOC_SECOND_TIP = format(getLoc("SLIDER_N_TIP"), 2);
+ private final String LOC_SECOND_INPUT = format(getLoc("SLIDER_N_INPUT"), 2);
- private final String LOC_THIRD = String.format(getLoc("SLIDER_N"), 3);
- private final String LOC_THIRD_HANDLE = String.format(
- getLoc("SLIDER_N_HANDLE"), 3);
- private final String LOC_THIRD_TIP = String.format(getLoc("SLIDER_N_TIP"),
- 3);
- private final String LOC_THIRD_INPUT = String.format(
- getLoc("SLIDER_N_INPUT"), 3);
+ private final String LOC_THIRD = format(getLoc("SLIDER_N"), 3);
+ private final String LOC_THIRD_HANDLE = format(getLoc("SLIDER_N_HANDLE"), 3);
+ private final String LOC_THIRD_TIP = format(getLoc("SLIDER_N_TIP"), 3);
+ private final String LOC_THIRD_INPUT = format(getLoc("SLIDER_N_INPUT"), 3);
/**
* Tests clicking on the first slider. First, it checks the offset of the handler and
@@ -63,24 +72,12 @@
*/
@Test
public void testFirstSliderMouse() {
- scrollIntoView(LOC_FIRST, true);
+ assertTrue(Math.abs(getOffset(LOC_FIRST_HANDLE + "@style") - 75) < 2, format(MSG_HANDLE_N_PX, 75));
+ assertTrue(Math.abs(getOffset(LOC_FIRST_TIP + "@style") - 75) < 2, format(MSG_TIP_N_PX, 75));
+ assertFalse(isDisplayed(LOC_FIRST_TIP), MSG_TIP_SHOULD_NOT_BE_VISIBLE);
- // TODO find out why it isn't offset by 75px but 74px
- assertTrue(Math.abs(getOffset(LOC_FIRST_HANDLE + "@style") - 75) < 2,
- String.format(MSG_HANDLE_N_PX, 75));
-
- assertTrue(Math.abs(getOffset(LOC_FIRST_TIP + "@style") - 75) < 2,
- String.format(MSG_TIP_N_PX, 75));
-
- String attr = selenium.getAttribute(LOC_FIRST_TIP + "@style");
- assertFalse(!attr.contains("display: none;"),
- MSG_TIP_SHOULD_NOT_BE_VISIBLE);
-
selenium.mouseDownAt(LOC_FIRST, "20,3");
-
- attr = selenium.getAttribute(LOC_FIRST_TIP + "@style");
- assertTrue(!attr.contains("display: none;"), MSG_TIP_SHOULD_BE_VISIBLE);
-
+ assertTrue(isDisplayed(LOC_FIRST_TIP), MSG_TIP_SHOULD_BE_VISIBLE);
selenium.mouseUp(LOC_FIRST);
int tipOffset = getOffset(LOC_FIRST_TIP + "@style");
@@ -102,8 +99,6 @@
*/
@Test
public void testFirstSliderKeyboard() {
- scrollIntoView(LOC_FIRST, true);
-
selenium.type(LOC_FIRST_INPUT, "10");
int tipOffset = getOffset(LOC_FIRST_TIP + "@style");
int handleOffset = getOffset(LOC_FIRST_HANDLE + "@style");
@@ -149,26 +144,13 @@
*/
@Test
public void testSecondSlider() {
- scrollIntoView(LOC_SECOND, true);
+ assertTrue(Math.abs(getOffset(LOC_SECOND_HANDLE + "@style") - 96) < 2, format(MSG_HANDLE_N_PX, 96));
+ assertTrue(Math.abs(getOffset(LOC_SECOND_TIP + "@style") - 96) < 2, format(MSG_TIP_N_PX, 96));
+ assertFalse(isDisplayed(LOC_SECOND_TIP), MSG_TIP_SHOULD_NOT_BE_VISIBLE);
- // TODO find out why it isn't offset by 96px
- assertTrue(Math.abs(getOffset(LOC_SECOND_HANDLE + "@style") - 96) < 2,
- String.format(MSG_HANDLE_N_PX, 96));
-
- assertTrue(Math.abs(getOffset(LOC_SECOND_TIP + "@style") - 96) < 2,
- String.format(MSG_TIP_N_PX, 96));
-
- String attr = selenium.getAttribute(LOC_SECOND_TIP + "@style");
- assertFalse(!attr.contains("display: none;"),
- MSG_TIP_SHOULD_NOT_BE_VISIBLE);
-
selenium.mouseDownAt(LOC_SECOND, "20,3");
-
- attr = selenium.getAttribute(LOC_SECOND_TIP + "@style");
// it is a slider without tip so it cannot be visible
- assertFalse(!attr.contains("display: none;"),
- MSG_TIP_SHOULD_NOT_BE_VISIBLE);
-
+ assertFalse(isDisplayed(LOC_SECOND_TIP), MSG_TIP_SHOULD_NOT_BE_VISIBLE);
selenium.mouseUp(LOC_SECOND);
int tipOffset = getOffset(LOC_SECOND_TIP + "@style");
@@ -188,26 +170,13 @@
*/
@Test
public void testThirdSliderMouse() {
- scrollIntoView(LOC_THIRD, true);
+ assertTrue(Math.abs(getOffset(LOC_THIRD_HANDLE + "@style") - 225) < 2, format(MSG_HANDLE_N_PX, 225));
+ assertTrue(Math.abs(getOffset(LOC_THIRD_TIP + "@style") - 225) < 2, format(MSG_TIP_N_PX, 225));
+ assertFalse(isDisplayed(LOC_THIRD_TIP), MSG_TIP_SHOULD_NOT_BE_VISIBLE);
- // TODO find out why it isn't offset by 75px but 74px
- assertTrue(Math.abs(getOffset(LOC_THIRD_HANDLE + "@style") - 225) < 2,
- String.format(MSG_HANDLE_N_PX, 225));
-
- assertTrue(Math.abs(getOffset(LOC_THIRD_TIP + "@style") - 225) < 2,
- String.format(MSG_TIP_N_PX, 225));
-
- String attr = selenium.getAttribute(LOC_THIRD_TIP + "@style");
- assertFalse(!attr.contains("display: none;"),
- MSG_TIP_SHOULD_NOT_BE_VISIBLE);
-
selenium.mouseDownAt(LOC_THIRD, "20,3");
-
- attr = selenium.getAttribute(LOC_THIRD_TIP + "@style");
// slider does not use the tip so it has to be invisible
- assertFalse(!attr.contains("display: none;"),
- MSG_TIP_SHOULD_NOT_BE_VISIBLE);
-
+ assertFalse(isDisplayed(LOC_THIRD_TIP), MSG_TIP_SHOULD_NOT_BE_VISIBLE);
selenium.mouseUp(LOC_THIRD);
int tipOffset = getOffset(LOC_THIRD_TIP + "@style");
@@ -230,8 +199,6 @@
*/
@Test
public void testThirdSliderKeyboard() {
- scrollIntoView(LOC_THIRD, true);
-
selenium.type(LOC_THIRD_INPUT, "10"); // 10 -> 0
int tipOffset = getOffset(LOC_THIRD_TIP + "@style");
int handleOffset = getOffset(LOC_THIRD_HANDLE + "@style");
@@ -277,16 +244,26 @@
assertEquals(value, 550, MSG_VALUE_IN_INPUT);
}
- /**
- * Tests the "View Source". It checks that the source code is not visible,
- * clicks on the link, and checks the first 2 components of source code,
- * i.e. that the source code begins with "<ui:composition".
- */
- @Test
- public void testSliderSource() {
- abstractTestSource(1, 1, "<", "ui:composition");
- }
+ /**
+ * Tests the "View Source". It checks that the source code is not visible,
+ * clicks on the link, and checks 9 lines of source code.
+ */
+ @Test
+ public void testExampleSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<p>Here is an example of default inputNumberSlider:</p>",
+ "<rich:inputNumberSlider value=\"50\" />",
+ "<p>Here is \"minimalistic\" input:</p>",
+ "<rich:inputNumberSlider value=\"50\" showInput=\"false\"",
+ "enableManualInput=\"false\" showBoundaryValues=\"false\"",
+ "showToolTip=\"false\" />",
+ "<rich:inputNumberSlider value=\"500\" width=\"500\" maxValue=\"1000\"",
+ "step=\"50\" showToolTip=\"false\" />",
+ };
+ abstractTestSource(1, "View Source", strings);
+ }
+
/**
* Returns the offset of the element. It requires a locator for an
* attribute, e.g. //div@style. It returns the 'left' attribute, e.g. for
@@ -301,10 +278,12 @@
}
/**
- * Loads the page containing the calendar component.
- */
- @BeforeMethod
- private void loadPage() {
- super.loadPage("richInputs", 8, MSG_COMPONENT_DESCRIPTION);
- }
+ * Loads the page containing needed component.
+ */
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Input Number Slider");
+ scrollIntoView(LOC_EXAMPLE_HEADER, true);
+ }
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inplaceSelect/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inplaceSelect/locators.properties 2009-09-09 13:44:10 UTC (rev 15505)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inplaceSelect/locators.properties 2009-09-09 14:52:04 UTC (rev 15506)
@@ -2,20 +2,20 @@
FIRST_SELECT_VIEW=//fieldset[1]//*[contains(@class,'rich-inplace-select-view')]
FIRST_INPUT_1=//fieldset[1]/div/span/input[1]
FIRST_INPUT_2=//fieldset[1]/div/span/input[2]
-FIRST_LIST_SPAN_N=//*[@class\='rich-inplace-select-list-scroll']/span[starts-with(text(),'Option')][%d]
+FIRST_LIST_SPAN_N=//*[@class\='rich-inplace-select-list-scroll']/span[starts-with(text(),'Option')][{0}]
FIRST_LIST_SPAN=//*[@class\='rich-inplace-select-list-scroll']/span[starts-with(text(),'Option')]
SECOND=//fieldset[2]/div/div[1]/div
SECOND_INPUT_1=//fieldset[2]/div/div[1]/div/input[1]
SECOND_INPUT_2=//fieldset[2]/div/div[1]/div/input[2]
-SECOND_LIST_SPAN_N=//*[not(contains(@class,'rich-inplace-select-view'))]/*/*/*/*[@class\='rich-inplace-select-list-scroll']/span[text()\='Alabama']/../span[%d]
+SECOND_LIST_SPAN_N=//*[not(contains(@class,'rich-inplace-select-view'))]/*/*/*/*[@class\='rich-inplace-select-list-scroll']/span[text()\='Alabama']/../span[{0}]
SECOND_LIST_SPAN=//*[not(contains(@class,'rich-inplace-select-view'))]/*/*/*/*[@class\='rich-inplace-select-list-scroll']/span[text()\='Alabama']/../span
SECOND_OK_BUTTON=//fieldset[2]/div/div[1]/div/div/div[2]/input[1]
THIRD=//fieldset[3]/div/form/table/tbody/tr/td[2]/span
THIRD_INPUT_1=//fieldset[3]/div/form/table/tbody/tr/td[2]/span/input[1]
THIRD_INPUT_2=//fieldset[3]/div/form/table/tbody/tr/td[2]/span/input[2]
-THIRD_LIST_SPAN_N=//*[not(contains(@class,'rich-inplace-select-view'))]/*/*/*/*[@class\='rich-inplace-select-list-scroll']/span[text()\='Alabama']/../span[%d]
+THIRD_LIST_SPAN_N=//*[not(contains(@class,'rich-inplace-select-view'))]/*/*/*/*[@class\='rich-inplace-select-list-scroll']/span[text()\='Alabama']/../span[{0}]
THIRD_LIST_SPAN=//*[not(contains(@class,'rich-inplace-select-view'))]/*/*/*/*[@class\='rich-inplace-select-list-scroll']/span[text()\='Alabama']/../span
THIRD_CAPITAL=//fieldset[3]/div/form/table/tbody/tr/td[3]/span
THIRD_SAVE_BUTTON=//fieldset[3]/div/form/table/tbody/tr/td[2]/span/div/button[1]
\ No newline at end of file
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inplaceSelect/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inplaceSelect/messages.properties 2009-09-09 13:44:10 UTC (rev 15505)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inplaceSelect/messages.properties 2009-09-09 14:52:04 UTC (rev 15506)
@@ -1,4 +1,3 @@
-COMPONENT_DESCRIPTION=Inplace Selectis a simple input component which displays current value as outputText
CLICK_HERE_TO_EDIT=The component should contain "Click here to edit".
DOUBLE_CLICK_TO_EDIT=The component should contain "Double click to edit".
READ_ONLY=The input field of the component should be read only.
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inputNumberSlider/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inputNumberSlider/locators.properties 2009-09-09 13:44:10 UTC (rev 15505)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inputNumberSlider/locators.properties 2009-09-09 14:52:04 UTC (rev 15506)
@@ -1,4 +1,5 @@
-SLIDER_N=//fieldset[1]/div/table[%d]/tbody/tr[2]/td/table/tbody/tr/td
-SLIDER_N_HANDLE=//fieldset[1]/div/table[%d]/tbody/tr[2]/td/table/tbody/tr/td/div[1]/div[2]
-SLIDER_N_TIP=//fieldset[1]/div/table[%d]/tbody/tr[2]/td/table/tbody/tr/td/div[1]/div[1]
-SLIDER_N_INPUT=//fieldset[1]/div/table[%d]/tbody/tr[1]/td[3]/input
+EXAMPLE_HEADER=//fieldset/legend
+SLIDER_N=//fieldset[1]/div/table[{0}]/tbody/tr[2]/td/table/tbody/tr/td
+SLIDER_N_HANDLE=//fieldset[1]/div/table[{0}]/tbody/tr[2]/td/table/tbody/tr/td/div[1]/div[2]
+SLIDER_N_TIP=//fieldset[1]/div/table[{0}]/tbody/tr[2]/td/table/tbody/tr/td/div[1]/div[1]
+SLIDER_N_INPUT=//fieldset[1]/div/table[{0}]/tbody/tr[1]/td[3]/input
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inputNumberSlider/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inputNumberSlider/messages.properties 2009-09-09 13:44:10 UTC (rev 15505)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/inputNumberSlider/messages.properties 2009-09-09 14:52:04 UTC (rev 15506)
@@ -1,6 +1,5 @@
-COMPONENT_DESCRIPTION=InputNumberSlider is a highly customizable component
-HANDLE_N_PX=Handle should be offset by %d pixels.
-TIP_N_PX=The box with a tip should be offset by %d pixels.
+HANDLE_N_PX=Handle should be offset by {0} pixels.
+TIP_N_PX=The box with a tip should be offset by {0} pixels.
TIP_SHOULD_BE_VISIBLE=The box with a tip should be visible.
TIP_SHOULD_NOT_BE_VISIBLE=The box with a tip should not be visible.
OFFSETS_SHOULD_BE_THE_SAME=Tip and handle's offsets should be the same.
15 years, 4 months
JBoss Rich Faces SVN: r15505 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test: java/org/jboss/richfaces/integrationTest/dropDownMenu and 9 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2009-09-09 09:44:10 -0400 (Wed, 09 Sep 2009)
New Revision: 15505
Added:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dropDownMenu/
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dropDownMenu/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dropDownMenu/messages.properties
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/contextMenu/ContextMenuImageTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/contextMenu/ContextMenuTableTestCase.java
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/editor/AdvancedEditorTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/editor/SimpleEditorTestCase.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/inplaceInput/InplaceInputTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/spinner/SpinnerTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/contextMenu/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/contextMenu/messages.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/editor/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/editor/messages.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/fileUpload/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/fileUpload/messages.properties
Log:
* SpinnerTestCase, InplaceInputTestCase, FileUploadTestCase, SimpleEditorTestCase, AdvancedEditorTestCase, HorizontalMenuTestCase, ContextMenuTableTestCase and ContextMenuImageTestCase refactored
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/contextMenu/ContextMenuImageTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/contextMenu/ContextMenuImageTestCase.java 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/contextMenu/ContextMenuImageTestCase.java 2009-09-09 13:44:10 UTC (rev 15505)
@@ -33,11 +33,11 @@
*/
public class ContextMenuImageTestCase extends AbstractSeleniumRichfacesTestCase {
- private final String LOC_HEADER = getLoc("HEADER");
- private final String LOC_IMAGE = getLoc("IMAGE");
- private final String LOC_CONTEXT_MENU = getLoc("CONTEXT_MENU");
- private final String LOC_ZOOM_IN = getLoc("ZOOM_IN");
- private final String LOC_ZOOM_OUT = getLoc("ZOOM_OUT");
+ private final String LOC_FIRST_HEADER = getLoc("FIRST_HEADER");
+ private final String LOC_FIRST_IMAGE = getLoc("FIRST_IMAGE");
+ private final String LOC_FIRST_CONTEXT_MENU = getLoc("FIRST_CONTEXT_MENU");
+ private final String LOC_FIRST_ZOOM_IN = getLoc("FIRST_ZOOM_IN");
+ private final String LOC_FIRST_ZOOM_OUT = getLoc("FIRST_ZOOM_OUT");
/**
* Clicks into image and verifies that the context menu is displayed.
@@ -45,11 +45,11 @@
@Test
public void testImageContextMenu() {
// open context menu
- selenium.fireEvent(LOC_IMAGE, "contextmenu");
+ selenium.fireEvent(LOC_FIRST_IMAGE, "contextmenu");
// check that context menu is visible
- waitForElement(LOC_CONTEXT_MENU);
- assertTrue(isDisplayed(LOC_CONTEXT_MENU), "Context menu should be visible.");
+ waitForElement(LOC_FIRST_CONTEXT_MENU);
+ assertTrue(isDisplayed(LOC_FIRST_CONTEXT_MENU), "Context menu should be visible.");
}
/**
@@ -60,25 +60,25 @@
@Test
public void testZoomIn() {
// get the size of image at the beginning
- int originalWidth = selenium.getElementWidth(LOC_IMAGE).intValue();
- int originalHeight = selenium.getElementHeight(LOC_IMAGE).intValue();
+ int originalWidth = selenium.getElementWidth(LOC_FIRST_IMAGE).intValue();
+ int originalHeight = selenium.getElementHeight(LOC_FIRST_IMAGE).intValue();
// open context menu
- selenium.fireEvent(LOC_IMAGE, "contextmenu");
- waitForElement(LOC_ZOOM_IN);
+ selenium.fireEvent(LOC_FIRST_IMAGE, "contextmenu");
+ waitForElement(LOC_FIRST_ZOOM_IN);
// zoom in
- selenium.click(LOC_ZOOM_IN);
- selenium.click(LOC_ZOOM_IN);
- selenium.click(LOC_ZOOM_IN);
- selenium.click(LOC_ZOOM_IN);
+ selenium.click(LOC_FIRST_ZOOM_IN);
+ selenium.click(LOC_FIRST_ZOOM_IN);
+ selenium.click(LOC_FIRST_ZOOM_IN);
+ selenium.click(LOC_FIRST_ZOOM_IN);
// get the size of image after zooming in
- int width = selenium.getElementWidth(LOC_IMAGE).intValue();
+ int width = selenium.getElementWidth(LOC_FIRST_IMAGE).intValue();
assertTrue(width > originalWidth, format(
"After zooming in, the image should be bigger (width {0}px -> {1}px).", originalWidth, width));
- int height = selenium.getElementHeight(LOC_IMAGE).intValue();
+ int height = selenium.getElementHeight(LOC_FIRST_IMAGE).intValue();
assertTrue(height > originalHeight, format(
"After zooming in, the image should be bigger (height {0}px -> {1}px).", originalHeight, height));
}
@@ -91,25 +91,25 @@
@Test
void testZoomOut() {
// get the size of image at the beginning
- int originalWidth = selenium.getElementWidth(LOC_IMAGE).intValue();
- int originalHeight = selenium.getElementHeight(LOC_IMAGE).intValue();
+ int originalWidth = selenium.getElementWidth(LOC_FIRST_IMAGE).intValue();
+ int originalHeight = selenium.getElementHeight(LOC_FIRST_IMAGE).intValue();
// open context menu
- selenium.fireEvent(LOC_IMAGE, "contextmenu");
- waitForElement(LOC_ZOOM_OUT);
+ selenium.fireEvent(LOC_FIRST_IMAGE, "contextmenu");
+ waitForElement(LOC_FIRST_ZOOM_OUT);
// zoom out
- selenium.click(LOC_ZOOM_OUT);
- selenium.click(LOC_ZOOM_OUT);
- selenium.click(LOC_ZOOM_OUT);
- selenium.click(LOC_ZOOM_OUT);
+ selenium.click(LOC_FIRST_ZOOM_OUT);
+ selenium.click(LOC_FIRST_ZOOM_OUT);
+ selenium.click(LOC_FIRST_ZOOM_OUT);
+ selenium.click(LOC_FIRST_ZOOM_OUT);
// get the size of image after zooming out
- int width = selenium.getElementWidth(LOC_IMAGE).intValue();
+ int width = selenium.getElementWidth(LOC_FIRST_IMAGE).intValue();
assertTrue(originalWidth > width, format(
"After zooming out, the image should be smaller (width {0}px -> {1}px).", originalWidth, width));
- int height = selenium.getElementHeight(LOC_IMAGE).intValue();
+ int height = selenium.getElementHeight(LOC_FIRST_IMAGE).intValue();
assertTrue(originalHeight > height, format(
"After zooming out, the image should be smaller (height {0}px -> {1}px).", originalHeight, height));
}
@@ -123,24 +123,24 @@
@Test
void testZoomInZoomOut() {
// get the size of image at the beginning
- int originalWidth = selenium.getElementWidth(LOC_IMAGE).intValue();
- int originalHeight = selenium.getElementHeight(LOC_IMAGE).intValue();
+ int originalWidth = selenium.getElementWidth(LOC_FIRST_IMAGE).intValue();
+ int originalHeight = selenium.getElementHeight(LOC_FIRST_IMAGE).intValue();
// open context menu
- selenium.fireEvent(LOC_IMAGE, "contextmenu");
- waitForElement(LOC_ZOOM_IN);
+ selenium.fireEvent(LOC_FIRST_IMAGE, "contextmenu");
+ waitForElement(LOC_FIRST_ZOOM_IN);
- selenium.click(LOC_ZOOM_IN);
- selenium.click(LOC_ZOOM_OUT);
+ selenium.click(LOC_FIRST_ZOOM_IN);
+ selenium.click(LOC_FIRST_ZOOM_OUT);
// get the size of image after zooming in and out
// it does not zoom accurately so there has to be some tolerance
- int width = selenium.getElementWidth(LOC_IMAGE).intValue();
+ int width = selenium.getElementWidth(LOC_FIRST_IMAGE).intValue();
assertTrue(Math.abs(width - originalWidth) < 3, format(
"After zooming in and out, the image should have the same size (width {0}px -> {1}px).", originalWidth,
width));
- int height = selenium.getElementHeight(LOC_IMAGE).intValue();
+ int height = selenium.getElementHeight(LOC_FIRST_IMAGE).intValue();
assertTrue(Math.abs(height - originalHeight) < 3, format(
"After zooming in and out, the image should have the same size (height {0}px -> {1}px).",
originalHeight, height));
@@ -168,12 +168,13 @@
/**
* Loads the needed page.
*/
+ @SuppressWarnings("unused")
@BeforeMethod
private void loadPage() {
openComponent("Context Menu");
// XXX: context menu opens in top left corner so it isn't visible if it
// scrolls down
- // scrollIntoView(LOC_HEADER, true);
+ // scrollIntoView(LOC_FIRST_HEADER, true);
}
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/contextMenu/ContextMenuTableTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/contextMenu/ContextMenuTableTestCase.java 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/contextMenu/ContextMenuTableTestCase.java 2009-09-09 13:44:10 UTC (rev 15505)
@@ -1,3 +1,21 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
package org.jboss.richfaces.integrationTest.contextMenu;
import static org.testng.Assert.assertEquals;
@@ -2,2 +20,3 @@
import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
@@ -9,153 +28,179 @@
import org.testng.annotations.Test;
/**
+ * Tests context menu in the example with table.
*
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
public class ContextMenuTableTestCase extends AbstractSeleniumRichfacesTestCase {
- private String xpathPrefix;
+ private final String LOC_SECOND_EXAMPLE_HEADER = getLoc("SECOND_EXAMPLE_HEADER");
+ private final String LOC_SECOND_CONTEXT_MENU = getLoc("SECOND_CONTEXT_MENU");
+ private final String LOC_SECOND_LAST_MENU_ACTION = getLoc("SECOND_LAST_MENU_ACTION");
- @Test
- public void testTableContextMenu() {
- xpathPrefix = "//fieldset[2]/div/form";
+ private final String LOC_SECOND_CAR_DETAILS = getLoc("SECOND_CAR_DETAILS");
+ private final String LOC_SECOND_ACTIONS = getLoc("SECOND_ACTIONS");
+ private final String LOC_SECOND_ACTION_PREFORMATTED = getLoc("SECOND_ACTION_PREFORMATTED");
- // check that the context menu is not visible
- boolean present = selenium.isElementPresent(xpathPrefix + "/div/div");
- assertFalse(present, "Context menu should be invisible at start.");
+ private final String LOC_SECOND_LINE_3_COLUMN_1 = getLoc("SECOND_LINE_3_COLUMN_1");
+ private final String LOC_SECOND_LINE_3_COLUMN_2 = getLoc("SECOND_LINE_3_COLUMN_2");
+ private final String LOC_SECOND_LINE_6_COLUMN_2 = getLoc("SECOND_LINE_6_COLUMN_2");
+ private final String LOC_SECOND_LINE_1_COLUMN_3 = getLoc("SECOND_LINE_1_COLUMN_3");
- // check that the 'Last Menu Action' is empty
- String text = selenium.getText(xpathPrefix
- + "/table/tbody/tr/td[2]/span/div/div[2]");
- assertEquals(text, "", "Last menu action should be empty.");
+ private final String MSG_SECOND_CAR_DETAILS_PREFORMATTED = getMsg("SECOND_CAR_DETAILS_PREFORMATTED");
+ private final String MSG_SECOND_PUT_PRODUCER_MODEL_TO_BASKET_PREFORMATTED = getMsg("SECOND_PUT_PRODUCER_MODEL_TO_BASKET_PREFORMATTED");
+ private final String MSG_SECOND_READ_COMMENTS_PREFORMATTED = getMsg("SECOND_READ_COMMENTS_PREFORMATTED");
+ private final String MSG_SECOND_GO_TO_PRODUCER_SITE_PREFORMATTED = getMsg("SECOND_GO_TO_PRODUCER_SITE_PREFORMATTED");
- // open context menu on third line, first column
- selenium.click(xpathPrefix
- + "/table/tbody/tr/td[1]/table/tbody/tr[3]/td[1]");
- waitForElement(xpathPrefix + "/div/div/div[1]");
- text = selenium.getAttribute(xpathPrefix + "/div/div/div[1]@style");
- assertFalse(text.contains("display: none;"),
- "Context menu should be visible after clicking on first column.");
+ /**
+ * Tests context menu. It checks that context menu is not visible at start,
+ * clicks into various places in table and checks that menu appeared.
+ */
+ @Test
+ public void testTableContextMenu() {
+ // check that the context menu is not visible
+ boolean present = selenium.isElementPresent(LOC_SECOND_CONTEXT_MENU);
+ assertFalse(present, "Context menu should be invisible at start.");
- // open context menu on sixth line, second column
- selenium.click(xpathPrefix
- + "/table/tbody/tr/td[1]/table/tbody/tr[6]/td[2]");
- waitForElement(xpathPrefix + "/div/div/div[1]");
- text = selenium.getAttribute(xpathPrefix + "/div/div/div[1]@style");
- assertFalse(text.contains("display: none;"),
- "Context menu should be visible after clicking on second column.");
+ // check that the 'Last Menu Action' is empty
+ String text = selenium.getText(LOC_SECOND_LAST_MENU_ACTION);
+ assertEquals(text, "", "Last menu action should be empty.");
- // open context menu on first line, third column (16773)
- selenium.click(xpathPrefix
- + "/table/tbody/tr/td[1]/table/tbody/tr[1]/td[3]");
- waitForElement(xpathPrefix + "/div/div/div[1]");
- text = selenium.getAttribute(xpathPrefix + "/div/div/div[1]@style");
- assertFalse(text.contains("display: none;"),
- "Context menu should be visible after clicking on third column.");
- }
+ // open context menu on third line, first column
+ selenium.click(LOC_SECOND_LINE_3_COLUMN_1);
+ waitForElement(LOC_SECOND_CONTEXT_MENU);
+ assertTrue(isDisplayed(LOC_SECOND_CONTEXT_MENU),
+ "Context menu should be visible after clicking on first column.");
- @Test
- public void testClickOnCarDetails() {
- xpathPrefix = "//fieldset[2]/div/form";
- String text = null;
+ // open context menu on sixth line, second column
+ selenium.click(LOC_SECOND_LINE_6_COLUMN_2);
+ waitForElement(LOC_SECOND_CONTEXT_MENU);
+ assertTrue(isDisplayed(LOC_SECOND_CONTEXT_MENU),
+ "Context menu should be visible after clicking on second column.");
- String producer = selenium.getText(xpathPrefix
- + "/table/tbody/tr/td[1]/table/tbody/tr[3]/td[1]");
- String model = selenium.getText(xpathPrefix
- + "/table/tbody/tr/td[1]/table/tbody/tr[3]/td[2]");
+ // open context menu on first line, third column
+ selenium.click(LOC_SECOND_LINE_1_COLUMN_3);
+ waitForElement(LOC_SECOND_CONTEXT_MENU);
+ assertTrue(isDisplayed(LOC_SECOND_CONTEXT_MENU),
+ "Context menu should be visible after clicking on third column.");
+ }
- // open context menu on third line, first column
- selenium.click(xpathPrefix
- + "/table/tbody/tr/td[1]/table/tbody/tr[3]/td[1]");
- waitForElement(xpathPrefix + "/div/div/div[1]");
- text = selenium.getAttribute(xpathPrefix + "/div/div/div[1]@style");
- assertFalse(text.contains("display: none;"),
- "Context menu should be visible after clicking on first column.");
+ /**
+ * Tests clicking on "Car Details" in context menu".
+ */
+ @Test
+ public void testClickOnCarDetails() {
+ String producer = selenium.getText(LOC_SECOND_LINE_3_COLUMN_1);
+ String model = selenium.getText(LOC_SECOND_LINE_3_COLUMN_2);
- // click '<car> details'
- selenium.click(xpathPrefix + "/div/div/div[1]/div/div[1]/span[2]");
- waitFor(400);
- text = selenium.getText(xpathPrefix
- + "/table/tbody/tr/td[2]/span/div/div[2]");
- assertEquals(text, producer + " " + model + " details",
- "Details of car:");
- }
+ // open context menu on third line, first column
+ selenium.click(LOC_SECOND_LINE_3_COLUMN_1);
+ waitForElement(LOC_SECOND_CONTEXT_MENU);
+ assertTrue(isDisplayed(LOC_SECOND_CONTEXT_MENU),
+ "Context menu should be visible after clicking on first column.");
- @Test
- public void testClickOnPutCarToBasket() {
- clickAction(1);
- }
+ // click '<car> details'
+ selenium.click(LOC_SECOND_CAR_DETAILS);
+ waitFor(400);
+ String text = selenium.getText(LOC_SECOND_LAST_MENU_ACTION);
+ assertEquals(text, format(MSG_SECOND_CAR_DETAILS_PREFORMATTED, producer, model), "Details of car.");
+ }
- @Test
- public void testClickOnReadComments() {
- clickAction(2);
- }
+ /**
+ * Tests clicking on "Put Car to Basket" in context menu.
+ */
+ @Test
+ public void testClickOnPutCarToBasket() {
+ clickAction(1);
+ }
- @Test
- public void testClickOnGoToProducerSite() {
- clickAction(3);
- }
+ /**
+ * Tests clicking on "Read Comments" in context menu.
+ */
+ @Test
+ public void testClickOnReadComments() {
+ clickAction(2);
+ }
- @Test
- public void testContextMenuTableSource() {
- abstractTestSource(2, 1, "<", "f:subview");
- }
+ /**
+ * Tests clicking on "Go to Producer Site" in context menu.
+ */
+ @Test
+ public void testClickOnGoToProducerSite() {
+ clickAction(3);
+ }
- private void clickAction(int index) {
- xpathPrefix = "//fieldset[2]/div/form";
- String text = null;
+ /**
+ * Tests the "View Source". It checks that the source code is not visible,
+ * clicks on the link, and checks 15 lines of source code.
+ */
+ @Test
+ public void testContextMenuTableSource() {
+ String[] strings = new String[] { "<f:subview xmlns=\"http://www.w3.org/1999/xhtml\"", "<h:form id=\"form\">",
+ "<rich:contextMenu attached=\"false\" id=\"menu\" submitMode=\"ajax\">",
+ "<rich:menuItem ajaxSingle=\"true\">",
+ "<a4j:actionparam name=\"det\" assignTo=\"#{ddmenu.current}\" value=\"{car} {model} details\"/>",
+ "<rich:menuGroup value=\"Actions\"> ", "<rich:menuItem value=\"Read Comments\" ajaxSingle=\"true\">",
+ "<rich:dataTable value=\"#{dataTableScrollerBean.tenRandomCars}\" var=\"car\" id=\"table\"",
+ "onRowMouseOver=\"this.style.backgroundColor='#F8F8F8'\"",
+ "onRowMouseOut=\"this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'\" rowClasses=\"cur\">",
+ "<rich:column>", "<rich:componentControl event=\"onRowClick\" for=\"menu\" operation=\"show\">",
+ "<f:param value=\"#{car.model}\" name=\"model\"/>", "<a4j:outputPanel ajaxRendered=\"true\">",
+ "<f:facet name=\"header\">Last Menu Action</f:facet>", };
- String producer = selenium.getText(xpathPrefix
- + "/table/tbody/tr/td[1]/table/tbody/tr[3]/td[1]");
- String model = selenium.getText(xpathPrefix
- + "/table/tbody/tr/td[1]/table/tbody/tr[3]/td[2]");
+ abstractTestSource(2, "View Source", strings);
+ }
- // open context menu on third line, first column
- selenium.click(xpathPrefix
- + "/table/tbody/tr/td[1]/table/tbody/tr[3]/td[1]");
- waitForElement(xpathPrefix + "/div/div/div[1]");
- text = selenium.getAttribute(xpathPrefix + "/div/div/div[1]@style");
- assertFalse(text.contains("display: none;"),
- "Context menu should be visible after clicking on first column.");
+ /**
+ * Helper method that performs clicks on items in submenu of context menu.
+ *
+ * @param index
+ * which action should be performed
+ */
+ private void clickAction(int index) {
+ String producer = selenium.getText(LOC_SECOND_LINE_3_COLUMN_1);
+ String model = selenium.getText(LOC_SECOND_LINE_3_COLUMN_2);
- // click 'Actions'
- selenium.click(xpathPrefix + "/div/div/div[2]");
- waitFor(400);
+ // open context menu on third line, first column
+ selenium.click(LOC_SECOND_LINE_3_COLUMN_1);
+ waitForElement(LOC_SECOND_CONTEXT_MENU);
+ assertTrue(isDisplayed(LOC_SECOND_CONTEXT_MENU),
+ "Context menu should be visible after clicking on first column.");
- // click 'Put <car> To Basket'
- selenium.click(xpathPrefix + "/div/div/div[2]/div/div[" + index
- + "]/span[2]");
- waitFor(400);
- text = selenium.getText(xpathPrefix
- + "/table/tbody/tr/td[2]/span/div/div[2]");
+ // click 'Actions'
+ selenium.click(LOC_SECOND_ACTIONS);
+ waitFor(400);
- switch (index) {
- case 1:
- assertEquals(text, "Put " + producer + " " + model + " To Basket",
- "Action put to basket:");
- break;
- case 2:
- assertEquals(text, "Read Comments", "Action read comments:");
- break;
- case 3:
- assertEquals(text, "Go to " + producer + " site",
- "Action go to site:");
- break;
- default:
- fail("Wrong index.");
- }
- }
+ // click "Put <car> To Basket", "Read Comments" or
+ // "Go to <producer> site"
+ selenium.click(format(LOC_SECOND_ACTION_PREFORMATTED, index));
+ waitFor(400);
+ String text = selenium.getText(LOC_SECOND_LAST_MENU_ACTION);
- /**
- * Loads the needed page.
- */
- @BeforeMethod
- private void loadPage() {
- super
- .loadPage(
- "richMenu",
- 1,
- "RichFaces Context menu is a component that allows to organize the hierarchical context menus");
- }
+ switch (index) {
+ case 1:
+ assertEquals(text, format(MSG_SECOND_PUT_PRODUCER_MODEL_TO_BASKET_PREFORMATTED, producer, model),
+ "Action put to basket:");
+ break;
+ case 2:
+ assertEquals(text, MSG_SECOND_READ_COMMENTS_PREFORMATTED, "Action read comments:");
+ break;
+ case 3:
+ assertEquals(text, format(MSG_SECOND_GO_TO_PRODUCER_SITE_PREFORMATTED, producer), "Action go to site:");
+ break;
+ default:
+ fail("Wrong index.");
+ }
+ }
+
+ /**
+ * Loads the needed page.
+ */
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Context Menu");
+ scrollIntoView(LOC_SECOND_EXAMPLE_HEADER, true);
+ }
}
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-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/dropDownMenu/HorizontalMenuTestCase.java 2009-09-09 13:44:10 UTC (rev 15505)
@@ -1,6 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
package org.jboss.richfaces.integrationTest.dropDownMenu;
import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
@@ -8,116 +27,131 @@
import org.testng.annotations.Test;
/**
+ * Test horizontal version of drop down menu.
*
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
public class HorizontalMenuTestCase extends AbstractSeleniumRichfacesTestCase {
- private String xpathPrefix;
+ private final String LOC_FIRST_EXAMPLE_HEADER = getLoc("FIRST_EXAMPLE_HEADER");
+ private final String LOC_FIRST_CURRENT_SELECTION = getLoc("FIRST_CURRENT_SELECTION");
+ private final String LOC_FIRST_MENU = getLoc("FIRST_MENU");
+ private final String LOC_FIRST_MENU_NEW = getLoc("FIRST_MENU_NEW");
+ private final String LOC_FIRST_MENU_SAVE_ALL = getLoc("FIRST_MENU_SAVE_ALL");
+ private final String LOC_FIRST_MENU_SEPARATOR = getLoc("FIRST_MENU_SEPARATOR");
+ private final String LOC_FIRST_MENU_IMAGE = getLoc("FIRST_MENU_IMAGE");
+ private final String LOC_FIRST_MENU_LINK_HOMEPAGE = getLoc("FIRST_MENU_LINK_HOMEPAGE");
+ private final String LOC_FIRST_MENU_LINK_FORUM = getLoc("FIRST_MENU_LINK_FORUM");
- @Test
- public void testHorizontalMenu() {
- xpathPrefix = "//fieldset[1]/div/form/table/tbody/tr/td[1]";
+ private final String MSG_FIRST_INITIAL_CURRENT_SELECTION = getMsg("FIRST_INITIAL_CURRENT_SELECTION");
+ private final String MSG_FIRST_CURRENT_SELECTION_NEW = getMsg("FIRST_CURRENT_SELECTION_NEW");
+ private final String MSG_FIRST_CURRENT_SELECTION_SAVE_ALL = getMsg("FIRST_CURRENT_SELECTION_SAVE_ALL");
- String text = selenium.getAttribute(xpathPrefix
- + "/div/div[2]/div[1]@style");
- assertTrue(text.contains("display: none;"),
- "Menu should not be expanded at start.");
+ /**
+ * Checks that menu is not shown at start and verifies that text in current
+ * selection area is empty.
+ */
+ @Test
+ public void testHorizontalMenu() {
+ assertFalse(isDisplayed(LOC_FIRST_MENU), "Menu should not be expanded at start.");
- // FIXME menu does not show after click or fireEvent
- // click on 'File'
- // selenium.click(xpathPrefix + "/div/div[1]/img");
- // selenium.fireEvent(xpathPrefix + "/div/div[1]/img", "click");
- // waitFor(1000);
- // text = selenium.getAttribute(xpathPrefix +
- // "/div/div[2]/div[1]@style");
- // System.out.println("------------- " + text + " ------------------");
- // assertFalse(text.contains("display: none;"),
- // "Menu should be expanded after clicking on File.");
+ String text = selenium.getText(LOC_FIRST_CURRENT_SELECTION);
+ assertEquals(text, MSG_FIRST_INITIAL_CURRENT_SELECTION, "Last menu action should be empty.");
+ }
- // check that the 'Last Menu Action' is empty
- text = selenium.getText("//fieldset[1]/div/span[1]/span[1]");
- assertEquals(text, "", "Last menu action should be empty.");
- }
+ /**
+ * Tests the "New" menu item. It clicks the item and verifies that text is
+ * shown in current selection.
+ */
+ @Test
+ public void testMenuItem() {
+ selenium.click(LOC_FIRST_MENU_NEW);
+ waitFor(400);
- @Test
- public void testMenuItem() {
- xpathPrefix = "//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div[2]/div/div/div[1]";
- String text = null;
+ String text = selenium.getText(LOC_FIRST_CURRENT_SELECTION);
+ assertEquals(text, MSG_FIRST_CURRENT_SELECTION_NEW, "Text shown in current selection.");
+ }
- selenium.click(xpathPrefix);
- waitFor(400);
+ /**
+ * Tests menu group. It chooses "Save All" from the group "Save as...".
+ */
+ @Test
+ public void testMenuGroup() {
+ selenium.click(LOC_FIRST_MENU_SAVE_ALL);
+ waitFor(400);
- text = selenium.getText("//fieldset[1]/div/span/span");
- assertEquals(text, "New", "Text shown in 'Current Selection:'");
- }
+ String text = selenium.getText(LOC_FIRST_CURRENT_SELECTION);
+ assertEquals(text, MSG_FIRST_CURRENT_SELECTION_SAVE_ALL, "Text shown in 'Current Selection:'");
+ }
- @Test
- public void testMenuGroup() {
- xpathPrefix = "//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div[2]/div[2]/div/div[2]";
- String text = null;
+ /**
+ * Tests separator in menu.
+ */
+ @Test
+ public void testSeparator() {
+ assertTrue(belongsClass("rich-menu-separator", LOC_FIRST_MENU_SEPARATOR),
+ "There should be a separator in the menu.");
+ }
- selenium.click(xpathPrefix);
- waitFor(400);
+ /**
+ * Tests icon next to menu item.
+ */
+ @Test
+ public void testIcon() {
+ int width = selenium.getElementWidth(LOC_FIRST_MENU_IMAGE).intValue();
+ int height = selenium.getElementHeight(LOC_FIRST_MENU_IMAGE).intValue();
- text = selenium.getText("//fieldset[1]/div/span/span");
- assertEquals(text, "Save All", "Text shown in 'Current Selection:'");
- }
+ assertTrue(width > 0, "Menu item \"File\" should have a visible icon (width > 0).");
+ assertTrue(height > 0, "Menu item \"File\" should have a visible icon (height > 0).");
+ }
- @Test
- public void testSeparator() {
- xpathPrefix = "//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div[2]/div[1]/div/div[5]";
- String text = null;
+ /**
+ * Tests link to the RichFaces homepage.
+ */
+ @Test
+ public void testLinkRFHomePage() {
+ String location = selenium.getAttribute(LOC_FIRST_MENU_LINK_HOMEPAGE + "@href");
+ assertTrue(location.contains("http://"), "Href has to contain http://");
+ }
- text = selenium.getAttribute(xpathPrefix + "@class");
- assertTrue(text.equals("rich-menu-separator"),
- "There should be a separator in the menu.");
- }
+ /**
+ * Tests link to the RichFaces forum.
+ */
+ @Test
+ public void testLinkRFForum() {
+ String location = selenium.getAttribute(LOC_FIRST_MENU_LINK_FORUM + "@href");
+ assertTrue(location.contains("http://"), "Href has to contain http://");
+ }
- @Test
- public void testIcon() {
- xpathPrefix = "//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div[1]/img";
+ /**
+ * Tests the "View Source". It checks that the source code is not visible,
+ * clicks on the link, and checks 17 lines of source code.
+ */
+ @Test
+ public void testHorizontalMenuSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"", "<h:form>",
+ "<rich:toolBar>", "<rich:dropDownMenu>", "<f:facet name=\"label\"> ",
+ "<h:graphicImage value=\"/images/icons/copy.gif\" styleClass=\"pic\"/>",
+ "<rich:menuItem submitMode=\"ajax\" value=\"New\"",
+ "action=\"#{ddmenu.doNew}\" icon=\"/images/icons/create_doc.gif\">",
+ "<rich:menuGroup value=\"Save As...\">", "<rich:menuItem submitMode=\"ajax\" value=\"Save\" ",
+ "action=\"#{ddmenu.doSave}\" icon=\"/images/icons/save.gif\" />",
+ "<rich:menuItem submitMode=\"ajax\" value=\"Save All\"", "action=\"#{ddmenu.doSaveAll}\">",
+ "<f:facet name=\"icon\">", "<h:graphicImage value=\"/images/icons/save_all.gif\" />",
+ "<rich:menuSeparator id=\"menuSeparator11\" />",
+ "<h:outputLink value=\"http://labs.jboss.com/jbossrichfaces/\">", };
- int width = selenium.getElementWidth(xpathPrefix).intValue();
- int height = selenium.getElementHeight(xpathPrefix).intValue();
+ abstractTestSource(1, "View Source", strings);
+ }
- assertTrue(width > 0,
- "Menu item 'File' should have a visible icon (width > 0).");
- assertTrue(height > 0,
- "Menu item 'File' should have a visible icon (height > 0).");
- }
-
- @Test
- public void testLinkRFHomePage() {
- xpathPrefix = "//fieldset[1]/div/form/table/tbody/tr/td[2]/div/div[2]/div/div/div[1]/span[2]/a";
-
- String location = selenium.getAttribute(xpathPrefix + "@href");
- assertTrue(location.contains("http://"), "Href has to contain http://");
- }
-
- @Test
- public void testLinkRFForum() {
- xpathPrefix = "//fieldset[1]/div/form/table/tbody/tr/td[2]/div/div[2]/div/div/div[2]/span[2]/a";
-
- String location = selenium.getAttribute(xpathPrefix + "@href");
- assertTrue(location.contains("http://"), "Href has to contain http://");
- }
-
- @Test
- public void testListShuttleSource() {
- abstractTestSource(1, 1, "<", "ui:composition");
- }
-
- /**
- * Loads the needed page.
- */
- @BeforeMethod
- private void loadPage() {
- super
- .loadPage(
- "richMenu",
- 2,
- "RichFaces Drop Down menu is a component that allows to organize the hierarchical menu");
- }
+ /**
+ * Loads the page containing needed component.
+ */
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Drop Down Menu");
+ scrollIntoView(LOC_FIRST_EXAMPLE_HEADER, true);
+ }
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/editor/AdvancedEditorTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/editor/AdvancedEditorTestCase.java 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/editor/AdvancedEditorTestCase.java 2009-09-09 13:44:10 UTC (rev 15505)
@@ -1,22 +1,19 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces
- *
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This code is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this code; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
*/
package org.jboss.richfaces.integrationTest.editor;
@@ -73,7 +70,7 @@
private final String LOC_TEXT_AREA = getLoc("TEXT_AREA");
private final String LOC_IFRAME = getLoc("IFRAME");
private final String LOC_ADV_DIALOG_IFRAME = getLoc("ADV_DIALOG_IFRAME");
-
+
private final String LOC_TEXT_AREA_P = getLoc("TEXT_AREA_P");
private final String LOC_TEXT_AREA_P_A = getLoc("TEXT_AREA_P_A");
private final String LOC_TEXT_AREA_P_IMG = getLoc("TEXT_AREA_P_IMG");
@@ -411,20 +408,20 @@
}
selenium.click(LOC_ADV_ALIGN_LEFT_BUTTON);
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@style");
- assertEquals(attr, "text-align: left;", String.format(MSG_PARAGRAPH_ALIGNED_TO_THE_SIDE_S, "left"));
+ attr = getStyle(LOC_TEXT_AREA_P, "text-align");
+ assertEquals(attr, "left", format(MSG_PARAGRAPH_ALIGNED_TO_THE_SIDE_S, "left"));
selenium.click(LOC_ADV_ALIGN_RIGHT_BUTTON);
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@style");
- assertEquals(attr, "text-align: right;", String.format(MSG_PARAGRAPH_ALIGNED_TO_THE_SIDE_S, "right"));
+ attr = getStyle(LOC_TEXT_AREA_P, "text-align");
+ assertEquals(attr, "right", format(MSG_PARAGRAPH_ALIGNED_TO_THE_SIDE_S, "right"));
selenium.click(LOC_ADV_ALIGN_CENTER_BUTTON);
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@style");
- assertEquals(attr, "text-align: center;", String.format(MSG_PARAGRAPH_ALIGNED_TO_THE_SIDE_S, "center"));
+ attr = getStyle(LOC_TEXT_AREA_P, "text-align");
+ assertEquals(attr, "center", format(MSG_PARAGRAPH_ALIGNED_TO_THE_SIDE_S, "center"));
selenium.click(LOC_ADV_ALIGN_FULL_BUTTON);
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@style");
- assertEquals(attr, "text-align: justify;", MSG_PARAGRAPH_JUSTIFIED);
+ attr = getStyle(LOC_TEXT_AREA_P, "text-align");
+ assertEquals(attr, "justify", MSG_PARAGRAPH_JUSTIFIED);
}
/**
@@ -435,43 +432,37 @@
public void testStyles() {
selenium.typeKeys(LOC_TEXT_AREA, "aaa bbb ccc ddd eee fff ggg");
- String attr = null;
try {
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@class");
+ selenium.getAttribute(LOC_TEXT_AREA_P + "@class");
fail(MSG_PARAGRAPH_SHOULD_HAVE_NO_STYLE);
} catch (Exception e) {
// OK - there is no attribute
}
selenium.click(LOC_ADV_STYLE_SELECT_BUTTON);
- selenium.click(String.format(LOC_ADV_STYLE_N, 2));
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@class");
- assertEquals(attr, "bold-larger", MSG_PARAGRAPHS_CLASS_ATTRIBUTE);
+ selenium.click(format(LOC_ADV_STYLE_N, 2));
+ assertTrue(belongsClass("bold-larger", LOC_TEXT_AREA_P), MSG_PARAGRAPHS_CLASS_ATTRIBUTE);
selenium.click(LOC_ADV_STYLE_SELECT_BUTTON);
- selenium.click(String.format(LOC_ADV_STYLE_N, 3));
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@class");
- assertEquals(attr, "bold-smaller", MSG_PARAGRAPHS_CLASS_ATTRIBUTE);
+ selenium.click(format(LOC_ADV_STYLE_N, 3));
+ assertTrue(belongsClass("bold-smaller", LOC_TEXT_AREA_P), MSG_PARAGRAPHS_CLASS_ATTRIBUTE);
selenium.click(LOC_ADV_STYLE_SELECT_BUTTON);
- selenium.click(String.format(LOC_ADV_STYLE_N, 4));
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@class");
- assertEquals(attr, "red-bold", MSG_PARAGRAPHS_CLASS_ATTRIBUTE);
+ selenium.click(format(LOC_ADV_STYLE_N, 4));
+ assertTrue(belongsClass("red-bold", LOC_TEXT_AREA_P), MSG_PARAGRAPHS_CLASS_ATTRIBUTE);
selenium.click(LOC_ADV_STYLE_SELECT_BUTTON);
- selenium.click(String.format(LOC_ADV_STYLE_N, 5));
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@class");
- assertEquals(attr, "red-bold-larger", MSG_PARAGRAPHS_CLASS_ATTRIBUTE);
+ selenium.click(format(LOC_ADV_STYLE_N, 5));
+ assertTrue(belongsClass("red-bold-larger", LOC_TEXT_AREA_P), MSG_PARAGRAPHS_CLASS_ATTRIBUTE);
selenium.click(LOC_ADV_STYLE_SELECT_BUTTON);
- selenium.click(String.format(LOC_ADV_STYLE_N, 6));
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@class");
- assertEquals(attr, "red-bold-smaller", MSG_PARAGRAPHS_CLASS_ATTRIBUTE);
+ selenium.click(format(LOC_ADV_STYLE_N, 6));
+ assertTrue(belongsClass("red-bold-smaller", LOC_TEXT_AREA_P), MSG_PARAGRAPHS_CLASS_ATTRIBUTE);
selenium.click(LOC_ADV_STYLE_SELECT_BUTTON);
- selenium.click(String.format(LOC_ADV_STYLE_N, 1));
+ selenium.click(format(LOC_ADV_STYLE_N, 1));
try {
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@class");
+ selenium.getAttribute(LOC_TEXT_AREA_P + "@class");
fail(MSG_PARAGRAPH_SHOULD_HAVE_NO_STYLE);
} catch (Exception e) {
// OK - there is no attribute
@@ -489,60 +480,60 @@
// initial state
selenium.selectFrame(LOC_IFRAME);
int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
- assertEquals(count, 1, String.format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "p"));
+ assertEquals(count, 1, format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "p"));
String text = selenium.getText(LOC_TEXT_AREA_P);
- assertEquals(text, "aaa bbb ccc ddd eee fff ggg", String.format(MSG_CONTENT_OF_TAG_S, "p"));
+ assertEquals(text, "aaa bbb ccc ddd eee fff ggg", format(MSG_CONTENT_OF_TAG_S, "p"));
selenium.selectFrame("relative=top");
// address
selenium.click(LOC_ADV_FORMAT_SELECT_BUTTON);
- selenium.click(String.format(LOC_ADV_FORMAT_N, 3));
+ selenium.click(format(LOC_ADV_FORMAT_N, 3));
selenium.selectFrame(LOC_IFRAME);
count = selenium.getXpathCount(LOC_TEXT_AREA_ADDRESS).intValue();
- assertEquals(count, 1, String.format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "address"));
+ assertEquals(count, 1, format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "address"));
text = selenium.getText(LOC_TEXT_AREA_ADDRESS);
- assertEquals(text, "aaa bbb ccc ddd eee fff ggg", String.format(MSG_CONTENT_OF_TAG_S, "address"));
+ assertEquals(text, "aaa bbb ccc ddd eee fff ggg", format(MSG_CONTENT_OF_TAG_S, "address"));
selenium.selectFrame("relative=top");
// paragraph
selenium.click(LOC_ADV_FORMAT_SELECT_BUTTON);
- selenium.click(String.format(LOC_ADV_FORMAT_N, 2));
+ selenium.click(format(LOC_ADV_FORMAT_N, 2));
selenium.selectFrame(LOC_IFRAME);
count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
- assertEquals(count, 1, String.format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "p"));
+ assertEquals(count, 1, format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "p"));
text = selenium.getText(LOC_TEXT_AREA_P);
- assertEquals(text, "aaa bbb ccc ddd eee fff ggg", String.format(MSG_CONTENT_OF_TAG_S, "p"));
+ assertEquals(text, "aaa bbb ccc ddd eee fff ggg", format(MSG_CONTENT_OF_TAG_S, "p"));
selenium.selectFrame("relative=top");
// preformatted
selenium.click(LOC_ADV_FORMAT_SELECT_BUTTON);
- selenium.click(String.format(LOC_ADV_FORMAT_N, 4));
+ selenium.click(format(LOC_ADV_FORMAT_N, 4));
selenium.selectFrame(LOC_IFRAME);
count = selenium.getXpathCount(LOC_TEXT_AREA_PRE).intValue();
- assertEquals(count, 1, String.format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "pre"));
+ assertEquals(count, 1, format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "pre"));
text = selenium.getText(LOC_TEXT_AREA_PRE);
- assertEquals(text, "aaa bbb ccc ddd eee fff ggg", String.format(MSG_CONTENT_OF_TAG_S, "pre"));
+ assertEquals(text, "aaa bbb ccc ddd eee fff ggg", format(MSG_CONTENT_OF_TAG_S, "pre"));
selenium.selectFrame("relative=top");
// change back to the initial state by clicking on "Format"
selenium.click(LOC_ADV_FORMAT_SELECT_BUTTON);
- selenium.click(String.format(LOC_ADV_FORMAT_N, 1));
+ selenium.click(format(LOC_ADV_FORMAT_N, 1));
selenium.selectFrame(LOC_IFRAME);
count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
- assertEquals(count, 1, String.format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "p"));
+ assertEquals(count, 1, format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "p"));
text = selenium.getText(LOC_TEXT_AREA_P);
- assertEquals(text, "aaa bbb ccc ddd eee fff ggg", String.format(MSG_CONTENT_OF_TAG_S, "p"));
+ assertEquals(text, "aaa bbb ccc ddd eee fff ggg", format(MSG_CONTENT_OF_TAG_S, "p"));
selenium.selectFrame("relative=top");
// heading 1-6
for (int i = 1; i < 7; i++) {
selenium.click(LOC_ADV_FORMAT_SELECT_BUTTON);
- selenium.click(String.format(LOC_ADV_FORMAT_N, 4 + i));
+ selenium.click(format(LOC_ADV_FORMAT_N, 4 + i));
selenium.selectFrame(LOC_IFRAME);
- count = selenium.getXpathCount(String.format(LOC_TEXT_AREA_HN, i)).intValue();
- assertEquals(count, 1, String.format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "h" + i));
- text = selenium.getText(String.format(LOC_TEXT_AREA_HN, i));
- assertEquals(text, "aaa bbb ccc ddd eee fff ggg", String.format(MSG_CONTENT_OF_TAG_S, "h" + i));
+ count = selenium.getXpathCount(format(LOC_TEXT_AREA_HN, i)).intValue();
+ assertEquals(count, 1, format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "h" + i));
+ text = selenium.getText(format(LOC_TEXT_AREA_HN, i));
+ assertEquals(text, "aaa bbb ccc ddd eee fff ggg", format(MSG_CONTENT_OF_TAG_S, "h" + i));
selenium.selectFrame("relative=top");
}
}
@@ -558,21 +549,18 @@
selenium.typeKeys(LOC_TEXT_AREA, "aaa bbb ccc ddd eee fff ggg");
selenium.click(LOC_ADV_INDENT_BUTTON);
- String attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@style");
- assertEquals(attr, "padding-left: 30px;", String.format(MSG_PARAGRAPH_INDENTED_BY_N_PX, 30));
+ assertEquals(getStyle(LOC_TEXT_AREA_P, "padding-left"), "30px", format(MSG_PARAGRAPH_INDENTED_BY_N_PX, 30));
selenium.click(LOC_ADV_INDENT_BUTTON);
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@style");
- assertEquals(attr, "padding-left: 60px;", String.format(MSG_PARAGRAPH_INDENTED_BY_N_PX, 60));
+ assertEquals(getStyle(LOC_TEXT_AREA_P, "padding-left"), "60px", format(MSG_PARAGRAPH_INDENTED_BY_N_PX, 60));
selenium.click(LOC_ADV_OUTDENT_BUTTON);
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@style");
- assertEquals(attr, "padding-left: 30px;", String.format(MSG_PARAGRAPH_INDENTED_BY_N_PX, 30));
+ assertEquals(getStyle(LOC_TEXT_AREA_P, "padding-left"), "30px", format(MSG_PARAGRAPH_INDENTED_BY_N_PX, 30));
selenium.click(LOC_ADV_OUTDENT_BUTTON);
try {
- attr = selenium.getAttribute(LOC_TEXT_AREA_P + "@style");
- fail(String.format(MSG_PARAGRAPH_INDENTED_BY_N_PX, 0));
+ selenium.getAttribute(LOC_TEXT_AREA_P + "@style");
+ fail(format(MSG_PARAGRAPH_INDENTED_BY_N_PX, 0));
} catch (Exception e) {
// OK - no attribute
}
@@ -589,7 +577,7 @@
selenium.click(LOC_ADV_HORIZONTAL_RULER_BUTTON);
selenium.selectFrame(LOC_IFRAME);
-
+
Wait.failWith(MSG_NUMBER_OF_RULERS).interval(3000).until(new Condition() {
public boolean isTrue() {
return selenium.getXpathCount(LOC_TEXT_AREA_P_HR).intValue() == 3;
@@ -614,9 +602,9 @@
selenium.selectFrame(LOC_IFRAME);
int count = selenium.getXpathCount(LOC_TEXT_AREA_P2_B).intValue();
- assertEquals(count, 1, String.format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "b"));
+ assertEquals(count, 1, format(MSG_TAG_S_SHOULD_BE_IN_EDITOR, "b"));
String text = selenium.getText(LOC_TEXT_AREA_P2_B);
- assertEquals(text, "bbb", String.format(MSG_CONTENT_OF_TAG_S, "b"));
+ assertEquals(text, "bbb", format(MSG_CONTENT_OF_TAG_S, "b"));
// press Ctrl+A to select content of the editor
selenium.controlKeyDown();
@@ -627,9 +615,9 @@
selenium.click(LOC_ADV_REMOVE_FORMATTING_BUTTON);
count = selenium.getXpathCount(LOC_TEXT_AREA_P2_B).intValue();
- assertEquals(count, 0, String.format(MSG_TAG_S_SHOULD_NOT_BE_IN_EDITOR, "b"));
+ assertEquals(count, 0, format(MSG_TAG_S_SHOULD_NOT_BE_IN_EDITOR, "b"));
text = selenium.getText(LOC_TEXT_AREA_P2);
- assertEquals(text, "bbb", String.format(MSG_CONTENT_OF_TAG_S, "b"));
+ assertEquals(text, "bbb", format(MSG_CONTENT_OF_TAG_S, "b"));
}
/**
@@ -701,13 +689,13 @@
String text = selenium.getText(LOC_TEXT_AREA_P_A);
assertEquals(text, "aaa", MSG_LABEL_OF_LINK);
text = selenium.getAttribute(LOC_TEXT_AREA_P_A + "@class");
- assertEquals(text, "red-bold", String.format(MSG_LINK_ATTRIBUTE_S, "class"));
+ assertEquals(text, "red-bold", format(MSG_LINK_ATTRIBUTE_S, "class"));
text = selenium.getAttribute(LOC_TEXT_AREA_P_A + "@href");
- assertEquals(text, "http://www.redhat.com", String.format(MSG_LINK_ATTRIBUTE_S, "href"));
+ assertEquals(text, "http://www.redhat.com", format(MSG_LINK_ATTRIBUTE_S, "href"));
text = selenium.getAttribute(LOC_TEXT_AREA_P_A + "@title");
- assertEquals(text, "title title", String.format(MSG_LINK_ATTRIBUTE_S, "title"));
+ assertEquals(text, "title title", format(MSG_LINK_ATTRIBUTE_S, "title"));
text = selenium.getAttribute(LOC_TEXT_AREA_P_A + "@target");
- assertEquals(text, "_blank", String.format(MSG_LINK_ATTRIBUTE_S, "target"));
+ assertEquals(text, "_blank", format(MSG_LINK_ATTRIBUTE_S, "target"));
selenium.selectFrame("relative=top");
@@ -726,7 +714,7 @@
selenium.selectFrame(LOC_IFRAME);
text = selenium.getText(LOC_TEXT_AREA_P_SPAN);
- assertEquals(text, "aaa", String.format(MSG_CONTENT_OF_TAG_S, "span"));
+ assertEquals(text, "aaa", format(MSG_CONTENT_OF_TAG_S, "span"));
text = selenium.getAttribute(LOC_TEXT_AREA_P_SPAN + "@class");
assertEquals(text, "red-bold", MSG_CLASS_ATTRIBUTE);
@@ -747,19 +735,19 @@
selenium.click(LOC_ADV_ANCHOR_DLG_INSERT_BUTTON);
String attr = selenium.getAttribute(LOC_TEXT_AREA_P_A + "@name");
- assertEquals(attr, "aaa", String.format(MSG_LINK_ATTRIBUTE_S, "name"));
+ assertEquals(attr, "aaa", format(MSG_LINK_ATTRIBUTE_S, "name"));
attr = selenium.getAttribute(LOC_TEXT_AREA_P_A + "@class");
- assertEquals(attr, "mceItemAnchor", String.format(MSG_LINK_ATTRIBUTE_S, "class"));
+ assertEquals(attr, "mceItemAnchor", format(MSG_LINK_ATTRIBUTE_S, "class"));
selenium.click(LOC_ADV_TOGGLE_INVISIBLE_BUTTON);
attr = selenium.getAttribute(LOC_TEXT_AREA_P_A + "@name");
- assertEquals(attr, "aaa", String.format(MSG_LINK_ATTRIBUTE_S, "name"));
+ assertEquals(attr, "aaa", format(MSG_LINK_ATTRIBUTE_S, "name"));
try {
attr = selenium.getAttribute(LOC_TEXT_AREA_P_A + "@class");
- fail(String.format(MSG_LINK_ATTRIBUTE_S, "class"));
+ fail(format(MSG_LINK_ATTRIBUTE_S, "class"));
} catch (Exception e) {
// OK -- there is no class attribute
}
@@ -793,21 +781,21 @@
waitForElement(LOC_TEXT_AREA_P_IMG);
String attr = selenium.getAttribute(LOC_TEXT_AREA_P_IMG + "@src");
- assertEquals(attr, "../images/cn_Editor.gif", String.format(MSG_IMG_ATTRIBUTE_S, "src"));
+ assertEquals(attr, "../images/cn_Editor.gif", format(MSG_IMG_ATTRIBUTE_S, "src"));
attr = selenium.getAttribute(LOC_TEXT_AREA_P_IMG + "@alt");
- assertEquals(attr, "Editor", String.format(MSG_IMG_ATTRIBUTE_S, "alt"));
+ assertEquals(attr, "Editor", format(MSG_IMG_ATTRIBUTE_S, "alt"));
attr = selenium.getAttribute(LOC_TEXT_AREA_P_IMG + "@style");
- assertTrue(attr.contains("float: right;"), String.format(MSG_IMG_ATTRIBUTE_S, "style"));
- assertTrue(attr.contains("border: 3px solid black;"), String.format(MSG_IMG_ATTRIBUTE_S, "style"));
- assertTrue(attr.contains("margin: 10px 8px"), String.format(MSG_IMG_ATTRIBUTE_S, "style"));
+ assertTrue(attr.contains("float: right;"), format(MSG_IMG_ATTRIBUTE_S, "style"));
+ assertTrue(attr.contains("border: 3px solid black;"), format(MSG_IMG_ATTRIBUTE_S, "style"));
+ assertTrue(attr.contains("margin: 10px 8px"), format(MSG_IMG_ATTRIBUTE_S, "style"));
attr = selenium.getAttribute(LOC_TEXT_AREA_P_IMG + "@width");
- assertEquals(attr, "192", String.format(MSG_IMG_ATTRIBUTE_S, "width"));
+ assertEquals(attr, "192", format(MSG_IMG_ATTRIBUTE_S, "width"));
attr = selenium.getAttribute(LOC_TEXT_AREA_P_IMG + "@height");
- assertEquals(attr, "62", String.format(MSG_IMG_ATTRIBUTE_S, "height"));
+ assertEquals(attr, "62", format(MSG_IMG_ATTRIBUTE_S, "height"));
selenium.selectFrame("relative=top");
}
@@ -821,23 +809,23 @@
selenium.click(LOC_ADV_CUSTOM_CHAR_BUTTON);
waitForElement(LOC_ADV_DIALOG_IFRAME);
selenium.selectFrame(LOC_ADV_DIALOG_IFRAME);
- waitForElement(String.format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 1, 5));
+ waitForElement(format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 1, 5));
// euro sign
- selenium.click(String.format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 1, 5));
+ selenium.click(format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 1, 5));
selenium.click(LOC_ADV_CUSTOM_CHAR_BUTTON);
waitForElement(LOC_ADV_DIALOG_IFRAME);
selenium.selectFrame(LOC_ADV_DIALOG_IFRAME);
- waitForElement(String.format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 9, 5));
+ waitForElement(format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 9, 5));
// Omega
- selenium.click(String.format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 9, 5));
+ selenium.click(format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 9, 5));
selenium.click(LOC_ADV_CUSTOM_CHAR_BUTTON);
waitForElement(LOC_ADV_DIALOG_IFRAME);
selenium.selectFrame(LOC_ADV_DIALOG_IFRAME);
- waitForElement(String.format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 10, 18));
+ waitForElement(format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 10, 18));
// heart suite
- selenium.click(String.format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 10, 18));
+ selenium.click(format(LOC_ADV_CUSTOM_CHAR_DLG_M_N, 10, 18));
String text = selenium.getText(LOC_TEXT_AREA_P);
assertEquals(text, "€Ω♥", MSG_CONTENT_OF_THE_EDITOR);
@@ -846,10 +834,11 @@
/**
* Loads the page containing the calendar component.
*/
+ @SuppressWarnings("unused")
@BeforeMethod
private void loadPage() {
openComponent("Editor");
-
+
// wait for iframe to load
selenium.click(LOC_ADVANCED_BUTTON);
Wait.until(new Condition() {
@@ -857,7 +846,7 @@
return selenium.isElementPresent(LOC_ADV_ANCHOR_BUTTON);
}
});
-
+
scrollIntoView(LOC_EXAMPLE_HEADER, true);
}
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/editor/SimpleEditorTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/editor/SimpleEditorTestCase.java 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/editor/SimpleEditorTestCase.java 2009-09-09 13:44:10 UTC (rev 15505)
@@ -1,3 +1,21 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
package org.jboss.richfaces.integrationTest.editor;
import static org.testng.Assert.assertEquals;
@@ -9,312 +27,329 @@
/**
* Test case that tests the editor component.
- * <ul>
- * <li><b>TODO</b> implement the test for cleaning up</li>
- * </ul>
*
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
+// TODO implement a test for cleaning up
public class SimpleEditorTestCase extends AbstractSeleniumRichfacesTestCase {
- // messages
- private final String MSG_COMPONENT_DESCRIPTION = getMess("COMPONENT_DESCRIPTION");
- private final String MSG_STRINGS_SHOULD_BE_BOLD = getMess("STRINGS_SHOULD_BE_BOLD");
- private final String MSG_STRINGS_SHOULD_BE_ITALIC = getMess("STRINGS_SHOULD_BE_ITALIC");
- private final String MSG_STRINGS_SHOULD_BE_UNDERLINED = getMess("STRINGS_SHOULD_BE_UNDERLINED");
- private final String MSG_STRINGS_SHOULD_HAVE_A_LINE_THROUGH = getMess("STRINGS_SHOULD_HAVE_A_LINE_THROUGH");
- private final String MSG_CONTENT_OF_THE_EDITOR = getMess("CONTENT_OF_THE_EDITOR");
- private final String MSG_EDITOR_SHOULD_CONTAIN_OL = getMess("EDITOR_SHOULD_CONTAIN_OL");
- private final String MSG_EDITOR_SHOULD_CONTAIN_UL = getMess("EDITOR_SHOULD_CONTAIN_UL");
- private final String MSG_TWO_LINES_SHOULD_CONTAIN_A_PARAGRAPH = getMess("TWO_LINES_SHOULD_CONTAIN_A_PARAGRAPH");
- private final String MSG_TWO_LINES_IN_THE_EDITOR = getMess("TWO_LINES_IN_THE_EDITOR");
- private final String MSG_LIST_SHOULD_CONTAIN_THREE_ITEMS = getMess("LIST_SHOULD_CONTAIN_THREE_ITEMS");
+ // messages
+ private final String MSG_STRINGS_SHOULD_BE_BOLD = getMsg("STRINGS_SHOULD_BE_BOLD");
+ private final String MSG_STRINGS_SHOULD_BE_ITALIC = getMsg("STRINGS_SHOULD_BE_ITALIC");
+ private final String MSG_STRINGS_SHOULD_BE_UNDERLINED = getMsg("STRINGS_SHOULD_BE_UNDERLINED");
+ private final String MSG_STRINGS_SHOULD_HAVE_A_LINE_THROUGH = getMsg("STRINGS_SHOULD_HAVE_A_LINE_THROUGH");
+ private final String MSG_CONTENT_OF_THE_EDITOR = getMsg("CONTENT_OF_THE_EDITOR");
+ private final String MSG_EDITOR_SHOULD_CONTAIN_OL = getMsg("EDITOR_SHOULD_CONTAIN_OL");
+ private final String MSG_EDITOR_SHOULD_CONTAIN_UL = getMsg("EDITOR_SHOULD_CONTAIN_UL");
+ private final String MSG_TWO_LINES_SHOULD_CONTAIN_A_PARAGRAPH = getMsg("TWO_LINES_SHOULD_CONTAIN_A_PARAGRAPH");
+ private final String MSG_TWO_LINES_IN_THE_EDITOR = getMsg("TWO_LINES_IN_THE_EDITOR");
+ private final String MSG_LIST_SHOULD_CONTAIN_THREE_ITEMS = getMsg("LIST_SHOULD_CONTAIN_THREE_ITEMS");
- // editor
- private final String LOC_TEXT_AREA = getLoc("TEXT_AREA");
- private final String LOC_IFRAME = getLoc("IFRAME");
- private final String LOC_TEXT_AREA_P = getLoc("TEXT_AREA_P");
- private final String LOC_TEXT_AREA_P2_B = getLoc("TEXT_AREA_P2_B");
- private final String LOC_TEXT_AREA_P2_I = getLoc("TEXT_AREA_P2_I");
- private final String LOC_TEXT_AREA_P2_U = getLoc("TEXT_AREA_P2_U");
- private final String LOC_TEXT_AREA_P2_STRIKE = getLoc("TEXT_AREA_P2_STRIKE");
- private final String LOC_TEXT_AREA_OL = getLoc("TEXT_AREA_OL");
- private final String LOC_TEXT_AREA_OL_LI = getLoc("TEXT_AREA_OL_LI");
- private final String LOC_TEXT_AREA_UL = getLoc("TEXT_AREA_UL");
- private final String LOC_TEXT_AREA_UL_LI = getLoc("TEXT_AREA_UL_LI");
+ // editor
+ private final String LOC_EXAMPLE_HEADER = getLoc("EXAMPLE_HEADER");
+ private final String LOC_TEXT_AREA = getLoc("TEXT_AREA");
+ private final String LOC_IFRAME = getLoc("IFRAME");
+ private final String LOC_TEXT_AREA_P = getLoc("TEXT_AREA_P");
+ private final String LOC_TEXT_AREA_P2_B = getLoc("TEXT_AREA_P2_B");
+ private final String LOC_TEXT_AREA_P2_I = getLoc("TEXT_AREA_P2_I");
+ private final String LOC_TEXT_AREA_P2_U = getLoc("TEXT_AREA_P2_U");
+ private final String LOC_TEXT_AREA_P2_STRIKE = getLoc("TEXT_AREA_P2_STRIKE");
+ private final String LOC_TEXT_AREA_OL = getLoc("TEXT_AREA_OL");
+ private final String LOC_TEXT_AREA_OL_LI = getLoc("TEXT_AREA_OL_LI");
+ private final String LOC_TEXT_AREA_UL = getLoc("TEXT_AREA_UL");
+ private final String LOC_TEXT_AREA_UL_LI = getLoc("TEXT_AREA_UL_LI");
- // buttons in simple mode
- private final String LOC_BOLD_BUTTON = getLoc("BOLD_BUTTON");
- private final String LOC_ITALIC_BUTTON = getLoc("ITALIC_BUTTON");
- private final String LOC_UNDERLINE_BUTTON = getLoc("UNDERLINE_BUTTON");
- private final String LOC_STRIKETHROUGH_BUTTON = getLoc("STRIKETHROUGH_BUTTON");
- private final String LOC_UNDO_BUTTON = getLoc("UNDO_BUTTON");
- private final String LOC_REDO_BUTTON = getLoc("REDO_BUTTON");
- private final String LOC_UNORDERED_LIST_BUTTON = getLoc("UNORDERED_LIST_BUTTON");
- private final String LOC_ORDERED_LIST_BUTTON = getLoc("ORDERED_LIST_BUTTON");
+ // buttons in simple mode
+ private final String LOC_BOLD_BUTTON = getLoc("BOLD_BUTTON");
+ private final String LOC_ITALIC_BUTTON = getLoc("ITALIC_BUTTON");
+ private final String LOC_UNDERLINE_BUTTON = getLoc("UNDERLINE_BUTTON");
+ private final String LOC_STRIKETHROUGH_BUTTON = getLoc("STRIKETHROUGH_BUTTON");
+ private final String LOC_UNDO_BUTTON = getLoc("UNDO_BUTTON");
+ private final String LOC_REDO_BUTTON = getLoc("REDO_BUTTON");
+ private final String LOC_UNORDERED_LIST_BUTTON = getLoc("UNORDERED_LIST_BUTTON");
+ private final String LOC_ORDERED_LIST_BUTTON = getLoc("ORDERED_LIST_BUTTON");
- /**
- * Tests the bold button. It types "aaaa", presses enter followed by the
- * bold button, and types "bbbb ". Then again bold button, "cccc ", bold
- * button and "dddd ". Then it checks that the editor's text area contains
- * the entered text. After that, it checks that there are two lines of text
- * in the editor and that the second line contains two bold strings.
- */
- @Test
- public void testBoldButton() {
- selenium.typeKeys(LOC_TEXT_AREA, "aaaa"); // normal text
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ /**
+ * Tests the bold button. It types "aaaa", presses enter followed by the
+ * bold button, and types "bbbb ". Then again bold button, "cccc ", bold
+ * button and "dddd ". Then it checks that the editor's text area contains
+ * the entered text. After that, it checks that there are two lines of text
+ * in the editor and that the second line contains two bold strings.
+ */
+ @Test
+ public void testBoldButton() {
+ selenium.typeKeys(LOC_TEXT_AREA, "aaaa"); // normal text
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- selenium.click(LOC_BOLD_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "bbbb "); // bold text
- selenium.click(LOC_BOLD_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "cccc "); // normal text
- selenium.click(LOC_BOLD_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "dddd "); // bold text
+ selenium.click(LOC_BOLD_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "bbbb "); // bold text
+ selenium.click(LOC_BOLD_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "cccc "); // normal text
+ selenium.click(LOC_BOLD_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "dddd "); // bold text
- String text = selenium.getText(LOC_TEXT_AREA);
- assertEquals(text, "aaaa\nbbbb cccc dddd", MSG_CONTENT_OF_THE_EDITOR);
+ String text = selenium.getText(LOC_TEXT_AREA);
+ assertEquals(text, "aaaa\nbbbb cccc dddd", MSG_CONTENT_OF_THE_EDITOR);
- // select the iframe for Selenium to be able to get iframe's content
- selenium.selectFrame(LOC_IFRAME);
+ // select the iframe for Selenium to be able to get iframe's content
+ selenium.selectFrame(LOC_IFRAME);
- int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
- assertEquals(count, 2, MSG_TWO_LINES_IN_THE_EDITOR);
+ int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
+ assertEquals(count, 2, MSG_TWO_LINES_IN_THE_EDITOR);
- count = selenium.getXpathCount(LOC_TEXT_AREA_P2_B).intValue();
- assertEquals(count, 2, MSG_STRINGS_SHOULD_BE_BOLD);
-
- selenium.selectFrame("relative=top");
- }
+ count = selenium.getXpathCount(LOC_TEXT_AREA_P2_B).intValue();
+ assertEquals(count, 2, MSG_STRINGS_SHOULD_BE_BOLD);
- /**
- * Tests the italic button. It types "aaaa", presses enter followed by the
- * italic button, and types "bbbb ". Then again italic button, "cccc ",
- * italic button and "dddd ". Then it checks that the editor's text area
- * contains the entered text. After that, it checks that there are two lines
- * of text in the editor and that the second line contains two italic
- * strings.
- */
- @Test
- public void testItalicButton() {
- selenium.typeKeys(LOC_TEXT_AREA, "aaaa"); // normal text
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ selenium.selectFrame("relative=top");
+ }
- selenium.click(LOC_ITALIC_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "bbbb "); // italic text
- selenium.click(LOC_ITALIC_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "cccc "); // normal text
- selenium.click(LOC_ITALIC_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "dddd "); // italic text
+ /**
+ * Tests the italic button. It types "aaaa", presses enter followed by the
+ * italic button, and types "bbbb ". Then again italic button, "cccc ",
+ * italic button and "dddd ". Then it checks that the editor's text area
+ * contains the entered text. After that, it checks that there are two lines
+ * of text in the editor and that the second line contains two italic
+ * strings.
+ */
+ @Test
+ public void testItalicButton() {
+ selenium.typeKeys(LOC_TEXT_AREA, "aaaa"); // normal text
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- String text = selenium.getText(LOC_TEXT_AREA);
- assertEquals(text, "aaaa\nbbbb cccc dddd", MSG_CONTENT_OF_THE_EDITOR);
+ selenium.click(LOC_ITALIC_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "bbbb "); // italic text
+ selenium.click(LOC_ITALIC_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "cccc "); // normal text
+ selenium.click(LOC_ITALIC_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "dddd "); // italic text
- // select the iframe for Selenium to be able to get iframe's content
- selenium.selectFrame(LOC_IFRAME);
+ String text = selenium.getText(LOC_TEXT_AREA);
+ assertEquals(text, "aaaa\nbbbb cccc dddd", MSG_CONTENT_OF_THE_EDITOR);
- int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
- assertEquals(count, 2, MSG_TWO_LINES_IN_THE_EDITOR);
+ // select the iframe for Selenium to be able to get iframe's content
+ selenium.selectFrame(LOC_IFRAME);
- count = selenium.getXpathCount(LOC_TEXT_AREA_P2_I).intValue();
- assertEquals(count, 2, MSG_STRINGS_SHOULD_BE_ITALIC);
-
- selenium.selectFrame("relative=top");
- }
+ int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
+ assertEquals(count, 2, MSG_TWO_LINES_IN_THE_EDITOR);
- /**
- * Tests the underline button. It types "aaaa", presses enter followed by
- * the underline button, and types "bbbb ". Then again underline button,
- * "cccc ", underline button and "dddd ". Then it checks that the editor's
- * text area contains the entered text. After that, it checks that there are
- * two lines of text in the editor and that the second line contains two
- * underlined strings.
- */
- @Test
- public void testUnderlineButton() {
- selenium.typeKeys(LOC_TEXT_AREA, "aaaa"); // normal text
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ count = selenium.getXpathCount(LOC_TEXT_AREA_P2_I).intValue();
+ assertEquals(count, 2, MSG_STRINGS_SHOULD_BE_ITALIC);
- selenium.click(LOC_UNDERLINE_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "bbbb "); // underlined text
- selenium.click(LOC_UNDERLINE_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "cccc "); // normal text
- selenium.click(LOC_UNDERLINE_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "dddd "); // underlined text
+ selenium.selectFrame("relative=top");
+ }
- String text = selenium.getText(LOC_TEXT_AREA);
- assertEquals(text, "aaaa\nbbbb cccc dddd", MSG_CONTENT_OF_THE_EDITOR);
+ /**
+ * Tests the underline button. It types "aaaa", presses enter followed by
+ * the underline button, and types "bbbb ". Then again underline button,
+ * "cccc ", underline button and "dddd ". Then it checks that the editor's
+ * text area contains the entered text. After that, it checks that there are
+ * two lines of text in the editor and that the second line contains two
+ * underlined strings.
+ */
+ @Test
+ public void testUnderlineButton() {
+ selenium.typeKeys(LOC_TEXT_AREA, "aaaa"); // normal text
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- // select the iframe for Selenium to be able to get iframe's content
- selenium.selectFrame(LOC_IFRAME);
+ selenium.click(LOC_UNDERLINE_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "bbbb "); // underlined text
+ selenium.click(LOC_UNDERLINE_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "cccc "); // normal text
+ selenium.click(LOC_UNDERLINE_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "dddd "); // underlined text
- int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
- assertEquals(count, 2, MSG_TWO_LINES_IN_THE_EDITOR);
+ String text = selenium.getText(LOC_TEXT_AREA);
+ assertEquals(text, "aaaa\nbbbb cccc dddd", MSG_CONTENT_OF_THE_EDITOR);
- count = selenium.getXpathCount(LOC_TEXT_AREA_P2_U).intValue();
- assertEquals(count, 2, MSG_STRINGS_SHOULD_BE_UNDERLINED);
-
- selenium.selectFrame("relative=top");
- }
+ // select the iframe for Selenium to be able to get iframe's content
+ selenium.selectFrame(LOC_IFRAME);
- /**
- * Tests the strikethrough button. It types "aaaa", presses enter followed
- * by the strikethrough button, and types "bbbb ". Then again strikethrough
- * button, "cccc ", strikethrough button and "dddd ". Then it checks that
- * the editor's text area contains the entered text. After that, it checks
- * that there are two lines of text in the editor and that the second line
- * contains two strings having a line through.
- */
- @Test
- public void testStrikethroughButton() {
- selenium.typeKeys(LOC_TEXT_AREA, "aaaa"); // normal text
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
+ assertEquals(count, 2, MSG_TWO_LINES_IN_THE_EDITOR);
- selenium.click(LOC_STRIKETHROUGH_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "bbbb "); // text with line through
- selenium.click(LOC_STRIKETHROUGH_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "cccc "); // normal text
- selenium.click(LOC_STRIKETHROUGH_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "dddd "); // text with line through
+ count = selenium.getXpathCount(LOC_TEXT_AREA_P2_U).intValue();
+ assertEquals(count, 2, MSG_STRINGS_SHOULD_BE_UNDERLINED);
- String text = selenium.getText(LOC_TEXT_AREA);
- assertEquals(text, "aaaa\nbbbb cccc dddd", MSG_CONTENT_OF_THE_EDITOR);
+ selenium.selectFrame("relative=top");
+ }
- // select the iframe for Selenium to be able to get iframe's content
- selenium.selectFrame(LOC_IFRAME);
+ /**
+ * Tests the strikethrough button. It types "aaaa", presses enter followed
+ * by the strikethrough button, and types "bbbb ". Then again strikethrough
+ * button, "cccc ", strikethrough button and "dddd ". Then it checks that
+ * the editor's text area contains the entered text. After that, it checks
+ * that there are two lines of text in the editor and that the second line
+ * contains two strings having a line through.
+ */
+ @Test
+ public void testStrikethroughButton() {
+ selenium.typeKeys(LOC_TEXT_AREA, "aaaa"); // normal text
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
- assertEquals(count, 2, MSG_TWO_LINES_IN_THE_EDITOR);
+ selenium.click(LOC_STRIKETHROUGH_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "bbbb "); // text with line through
+ selenium.click(LOC_STRIKETHROUGH_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "cccc "); // normal text
+ selenium.click(LOC_STRIKETHROUGH_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "dddd "); // text with line through
- count = selenium.getXpathCount(LOC_TEXT_AREA_P2_STRIKE).intValue();
- assertEquals(count, 2, MSG_STRINGS_SHOULD_HAVE_A_LINE_THROUGH);
-
- selenium.selectFrame("relative=top");
- }
+ String text = selenium.getText(LOC_TEXT_AREA);
+ assertEquals(text, "aaaa\nbbbb cccc dddd", MSG_CONTENT_OF_THE_EDITOR);
- /**
- * Tests both the undo and redo buttons. It types into text area, checks the
- * content of the editor, reverts changes by clicking on the undo button,
- * and checks the content of the editor again. Then, it clicks on the redo
- * button and checks the text area.
- */
- @Test
- public void testUndoRedo() {
- selenium.typeKeys(LOC_TEXT_AREA, "aaaabbbb");
+ // select the iframe for Selenium to be able to get iframe's content
+ selenium.selectFrame(LOC_IFRAME);
- String text = selenium.getText(LOC_TEXT_AREA);
- assertEquals(text, "aaaabbbb", MSG_CONTENT_OF_THE_EDITOR);
+ int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
+ assertEquals(count, 2, MSG_TWO_LINES_IN_THE_EDITOR);
- selenium.click(LOC_UNDO_BUTTON);
- text = selenium.getText(LOC_TEXT_AREA);
- assertEquals(text, "", MSG_CONTENT_OF_THE_EDITOR);
+ count = selenium.getXpathCount(LOC_TEXT_AREA_P2_STRIKE).intValue();
+ assertEquals(count, 2, MSG_STRINGS_SHOULD_HAVE_A_LINE_THROUGH);
- selenium.click(LOC_REDO_BUTTON);
- text = selenium.getText(LOC_TEXT_AREA);
- assertEquals(text, "aaaabbbb", MSG_CONTENT_OF_THE_EDITOR);
- }
+ selenium.selectFrame("relative=top");
+ }
- /**
- * Tests the unordered list button. It types a normal string, then clicks on
- * the unordered list button, types three strings, clicks on the unordered
- * list button, and types one more string. Then it checks that the text area
- * contains all strings, then checks that there are two paragraphs, presence
- * of unordered list, and the number of list's items.
- */
- @Test
- public void testUnorderedList() {
- selenium.typeKeys(LOC_TEXT_AREA, "aaaa");
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ /**
+ * Tests both the undo and redo buttons. It types into text area, checks the
+ * content of the editor, reverts changes by clicking on the undo button,
+ * and checks the content of the editor again. Then, it clicks on the redo
+ * button and checks the text area.
+ */
+ @Test
+ public void testUndoRedo() {
+ selenium.typeKeys(LOC_TEXT_AREA, "aaaabbbb");
- selenium.click(LOC_UNORDERED_LIST_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "bbbb");
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- selenium.typeKeys(LOC_TEXT_AREA, "cccc");
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- selenium.typeKeys(LOC_TEXT_AREA, "dddd");
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- selenium.click(LOC_UNORDERED_LIST_BUTTON);
+ String text = selenium.getText(LOC_TEXT_AREA);
+ assertEquals(text, "aaaabbbb", MSG_CONTENT_OF_THE_EDITOR);
- selenium.typeKeys(LOC_TEXT_AREA, "eeee");
+ selenium.click(LOC_UNDO_BUTTON);
+ text = selenium.getText(LOC_TEXT_AREA);
+ assertEquals(text, "", MSG_CONTENT_OF_THE_EDITOR);
- // select the iframe for Selenium to be able to get iframe's content
- selenium.selectFrame(LOC_IFRAME);
+ selenium.click(LOC_REDO_BUTTON);
+ text = selenium.getText(LOC_TEXT_AREA);
+ assertEquals(text, "aaaabbbb", MSG_CONTENT_OF_THE_EDITOR);
+ }
- String text = selenium.getText(LOC_TEXT_AREA);
- assertEquals(text, "aaaa\nbbbbccccddddeeee", MSG_CONTENT_OF_THE_EDITOR);
+ /**
+ * Tests the unordered list button. It types a normal string, then clicks on
+ * the unordered list button, types three strings, clicks on the unordered
+ * list button, and types one more string. Then it checks that the text area
+ * contains all strings, then checks that there are two paragraphs, presence
+ * of unordered list, and the number of list's items.
+ */
+ @Test
+ public void testUnorderedList() {
+ selenium.typeKeys(LOC_TEXT_AREA, "aaaa");
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
- assertEquals(count, 2, MSG_TWO_LINES_SHOULD_CONTAIN_A_PARAGRAPH);
+ selenium.click(LOC_UNORDERED_LIST_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "bbbb");
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ selenium.typeKeys(LOC_TEXT_AREA, "cccc");
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ selenium.typeKeys(LOC_TEXT_AREA, "dddd");
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ selenium.click(LOC_UNORDERED_LIST_BUTTON);
- boolean isPresent = selenium.isElementPresent(LOC_TEXT_AREA_UL);
- assertTrue(isPresent, MSG_EDITOR_SHOULD_CONTAIN_UL);
+ selenium.typeKeys(LOC_TEXT_AREA, "eeee");
- count = selenium.getXpathCount(LOC_TEXT_AREA_UL_LI).intValue();
- assertEquals(count, 3, MSG_LIST_SHOULD_CONTAIN_THREE_ITEMS);
-
- selenium.selectFrame("relative=top");
- }
+ // select the iframe for Selenium to be able to get iframe's content
+ selenium.selectFrame(LOC_IFRAME);
- /**
- * Tests the ordered list button. It types a normal string, then clicks on
- * the ordered list button, types three strings, clicks on the ordered list
- * button, and types one more string. Then it checks that the text area
- * contains all strings, then checks that there are two paragraphs, presence
- * of ordered list, and the number of list's items.
- */
- @Test
- public void testOrderedList() {
- selenium.typeKeys(LOC_TEXT_AREA, "aaaa");
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ String text = selenium.getText(LOC_TEXT_AREA);
+ assertEquals(text, "aaaa\nbbbbccccddddeeee", MSG_CONTENT_OF_THE_EDITOR);
- selenium.click(LOC_ORDERED_LIST_BUTTON);
- selenium.typeKeys(LOC_TEXT_AREA, "bbbb");
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- selenium.typeKeys(LOC_TEXT_AREA, "cccc");
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- selenium.typeKeys(LOC_TEXT_AREA, "dddd");
- selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- selenium.click(LOC_ORDERED_LIST_BUTTON);
+ int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
+ assertEquals(count, 2, MSG_TWO_LINES_SHOULD_CONTAIN_A_PARAGRAPH);
- selenium.typeKeys(LOC_TEXT_AREA, "eeee");
+ boolean isPresent = selenium.isElementPresent(LOC_TEXT_AREA_UL);
+ assertTrue(isPresent, MSG_EDITOR_SHOULD_CONTAIN_UL);
- // select the iframe for Selenium to be able to get iframe's content
- selenium.selectFrame(LOC_IFRAME);
+ count = selenium.getXpathCount(LOC_TEXT_AREA_UL_LI).intValue();
+ assertEquals(count, 3, MSG_LIST_SHOULD_CONTAIN_THREE_ITEMS);
- String text = selenium.getText(LOC_TEXT_AREA);
- assertEquals(text, "aaaa\nbbbbccccddddeeee", MSG_CONTENT_OF_THE_EDITOR);
+ selenium.selectFrame("relative=top");
+ }
- int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
- assertEquals(count, 2, MSG_TWO_LINES_SHOULD_CONTAIN_A_PARAGRAPH);
+ /**
+ * Tests the ordered list button. It types a normal string, then clicks on
+ * the ordered list button, types three strings, clicks on the ordered list
+ * button, and types one more string. Then it checks that the text area
+ * contains all strings, then checks that there are two paragraphs, presence
+ * of ordered list, and the number of list's items.
+ */
+ @Test
+ public void testOrderedList() {
+ selenium.typeKeys(LOC_TEXT_AREA, "aaaa");
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
- boolean isPresent = selenium.isElementPresent(LOC_TEXT_AREA_OL);
- assertTrue(isPresent, MSG_EDITOR_SHOULD_CONTAIN_OL);
+ selenium.click(LOC_ORDERED_LIST_BUTTON);
+ selenium.typeKeys(LOC_TEXT_AREA, "bbbb");
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ selenium.typeKeys(LOC_TEXT_AREA, "cccc");
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ selenium.typeKeys(LOC_TEXT_AREA, "dddd");
+ selenium.keyPress(LOC_TEXT_AREA, "13"); // press <Enter>
+ selenium.click(LOC_ORDERED_LIST_BUTTON);
- count = selenium.getXpathCount(LOC_TEXT_AREA_OL_LI).intValue();
- assertEquals(count, 3, MSG_LIST_SHOULD_CONTAIN_THREE_ITEMS);
-
- selenium.selectFrame("relative=top");
- }
+ selenium.typeKeys(LOC_TEXT_AREA, "eeee");
- /**
- * Tests the "View Source". It checks that the source code is not visible,
- * clicks on the link, and checks the first 2 components of source code,
- * i.e. that the source code begins with "<ui:composition".
- */
- @Test
- public void testEditorSource() {
- abstractTestSource(1, 1, "<", "ui:composition");
- }
+ // select the iframe for Selenium to be able to get iframe's content
+ selenium.selectFrame(LOC_IFRAME);
- /**
- * Loads the page containing the calendar component.
- */
- @BeforeMethod
- private void loadPage() {
- super.loadPage("richInputs", 4, MSG_COMPONENT_DESCRIPTION);
- // wait for iframe to load
- waitFor(1000);
- scrollIntoView(LOC_TEXT_AREA, true);
- }
+ String text = selenium.getText(LOC_TEXT_AREA);
+ assertEquals(text, "aaaa\nbbbbccccddddeeee", MSG_CONTENT_OF_THE_EDITOR);
+
+ int count = selenium.getXpathCount(LOC_TEXT_AREA_P).intValue();
+ assertEquals(count, 2, MSG_TWO_LINES_SHOULD_CONTAIN_A_PARAGRAPH);
+
+ boolean isPresent = selenium.isElementPresent(LOC_TEXT_AREA_OL);
+ assertTrue(isPresent, MSG_EDITOR_SHOULD_CONTAIN_OL);
+
+ count = selenium.getXpathCount(LOC_TEXT_AREA_OL_LI).intValue();
+ assertEquals(count, 3, MSG_LIST_SHOULD_CONTAIN_THREE_ITEMS);
+
+ selenium.selectFrame("relative=top");
+ }
+
+ /**
+ * Tests the "View Source". It checks that the source code is not visible,
+ * clicks on the link, and checks 17 lines of source code.
+ */
+ @Test
+ public void testEditorSource() {
+ String[] strings = new String[] {
+ "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<h:form id=\"form\">",
+ "<h:panelGrid columns=\"2\" width=\"100%\" columnClasses=\"column,column\">",
+ "<h:panelGroup style=\"height:320px;width:400px;\" layout=\"block\">",
+ "<rich:editor configuration=\"#{editorBean.currentConfiguration}\"",
+ "id=\"editor\" width=\"400\" height=\"300\" validator=\"#{editorBean.validate}\"",
+ "viewMode=\"#{editorBean.viewMode}\" value=\"#{editorBean.value}\" useSeamText=\"#{editorBean.useSeamText}\">",
+ "<a4j:support event=\"onchange\" reRender=\"result\" ajaxSingle=\"true\"",
+ "requestDelay=\"1000\" ",
+ "onsubmit=\"if (!#{rich:element('form:editorvalue')} && !#{editorBean.useSeamText}) return false;\" />",
+ "<rich:panel id=\"controls\">",
+ "<f:facet name=\"header\">",
+ "<h:panelGrid columns=\"2\">",
+ "<h:selectOneRadio value=\"#{editorBean.currentConfiguration}\"",
+ " <h:selectBooleanCheckbox value=\"#{editorBean.liveUpdatesEnabled}\"",
+ " valueChangeListener=\"#{inputResetBean.processValueChange}\">",
+ "<a4j:support event=\"onclick\" reRender=\"editor,result,controls\" requestDelay=\"500\" ajaxSingle=\"true\"", };
+
+ abstractTestSource(1, "View Source", strings);
+ }
+
+ /**
+ * Loads the page containing needed component.
+ */
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Editor");
+ // wait for iframe to load
+ waitFor(1000);
+ scrollIntoView(LOC_EXAMPLE_HEADER, true);
+ }
}
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-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/fileUpload/FileUploadTestCase.java 2009-09-09 13:44:10 UTC (rev 15505)
@@ -1,22 +1,19 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces
- *
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This code is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this code; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
*/
package org.jboss.richfaces.integrationTest.fileUpload;
@@ -76,7 +73,7 @@
private final String MSG_RIGHT_PANEL_NUMBER_OF_ITEMS = getMsg("RIGHT_PANEL_NUMBER_OF_ITEMS");
private final String MSG_RIGHT_PANEL_NAME_N = getMsg("RIGHT_PANEL_NAME_N");
private final String MSG_RIGHT_PANEL_SIZE_N = getMsg("RIGHT_PANEL_SIZE_N");
- private final String MSG_RIGHT_PANEL_COLOR_N_X_Y = getMsg("RIGHT_PANEL_COLOR_N_X_Y");
+ private final String MSG_RIGHT_PANEL_COLOR_X_Y = getMsg("RIGHT_PANEL_COLOR_X_Y");
private final String MSG_ADD_BUTTON_ENABLED = getMsg("ADD_BUTTON_ENABLED");
private final String MSG_ADD_BUTTON_NOT_ENABLED = getMsg("ADD_BUTTON_NOT_ENABLED");
@@ -134,7 +131,7 @@
boolean isPresent = selenium.isElementPresent(LOC_CLEAR_UPLOADED_DATA_BUTTON);
assertFalse(isPresent, MSG_CLEAR_UPLOADED_DATA_BUTTON_NOT_VISIBLE);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
count = selenium.getXpathCount(LOC_NOT_UPLOADED_LIST_TR).intValue();
assertEquals(count, 1, MSG_LEFT_PANEL_NUMBER_OF_ITEMS);
@@ -169,47 +166,47 @@
int count = selenium.getXpathCount(LOC_NOT_UPLOADED_LIST_TR).intValue();
assertEquals(count, 0, MSG_LEFT_PANEL_NUMBER_OF_ITEMS);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_BLUE);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_BLUE);
count = selenium.getXpathCount(LOC_NOT_UPLOADED_LIST_TR).intValue();
assertEquals(count, 2, MSG_LEFT_PANEL_NUMBER_OF_ITEMS);
- String text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_NAME, 1));
- assertEquals(text, "selenium-test" + Color.YELLOW.getRGB() + ".jpg", String.format(MSG_LEFT_PANEL_NAME_N, 1));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_NAME, 2));
- assertEquals(text, "selenium-test" + Color.BLUE.getRGB() + ".jpg", String.format(MSG_LEFT_PANEL_NAME_N, 2));
+ 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));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_NAME, 2));
+ assertEquals(text, "selenium-test" + Color.BLUE.getRGB() + ".jpg", format(MSG_LEFT_PANEL_NAME_N, 2));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 1));
- assertEquals(text, "Cancel", String.format(MSG_LEFT_PANEL_CANCEL_N, 1));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 2));
- assertEquals(text, "Cancel", String.format(MSG_LEFT_PANEL_CANCEL_N, 2));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 1));
+ assertEquals(text, "Cancel", format(MSG_LEFT_PANEL_CANCEL_N, 1));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 2));
+ assertEquals(text, "Cancel", format(MSG_LEFT_PANEL_CANCEL_N, 2));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_DONE, 1));
- assertEquals(text, "", String.format(MSG_LEFT_PANEL_DONE_N, 1));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_DONE, 2));
- assertEquals(text, "", String.format(MSG_LEFT_PANEL_DONE_N, 1));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_DONE, 1));
+ assertEquals(text, "", format(MSG_LEFT_PANEL_DONE_N, 1));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_DONE, 2));
+ assertEquals(text, "", format(MSG_LEFT_PANEL_DONE_N, 1));
selenium.click(LOC_UPLOAD_BUTTON);
waitFor(2000);
-
+
count = selenium.getXpathCount(LOC_NOT_UPLOADED_LIST_TR).intValue();
assertEquals(count, 2, MSG_LEFT_PANEL_NUMBER_OF_ITEMS);
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_NAME, 1));
- assertEquals(text, "selenium-test" + Color.YELLOW.getRGB() + ".jpg", String.format(MSG_LEFT_PANEL_NAME_N, 1));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_NAME, 2));
- assertEquals(text, "selenium-test" + Color.BLUE.getRGB() + ".jpg", String.format(MSG_LEFT_PANEL_NAME_N, 2));
+ 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));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_NAME, 2));
+ assertEquals(text, "selenium-test" + Color.BLUE.getRGB() + ".jpg", format(MSG_LEFT_PANEL_NAME_N, 2));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 1));
- assertEquals(text, "Clear", String.format(MSG_LEFT_PANEL_CANCEL_N, 1));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 2));
- assertEquals(text, "Clear", String.format(MSG_LEFT_PANEL_CANCEL_N, 1));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 1));
+ assertEquals(text, "Clear", format(MSG_LEFT_PANEL_CANCEL_N, 1));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 2));
+ assertEquals(text, "Clear", format(MSG_LEFT_PANEL_CANCEL_N, 1));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_DONE, 1));
- assertEquals(text, "Done", String.format(MSG_LEFT_PANEL_DONE_N, 1));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_DONE, 2));
- assertEquals(text, "Done", String.format(MSG_LEFT_PANEL_DONE_N, 1));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_DONE, 1));
+ assertEquals(text, "Done", format(MSG_LEFT_PANEL_DONE_N, 1));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_DONE, 2));
+ assertEquals(text, "Done", format(MSG_LEFT_PANEL_DONE_N, 1));
}
/**
@@ -222,36 +219,36 @@
int count = selenium.getXpathCount(LOC_UPLOADED_LIST_TR).intValue();
assertEquals(count, 0, MSG_RIGHT_PANEL_NUMBER_OF_ITEMS);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_CYAN);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_ORANGE);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_CYAN);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_ORANGE);
selenium.click(LOC_UPLOAD_BUTTON);
count = selenium.getXpathCount(LOC_UPLOADED_LIST_TR).intValue();
assertEquals(count, 0, MSG_RIGHT_PANEL_NUMBER_OF_ITEMS);
- waitForElement(String.format(LOC_UPLOADED_LIST_N_NAME, 1));
+ waitForElement(format(LOC_UPLOADED_LIST_N_NAME, 1));
- String text = selenium.getText(String.format(LOC_UPLOADED_LIST_N_NAME, 1));
- assertEquals(text, "selenium-test" + Color.CYAN.getRGB() + ".jpg", String.format(MSG_RIGHT_PANEL_NAME_N, 1));
- text = selenium.getText(String.format(LOC_UPLOADED_LIST_N_NAME, 2));
- assertEquals(text, "selenium-test" + Color.ORANGE.getRGB() + ".jpg", String.format(MSG_RIGHT_PANEL_NAME_N, 2));
+ String text = selenium.getText(format(LOC_UPLOADED_LIST_N_NAME, 1));
+ assertEquals(text, "selenium-test" + Color.CYAN.getRGB() + ".jpg", format(MSG_RIGHT_PANEL_NAME_N, 1));
+ text = selenium.getText(format(LOC_UPLOADED_LIST_N_NAME, 2));
+ assertEquals(text, "selenium-test" + Color.ORANGE.getRGB() + ".jpg", format(MSG_RIGHT_PANEL_NAME_N, 2));
- long size1 = Long.parseLong(selenium.getText(String.format(LOC_UPLOADED_LIST_N_SIZE, 1)));
+ long size1 = Long.parseLong(selenium.getText(format(LOC_UPLOADED_LIST_N_SIZE, 1)));
long size2 = new File(FILE_CYAN).length();
- assertEquals(size1, size2, String.format(MSG_RIGHT_PANEL_SIZE_N, 1));
+ assertEquals(size1, size2, format(MSG_RIGHT_PANEL_SIZE_N, 1));
- size1 = Long.parseLong(selenium.getText(String.format(LOC_UPLOADED_LIST_N_SIZE, 2)));
+ size1 = Long.parseLong(selenium.getText(format(LOC_UPLOADED_LIST_N_SIZE, 2)));
size2 = new File(FILE_ORANGE).length();
- assertEquals(size1, size2, String.format(MSG_RIGHT_PANEL_SIZE_N, 1));
+ assertEquals(size1, size2, format(MSG_RIGHT_PANEL_SIZE_N, 1));
// FIXME it cannot download the image
// String url =
- // selenium.getAttribute(String.format(LOC_UPLOADED_LIST_N_IMG, 1) +
+ // selenium.getAttribute(format(LOC_UPLOADED_LIST_N_IMG, 1) +
// "@src");
// assertImageColorEquals(url, Color.CYAN);
//
- // url = selenium.getAttribute(String.format(LOC_UPLOADED_LIST_N_IMG, 2)
+ // url = selenium.getAttribute(format(LOC_UPLOADED_LIST_N_IMG, 2)
// + "@src");
// assertImageColorEquals(url, Color.BLUE);
}
@@ -268,7 +265,7 @@
int count = selenium.getXpathCount(LOC_UPLOADED_LIST_TR).intValue();
assertEquals(count, 0, MSG_RIGHT_PANEL_NUMBER_OF_ITEMS);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_CYAN);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_CYAN);
waitForElement(LOC_UPLOADED_LIST_TR);
count = selenium.getXpathCount(LOC_UPLOADED_LIST_TR).intValue();
@@ -282,11 +279,11 @@
public void testUploadFiveFiles() {
assertTrue(!belongsClass("rich-fileupload-button-dis", LOC_ADD_BUTTON_CLASS), MSG_ADD_BUTTON_ENABLED);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_BLUE);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 3), "file://" + FILE_CYAN);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 4), "file://" + FILE_ORANGE);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 5), "file://" + FILE_RED);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_BLUE);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 3), "file://" + FILE_CYAN);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 4), "file://" + FILE_ORANGE);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 5), "file://" + FILE_RED);
assertFalse(!belongsClass("rich-fileupload-button-dis", LOC_ADD_BUTTON_CLASS), MSG_ADD_BUTTON_NOT_ENABLED);
}
@@ -298,27 +295,27 @@
*/
@Test
public void testUploadBigFile() {
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_BIG);
-
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_BIG);
+
selenium.click(LOC_UPLOAD_BUTTON);
waitFor(2000);
-
- String text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_NAME, 1));
- assertEquals(text, "selenium-test" + Color.YELLOW.getRGB() + ".jpg", String.format(MSG_LEFT_PANEL_NAME_N, 1));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_NAME, 2));
- assertEquals(text, "selenium-test" + Color.GREEN.getRGB() + ".jpg", String.format(MSG_LEFT_PANEL_NAME_N, 2));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 1));
- assertEquals(text, "Clear", String.format(MSG_LEFT_PANEL_CANCEL_N, 1));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 2));
- assertEquals(text, "Cancel", String.format(MSG_LEFT_PANEL_CANCEL_N, 2));
+ 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));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_NAME, 2));
+ assertEquals(text, "selenium-test" + Color.GREEN.getRGB() + ".jpg", format(MSG_LEFT_PANEL_NAME_N, 2));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_DONE, 1));
- assertEquals(text, "Done", String.format(MSG_LEFT_PANEL_DONE_N, 2));
- text = selenium.getText(String.format(LOC_NOT_UPLOADED_LIST_N_DONE, 2));
- assertEquals(text, "File size restricted", String.format(MSG_LEFT_PANEL_DONE_N, 2));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 1));
+ assertEquals(text, "Clear", format(MSG_LEFT_PANEL_CANCEL_N, 1));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_CANCEL, 2));
+ assertEquals(text, "Cancel", format(MSG_LEFT_PANEL_CANCEL_N, 2));
+ text = selenium.getText(format(LOC_NOT_UPLOADED_LIST_N_DONE, 1));
+ 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);
}
@@ -330,8 +327,8 @@
*/
@Test
public void testClearAllButton() {
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_CYAN);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_CYAN);
assertFalse(isDisplayed(LOC_CLEAR_ALL_BUTTON_STYLE), MSG_CLEAR_ALL_BUTTON_NOT_VISIBLE);
@@ -357,8 +354,8 @@
*/
@Test
public void testClearUploadedDataButton() {
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
- selenium.attachFile(String.format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_CYAN);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 1), "file://" + FILE_YELLOW);
+ selenium.attachFile(format(LOC_ADD_BUTTON_N, 2), "file://" + FILE_CYAN);
assertFalse(selenium.isElementPresent(LOC_CLEAR_UPLOADED_DATA_BUTTON),
MSG_CLEAR_UPLOADED_DATA_BUTTON_NOT_VISIBLE);
@@ -460,13 +457,13 @@
* @param expecteColor
* expected color of the image
*/
- private void assertImageColorEquals(String url, Color expecteColor) {
- assertEquals(getPixelColor(url, 0, 0), expecteColor, String.format(MSG_RIGHT_PANEL_COLOR_N_X_Y, 0, 0));
- assertEquals(getPixelColor(url, 10, 18), expecteColor, String.format(MSG_RIGHT_PANEL_COLOR_N_X_Y, 10, 18));
- assertEquals(getPixelColor(url, 120, 4), expecteColor, String.format(MSG_RIGHT_PANEL_COLOR_N_X_Y, 120, 4));
- assertEquals(getPixelColor(url, 5, 9), expecteColor, String.format(MSG_RIGHT_PANEL_COLOR_N_X_Y, 5, 9));
- assertEquals(getPixelColor(url, 84, 84), expecteColor, String.format(MSG_RIGHT_PANEL_COLOR_N_X_Y, 84, 84));
- assertEquals(getPixelColor(url, 71, 55), expecteColor, String.format(MSG_RIGHT_PANEL_COLOR_N_X_Y, 71, 55));
+ private void assertImageColorEquals(String url, Color expectedColor) {
+ assertEquals(getPixelColor(url, 0, 0), expectedColor, format(MSG_RIGHT_PANEL_COLOR_X_Y, 0, 0));
+ assertEquals(getPixelColor(url, 10, 18), expectedColor, format(MSG_RIGHT_PANEL_COLOR_X_Y, 10, 18));
+ assertEquals(getPixelColor(url, 120, 4), expectedColor, format(MSG_RIGHT_PANEL_COLOR_X_Y, 120, 4));
+ assertEquals(getPixelColor(url, 5, 9), expectedColor, format(MSG_RIGHT_PANEL_COLOR_X_Y, 5, 9));
+ assertEquals(getPixelColor(url, 84, 84), expectedColor, format(MSG_RIGHT_PANEL_COLOR_X_Y, 84, 84));
+ assertEquals(getPixelColor(url, 71, 55), expectedColor, format(MSG_RIGHT_PANEL_COLOR_X_Y, 71, 55));
}
/**
@@ -502,6 +499,7 @@
return new Color(red, green, blue);
}
+ @SuppressWarnings("unused")
@BeforeClass
private void createImages() {
createImage(Color.RED, 128, 128);
@@ -512,6 +510,7 @@
createImage(Color.GREEN, 2000, 3500);
}
+ @SuppressWarnings("unused")
@AfterClass
private void cleanUpImages() {
new File(FILE_RED).delete();
@@ -524,6 +523,7 @@
/**
* Loads the page containing the component.
*/
+ @SuppressWarnings("unused")
@BeforeMethod
private void loadPage() {
openComponent("File Upload");
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/inplaceInput/InplaceInputTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/inplaceInput/InplaceInputTestCase.java 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/inplaceInput/InplaceInputTestCase.java 2009-09-09 13:44:10 UTC (rev 15505)
@@ -1,3 +1,21 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
package org.jboss.richfaces.integrationTest.inplaceInput;
import static org.testng.Assert.assertFalse;
@@ -10,26 +28,24 @@
/**
* Test case that tests the inplace input component.
- * <ul>
- * <li><b>TODO</b> create tests for the fourth example (table)
- * </ul>
- *
+ *
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
+// TODO create tests for the fourth example (table)
public class InplaceInputTestCase extends AbstractSeleniumRichfacesTestCase {
// messages
- private final String MSG_COMPONENT_DESCRIPTION = getMess("COMPONENT_DESCRIPTION");
- private final String MSG_INITIAL_VALUE_NAME = getMess("INITIAL_VALUE_NAME");
- private final String MSG_INITIAL_VALUE_EMAIL = getMess("INITIAL_VALUE_EMAIL");
- private final String MSG_NAME_JOHN_SMITH = getMess("NAME_JOHN_SMITH");
- private final String MSG_EMAIL_JOHN_SMITH = getMess("EMAIL_JOHN_SMITH");
- private final String MSG_RICH_INPLACE_VIEW = getMess("RICH_INPLACE_VIEW");
- private final String MSG_RICH_INPLACE_CHANGED = getMess("RICH_INPLACE_CHANGED");
- private final String MSG_NOT_RICH_INPLACE_CHANGED = getMess("NOT_RICH_INPLACE_CHANGED");
- private final String MSG_RICH_INPLACE_EDIT = getMess("RICH_INPLACE_EDIT");
- private final String MSG_NOT_RICH_INPLACE_EDIT = getMess("NOT_RICH_INPLACE_EDIT");
+ private final String MSG_COMPONENT_DESCRIPTION = getMsg("COMPONENT_DESCRIPTION");
+ private final String MSG_INITIAL_VALUE_NAME = getMsg("INITIAL_VALUE_NAME");
+ private final String MSG_INITIAL_VALUE_EMAIL = getMsg("INITIAL_VALUE_EMAIL");
+ private final String MSG_NAME_JOHN_SMITH = getMsg("NAME_JOHN_SMITH");
+ private final String MSG_EMAIL_JOHN_SMITH = getMsg("EMAIL_JOHN_SMITH");
+ private final String MSG_RICH_INPLACE_VIEW = getMsg("RICH_INPLACE_VIEW");
+ private final String MSG_RICH_INPLACE_CHANGED = getMsg("RICH_INPLACE_CHANGED");
+ private final String MSG_NOT_RICH_INPLACE_CHANGED = getMsg("NOT_RICH_INPLACE_CHANGED");
+ private final String MSG_RICH_INPLACE_EDIT = getMsg("RICH_INPLACE_EDIT");
+ private final String MSG_NOT_RICH_INPLACE_EDIT = getMsg("NOT_RICH_INPLACE_EDIT");
// locators
private final String LOC_FIRST_NAME = getLoc("FIRST_NAME");
@@ -59,30 +75,22 @@
public void testFirstName() {
scrollIntoView(LOC_FIRST_NAME, true);
- String attr = selenium.getAttribute(LOC_FIRST_NAME + "@class");
- assertTrue(attr.contains("rich-inplace-view"), MSG_RICH_INPLACE_VIEW);
- assertFalse(attr.contains("rich-inplace-changed"),
- MSG_NOT_RICH_INPLACE_CHANGED);
- assertFalse(attr.contains("rich-inplace-edit"),
- MSG_NOT_RICH_INPLACE_EDIT);
-
+ assertTrue(belongsClass("rich-inplace-view", LOC_FIRST_NAME), MSG_RICH_INPLACE_VIEW);
+ assertFalse(belongsClass("rich-inplace-changed", LOC_FIRST_NAME), MSG_NOT_RICH_INPLACE_CHANGED);
+ assertFalse(belongsClass("rich-inplace-edit", LOC_FIRST_NAME), MSG_NOT_RICH_INPLACE_EDIT);
+
String text = selenium.getText(LOC_FIRST_NAME);
- assertTrue(text.endsWith("click to enter your name"),
- MSG_INITIAL_VALUE_NAME);
+ assertTrue(text.endsWith("click to enter your name"), MSG_INITIAL_VALUE_NAME);
selenium.click(LOC_FIRST_NAME);
- attr = selenium.getAttribute(LOC_FIRST_NAME + "@class");
- assertTrue(attr.contains("rich-inplace-edit"), MSG_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-edit", LOC_FIRST_NAME), MSG_RICH_INPLACE_EDIT);
selenium.type(LOC_FIRST_NAME_INPUT, "John Smith");
selenium.fireEvent(LOC_FIRST_NAME_INPUT, "blur");
- attr = selenium.getAttribute(LOC_FIRST_NAME + "@class");
- assertTrue(attr.contains("rich-inplace-changed"),
- MSG_RICH_INPLACE_CHANGED);
- assertFalse(attr.contains("rich-inplace-edit"),
- MSG_NOT_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-changed", LOC_FIRST_NAME), MSG_RICH_INPLACE_CHANGED);
+ assertFalse(belongsClass("rich-inplace-edit", LOC_FIRST_NAME), MSG_NOT_RICH_INPLACE_EDIT);
text = selenium.getText(LOC_FIRST_NAME);
assertTrue(text.endsWith("John Smith"), MSG_NAME_JOHN_SMITH);
@@ -98,30 +106,22 @@
public void testFirstEmail() {
scrollIntoView(LOC_FIRST_EMAIL, true);
- String attr = selenium.getAttribute(LOC_FIRST_EMAIL + "@class");
- assertTrue(attr.contains("rich-inplace-view"), MSG_RICH_INPLACE_VIEW);
- assertFalse(attr.contains("rich-inplace-changed"),
- MSG_NOT_RICH_INPLACE_CHANGED);
- assertFalse(attr.contains("rich-inplace-edit"),
- MSG_NOT_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-view", LOC_FIRST_EMAIL), MSG_RICH_INPLACE_VIEW);
+ assertFalse(belongsClass("rich-inplace-changed", LOC_FIRST_EMAIL), MSG_NOT_RICH_INPLACE_CHANGED);
+ assertFalse(belongsClass("rich-inplace-edit", LOC_FIRST_EMAIL), MSG_NOT_RICH_INPLACE_EDIT);
String text = selenium.getText(LOC_FIRST_EMAIL);
- assertTrue(text.endsWith("click to enter your email"),
- MSG_INITIAL_VALUE_EMAIL);
+ assertTrue(text.endsWith("click to enter your email"), MSG_INITIAL_VALUE_EMAIL);
selenium.click(LOC_FIRST_EMAIL);
- attr = selenium.getAttribute(LOC_FIRST_EMAIL + "@class");
- assertTrue(attr.contains("rich-inplace-edit"), MSG_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-edit", LOC_FIRST_EMAIL), MSG_RICH_INPLACE_EDIT);
selenium.type(LOC_FIRST_EMAIL_INPUT, "john(a)smith.name");
selenium.fireEvent(LOC_FIRST_EMAIL_INPUT, "blur");
- attr = selenium.getAttribute(LOC_FIRST_EMAIL + "@class");
- assertTrue(attr.contains("rich-inplace-changed"),
- MSG_RICH_INPLACE_CHANGED);
- assertFalse(attr.contains("rich-inplace-edit"),
- MSG_NOT_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-changed", LOC_FIRST_EMAIL), MSG_RICH_INPLACE_CHANGED);
+ assertFalse(belongsClass("rich-inplace-edit", LOC_FIRST_EMAIL), MSG_NOT_RICH_INPLACE_EDIT);
text = selenium.getText(LOC_FIRST_EMAIL);
assertTrue(text.endsWith("john(a)smith.name"), MSG_EMAIL_JOHN_SMITH);
@@ -137,31 +137,23 @@
public void testSecondName() {
scrollIntoView(LOC_SECOND_NAME, true);
- String attr = selenium.getAttribute(LOC_SECOND_NAME + "@class");
- assertTrue(attr.contains("rich-inplace-view"), MSG_RICH_INPLACE_VIEW);
- assertFalse(attr.contains("rich-inplace-changed"),
- MSG_NOT_RICH_INPLACE_CHANGED);
- assertFalse(attr.contains("rich-inplace-edit"),
- MSG_NOT_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-view", LOC_SECOND_NAME), MSG_RICH_INPLACE_VIEW);
+ assertFalse(belongsClass("rich-inplace-changed", LOC_SECOND_NAME), MSG_NOT_RICH_INPLACE_CHANGED);
+ assertFalse(belongsClass("rich-inplace-edit", LOC_SECOND_NAME), MSG_NOT_RICH_INPLACE_EDIT);
String text = selenium.getText(LOC_SECOND_NAME);
- assertTrue(text.endsWith("click to enter your name"),
- MSG_INITIAL_VALUE_NAME);
+ assertTrue(text.endsWith("click to enter your name"), MSG_INITIAL_VALUE_NAME);
selenium.click(LOC_SECOND_NAME);
- attr = selenium.getAttribute(LOC_SECOND_NAME + "@class");
- assertTrue(attr.contains("rich-inplace-edit"), MSG_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-edit", LOC_SECOND_NAME), MSG_RICH_INPLACE_EDIT);
selenium.type(LOC_SECOND_NAME_INPUT, "John Smith");
// TODO check that the button is visible
selenium.fireEvent(LOC_SECOND_NAME_OK, Event.MOUSEDOWN);
- attr = selenium.getAttribute(LOC_SECOND_NAME + "@class");
- assertTrue(attr.contains("rich-inplace-changed"),
- MSG_RICH_INPLACE_CHANGED);
- assertFalse(attr.contains("rich-inplace-edit"),
- MSG_NOT_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-changed", LOC_SECOND_NAME), MSG_RICH_INPLACE_CHANGED);
+ assertFalse(belongsClass("rich-inplace-edit", LOC_SECOND_NAME), MSG_NOT_RICH_INPLACE_EDIT);
text = selenium.getText(LOC_SECOND_NAME);
assertTrue(text.endsWith("John Smith"), MSG_NAME_JOHN_SMITH);
@@ -177,31 +169,23 @@
public void testSecondEmail() {
scrollIntoView(LOC_SECOND_EMAIL, true);
- String attr = selenium.getAttribute(LOC_SECOND_EMAIL + "@class");
- assertTrue(attr.contains("rich-inplace-view"), MSG_RICH_INPLACE_VIEW);
- assertFalse(attr.contains("rich-inplace-changed"),
- MSG_NOT_RICH_INPLACE_CHANGED);
- assertFalse(attr.contains("rich-inplace-edit"),
- MSG_NOT_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-view", LOC_SECOND_EMAIL), MSG_RICH_INPLACE_VIEW);
+ assertFalse(belongsClass("rich-inplace-changed", LOC_SECOND_EMAIL), MSG_NOT_RICH_INPLACE_CHANGED);
+ assertFalse(belongsClass("rich-inplace-edit", LOC_SECOND_EMAIL), MSG_NOT_RICH_INPLACE_EDIT);
String text = selenium.getText(LOC_SECOND_EMAIL);
- assertTrue(text.endsWith("click to enter your email"),
- MSG_INITIAL_VALUE_EMAIL);
+ assertTrue(text.endsWith("click to enter your email"), MSG_INITIAL_VALUE_EMAIL);
selenium.click(LOC_SECOND_EMAIL);
- attr = selenium.getAttribute(LOC_SECOND_EMAIL + "@class");
- assertTrue(attr.contains("rich-inplace-edit"), MSG_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-edit", LOC_SECOND_EMAIL), MSG_RICH_INPLACE_EDIT);
selenium.type(LOC_SECOND_EMAIL_INPUT, "john(a)smith.name");
// TODO check that the button is visible
selenium.fireEvent(LOC_SECOND_EMAIL_OK, Event.MOUSEDOWN);
- attr = selenium.getAttribute(LOC_SECOND_EMAIL + "@class");
- assertTrue(attr.contains("rich-inplace-changed"),
- MSG_RICH_INPLACE_CHANGED);
- assertFalse(attr.contains("rich-inplace-edit"),
- MSG_NOT_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-changed", LOC_SECOND_EMAIL), MSG_RICH_INPLACE_CHANGED);
+ assertFalse(belongsClass("rich-inplace-edit", LOC_SECOND_EMAIL), MSG_NOT_RICH_INPLACE_EDIT);
text = selenium.getText(LOC_SECOND_EMAIL);
assertTrue(text.endsWith("john(a)smith.name"), MSG_EMAIL_JOHN_SMITH);
@@ -217,70 +201,94 @@
public void testThird() {
scrollIntoView(LOC_THIRD, true);
- String attr = selenium.getAttribute(LOC_THIRD + "@class");
- assertTrue(attr.contains("rich-inplace-view"), MSG_RICH_INPLACE_VIEW);
- assertFalse(attr.contains("rich-inplace-changed"),
- MSG_NOT_RICH_INPLACE_CHANGED);
- assertFalse(attr.contains("rich-inplace-edit"),
- MSG_NOT_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-view", LOC_THIRD), MSG_RICH_INPLACE_VIEW);
+ assertFalse(belongsClass("rich-inplace-changed", LOC_THIRD), MSG_NOT_RICH_INPLACE_CHANGED);
+ assertFalse(belongsClass("rich-inplace-edit", LOC_THIRD), MSG_NOT_RICH_INPLACE_EDIT);
String text = selenium.getText(LOC_THIRD);
assertTrue(text.endsWith("Click here to edit"), MSG_INITIAL_VALUE_EMAIL);
selenium.click(LOC_THIRD);
- attr = selenium.getAttribute(LOC_THIRD + "@class");
- assertTrue(attr.contains("rich-inplace-edit"), MSG_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-edit", LOC_THIRD), MSG_RICH_INPLACE_EDIT);
selenium.type(LOC_THIRD_INPUT, "John Smith");
// TODO check that the button is visible
selenium.fireEvent(LOC_THIRD_SAVE, Event.MOUSEDOWN);
- attr = selenium.getAttribute(LOC_THIRD + "@class");
- assertTrue(attr.contains("rich-inplace-changed"),
- MSG_RICH_INPLACE_CHANGED);
- assertFalse(attr.contains("rich-inplace-edit"),
- MSG_NOT_RICH_INPLACE_EDIT);
+ assertTrue(belongsClass("rich-inplace-changed", LOC_THIRD), MSG_RICH_INPLACE_CHANGED);
+ assertFalse(belongsClass("rich-inplace-edit", LOC_THIRD), MSG_NOT_RICH_INPLACE_EDIT);
text = selenium.getText(LOC_THIRD);
assertTrue(text.endsWith("John Smith"), MSG_NAME_JOHN_SMITH);
}
/**
- * Tests the "View Source". It checks that the source code is not visible,
- * clicks on the link, and checks the first 2 components of source code,
- * i.e. that the source code begins with "<ui:composition".
- */
- @Test
- public void testFirstInputSource() {
- abstractTestSource(1, 2, "<", "ui:composition");
- }
+ * Tests the "View Source" in the first example. It checks that the source code is not visible,
+ * clicks on the link, and checks 9 lines of source code.
+ */
+ @Test
+ public void testFirstSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<rich:panel style=\"width:220px;\">",
+ "<f:facet name=\"header\">",
+ "<h:outputText value=\"Person Info\"></h:outputText>",
+ "<h:panelGrid columns=\"2\">",
+ "<h:outputText value=\"Name: \"/>",
+ "<rich:inplaceInput defaultLabel=\"click to enter your name\"/>",
+ "<h:outputText value=\"Email:\"/>",
+ "<rich:inplaceInput defaultLabel=\"click to enter your email\"/>",
+ };
- /**
- * Tests the "View Source". It checks that the source code is not visible,
- * clicks on the link, and checks the first 2 components of source code,
- * i.e. that the source code begins with "<ui:composition".
- */
- @Test
- public void testSecondInputSource() {
- abstractTestSource(2, 2, "<", "ui:composition");
- }
+ abstractTestSource(1, "View Source", strings);
+ }
- /**
- * Tests the "View Source". It checks that the source code is not visible,
- * clicks on the link, and checks the first 2 components of source code,
- * i.e. that the source code begins with "<ui:composition".
- */
- @Test
- public void testThirdInputSource() {
- abstractTestSource(3, 1, "<", "ui:composition");
- }
+ /**
+ * Tests the "View Source" in the second example. It checks that the source code is not visible,
+ * clicks on the link, and checks 9 lines of source code.
+ */
+ @Test
+ public void testSecondSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<rich:panel style=\"width:220px;\">",
+ "<f:facet name=\"header\">",
+ "<h:outputText value=\"Person Info\"/>",
+ "<h:panelGrid columns=\"2\">",
+ "<h:outputText value=\"Name: \"/>",
+ "<rich:inplaceInput defaultLabel=\"click to enter your name\" ",
+ "showControls=\"true\"/>",
+ "</h:panelGrid>",
+ };
+ abstractTestSource(2, "View Source", strings);
+ }
+
+ /**
+ * Tests the "View Source" in the third example. It checks that the source code is not visible,
+ * clicks on the link, and checks 9 lines of source code.
+ */
+ @Test
+ public void testThirdSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<rich:inplaceInput defaultLabel=\"Click here to edit\" showControls=\"true\"",
+ "controlsHorizontalPosition=\"left\" controlsVerticalPosition=\"bottom\"",
+ "id=\"inplaceInput\">",
+ " <f:facet name=\"controls\">",
+ "<button onmousedown=\"#{rich:component('inplaceInput')}.save();\"",
+ " type=\"button\">Save</button>",
+ "<button onmousedown=\"#{rich:component('inplaceInput')}.cancel();\"",
+ "<rich:spacer height=\"25px\" width=\"100%\"/>",
+ };
+
+ abstractTestSource(3, "View Source", strings);
+ }
+
/**
- * Loads the page containing the calendar component.
- */
- @BeforeMethod
- private void loadPage() {
- super.loadPage("richInputs", 6, MSG_COMPONENT_DESCRIPTION);
- }
+ * Loads the page containing needed component.
+ */
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Inplace Input");
+ }
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/spinner/SpinnerTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/spinner/SpinnerTestCase.java 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/spinner/SpinnerTestCase.java 2009-09-09 13:44:10 UTC (rev 15505)
@@ -295,7 +295,7 @@
}
/**
- * Loads the page containing the calendar component.
+ * Loads the page containing needed component.
*/
@SuppressWarnings("unused")
@BeforeMethod
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/contextMenu/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/contextMenu/locators.properties 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/contextMenu/locators.properties 2009-09-09 13:44:10 UTC (rev 15505)
@@ -1,6 +1,20 @@
# ContextMenuImageTestCase
-HEADER=//fieldset[1]/legend
-IMAGE=//fieldset[1]/div/table//tr/td/span/img
-CONTEXT_MENU=//fieldset[1]/div/table//tr/td/span/div/div/div
-ZOOM_IN=//div[@id='zin']
-ZOOM_OUT=//div[@id='zout']
\ No newline at end of file
+FIRST_HEADER=//fieldset[1]/legend
+FIRST_IMAGE=//fieldset[1]/div/table//tr/td/span/img
+FIRST_CONTEXT_MENU=//fieldset[1]/div/table//tr/td/span/div/div/div
+FIRST_ZOOM_IN=//div[@id='zin']
+FIRST_ZOOM_OUT=//div[@id='zout']
+
+# ContextMenuTableTestCase
+SECOND_EXAMPLE_HEADER=//fieldset[2]/legend
+SECOND_CONTEXT_MENU=//fieldset[2]/div/form/div/div/div[1]
+SECOND_LAST_MENU_ACTION=//fieldset[2]/div/form/table/tbody/tr/td[2]/span/div/div[2]
+
+SECOND_CAR_DETAILS=//fieldset[2]/div/form/div/div/div[1]/div/div[1]/span[2]
+SECOND_ACTIONS=//fieldset[2]/div/form/div/div/div[2]
+SECOND_ACTION_PREFORMATTED=//fieldset[2]/div/form/div/div/div[2]/div/div[{0}]/span[2]
+
+SECOND_LINE_3_COLUMN_1=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr[3]/td[1]
+SECOND_LINE_3_COLUMN_2=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr[3]/td[2]
+SECOND_LINE_6_COLUMN_2=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr[6]/td[2]
+SECOND_LINE_1_COLUMN_3=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr[1]/td[3]
\ No newline at end of file
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/contextMenu/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/contextMenu/messages.properties 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/contextMenu/messages.properties 2009-09-09 13:44:10 UTC (rev 15505)
@@ -0,0 +1,5 @@
+# ContextMenuTableTestCase
+SECOND_CAR_DETAILS_PREFORMATTED={0} {1} details
+SECOND_PUT_PRODUCER_MODEL_TO_BASKET_PREFORMATTED=Put {0} {1} To Basket
+SECOND_READ_COMMENTS_PREFORMATTED=Read Comments
+SECOND_GO_TO_PRODUCER_SITE_PREFORMATTED=Go to {0} site
\ No newline at end of file
Added: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dropDownMenu/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dropDownMenu/locators.properties (rev 0)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dropDownMenu/locators.properties 2009-09-09 13:44:10 UTC (rev 15505)
@@ -0,0 +1,9 @@
+FIRST_EXAMPLE_HEADER=//fieldset[1]/legend
+FIRST_CURRENT_SELECTION=//fieldset[1]/div/span/span
+FIRST_MENU=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div[2]/div[1]
+FIRST_MENU_NEW=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div[2]/div/div/div[1]
+FIRST_MENU_SAVE_ALL=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div[2]/div[2]/div/div[2]
+FIRST_MENU_SEPARATOR=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div[2]/div[1]/div/div[5]
+FIRST_MENU_IMAGE=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div[1]/img
+FIRST_MENU_LINK_HOMEPAGE=//fieldset[1]/div/form/table/tbody/tr/td[2]/div/div[2]/div/div/div[1]/span[2]/a
+FIRST_MENU_LINK_FORUM=//fieldset[1]/div/form/table/tbody/tr/td[2]/div/div[2]/div/div/div[2]/span[2]/a
\ No newline at end of file
Property changes on: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dropDownMenu/locators.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dropDownMenu/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dropDownMenu/messages.properties (rev 0)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dropDownMenu/messages.properties 2009-09-09 13:44:10 UTC (rev 15505)
@@ -0,0 +1,3 @@
+FIRST_INITIAL_CURRENT_SELECTION=
+FIRST_CURRENT_SELECTION_NEW=New
+FIRST_CURRENT_SELECTION_SAVE_ALL=Save All
\ No newline at end of file
Property changes on: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/dropDownMenu/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/editor/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/editor/locators.properties 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/editor/locators.properties 2009-09-09 13:44:10 UTC (rev 15505)
@@ -22,7 +22,7 @@
TEXT_AREA_UL_LI=//body[@id='tinymce']/ul/li
TEXT_AREA_ADDRESS=//body[@id='tinymce']/address
TEXT_AREA_PRE=//body[@id='tinymce']/pre
-TEXT_AREA_HN=//body[@id='tinymce']/h%d
+TEXT_AREA_HN=//body[@id='tinymce']/h{0}
# simple editor' buttons
BOLD_BUTTON=id=form:editorTextArea_bold
@@ -43,8 +43,8 @@
ADV_ALIGN_FULL_BUTTON=id=form:editorTextArea_justifyfull
ADV_STYLE_SELECT_BUTTON=id=form:editorTextArea_styleselect_open
ADV_FORMAT_SELECT_BUTTON=id=form:editorTextArea_formatselect_open
-ADV_STYLE_N=//table[@id='menu_form:editorTextArea_form:editorTextArea_styleselect_menu_tbl']/tbody/tr[%d]
-ADV_FORMAT_N=//table[@id='menu_form:editorTextArea_form:editorTextArea_formatselect_menu_tbl']/tbody/tr[%d]
+ADV_STYLE_N=//table[@id='menu_form:editorTextArea_form:editorTextArea_styleselect_menu_tbl']/tbody/tr[{0}]
+ADV_FORMAT_N=//table[@id='menu_form:editorTextArea_form:editorTextArea_formatselect_menu_tbl']/tbody/tr[{0}]
ADV_INDENT_BUTTON=id=form:editorTextArea_indent
ADV_OUTDENT_BUTTON=id=form:editorTextArea_outdent
ADV_HORIZONTAL_RULER_BUTTON=id=form:editorTextArea_hr
@@ -81,7 +81,7 @@
ADV_IMAGE_DLG_INSERT_BUTTON=id=insert
# insert custom character dialog
-ADV_CUSTOM_CHAR_DLG_M_N=//td[@id='charmapView']/table/tbody/tr[%d]/td[%d]/a
+ADV_CUSTOM_CHAR_DLG_M_N=//td[@id='charmapView']/table/tbody/tr[{0}]/td[{1}]/a
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/editor/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/editor/messages.properties 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/editor/messages.properties 2009-09-09 13:44:10 UTC (rev 15505)
@@ -1,4 +1,3 @@
-COMPONENT_DESCRIPTION=RichFaces Editor component provides possibility to use tinyMCE widget
STRINGS_SHOULD_BE_BOLD=The string "bbbb" and "dddd" should be in bold.
STRINGS_SHOULD_BE_ITALIC=The strings "bbbb" and "dddd" should be in italic.
STRINGS_SHOULD_BE_UNDERLINED=The strings "bbbb" and "dddd" should be underlined.
@@ -9,21 +8,21 @@
TWO_LINES_SHOULD_CONTAIN_A_PARAGRAPH=The first and the fifth line should contain a paragraph.
TWO_LINES_IN_THE_EDITOR=There should be two lines in the editor.
LIST_SHOULD_CONTAIN_THREE_ITEMS=The list should contain three items.
-PARAGRAPH_ALIGNED_TO_THE_SIDE_S=The paragraph should be aligned to the %s.
+PARAGRAPH_ALIGNED_TO_THE_SIDE_S=The paragraph should be aligned to the {0}.
PARAGRAPH_JUSTIFIED=The paragraph should be justified.
PARAGRAPH_SHOULD_HAVE_NO_STYLE=The paragraph should not be styled.
PARAGRAPHS_CLASS_ATTRIBUTE=Paragraph's class attribute.
-TAG_S_SHOULD_BE_IN_EDITOR=Tag %s should appear in the editor.
-TAG_S_SHOULD_NOT_BE_IN_EDITOR=Tag %s should not appear in the editor.
-CONTENT_OF_TAG_S=Content of tag %s.
-PARAGRAPH_INDENTED_BY_N_PX=Paragraph should be indented by %d pixels.
+TAG_S_SHOULD_BE_IN_EDITOR=Tag {0} should appear in the editor.
+TAG_S_SHOULD_NOT_BE_IN_EDITOR=Tag {0} should not appear in the editor.
+CONTENT_OF_TAG_S=Content of tag {0}.
+PARAGRAPH_INDENTED_BY_N_PX=Paragraph should be indented by {0} pixels.
NUMBER_OF_RULERS=The number of horizontal rulers in the editor.
TEXT_IN_SUBSCRIPT=Text written as subscript.
TEXT_IN_SUPERSCRIPT=Text written as superscript.
LABEL_OF_LINK=Label of the link.
-LINK_ATTRIBUTE_S=Attribute %s of the link.
+LINK_ATTRIBUTE_S=Attribute {0} of the link.
CLASS_ATTRIBUTE=Attribute class of the text in the editor.
-IMG_ATTRIBUTE_S=Attribute %s of the image.
+IMG_ATTRIBUTE_S=Attribute {0} of the image.
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/fileUpload/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/fileUpload/locators.properties 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/fileUpload/locators.properties 2009-09-09 13:44:10 UTC (rev 15505)
@@ -1,5 +1,5 @@
EXAMPLE_HEADER=//fieldset[1]/legend
-ADD_BUTTON_N=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr/td/div[1]/div/div[2]/input[%d]
+ADD_BUTTON_N=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr/td/div[1]/div/div[2]/input[{0}]
ADD_BUTTON_CLASS=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr/td/div[1]/div
UPLOAD_BUTTON_STYLE=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr/td/div[2]
UPLOAD_BUTTON=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr/td/div[2]/div
@@ -8,15 +8,15 @@
CLEAR_UPLOADED_DATA_BUTTON=//fieldset[1]/div/form/table/tbody/tr/td[2]/span/input
NOT_UPLOADED_LIST_TR=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div/table/tbody/tr
-NOT_UPLOADED_LIST_N_NAME=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div/table[%d]/tbody/tr/td[1]/div[1]
-NOT_UPLOADED_LIST_N_DONE=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div/table[%d]/tbody/tr/td[1]/div[3]
-NOT_UPLOADED_LIST_N_CANCEL=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div/table[%d]/tbody/tr/td[2]/div/a
+NOT_UPLOADED_LIST_N_NAME=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div/table[{0}]/tbody/tr/td[1]/div[1]
+NOT_UPLOADED_LIST_N_DONE=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div/table[{0}]/tbody/tr/td[1]/div[3]
+NOT_UPLOADED_LIST_N_CANCEL=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/div/table[{0}]/tbody/tr/td[2]/div/a
UPLOADED_FILES_INFO=//fieldset[1]/div/form/table/tbody/tr/td[2]/span/div/div[2]
UPLOADED_LIST_TR=//fieldset[1]/div/form/table/tbody/tr/td[2]/span/div/div[2]/table/tbody/tr
-UPLOADED_LIST_N_IMG=//fieldset[1]/div/form/table/tbody/tr/td[2]/span/div/div[2]/table/tbody/tr[%d]/td/div/div/table/tbody/tr/td[1]/img
-UPLOADED_LIST_N_NAME=//fieldset[1]/div/form/table/tbody/tr/td[2]/span/div/div[2]/table/tbody/tr[%d]/td/div/div/table/tbody/tr/td[2]/table/tbody/tr[1]/td[2]
-UPLOADED_LIST_N_SIZE=//fieldset[1]/div/form/table/tbody/tr/td[2]/span/div/div[2]/table/tbody/tr[%d]/td/div/div/table/tbody/tr/td[2]/table/tbody/tr[2]/td[2]
+UPLOADED_LIST_N_IMG=//fieldset[1]/div/form/table/tbody/tr/td[2]/span/div/div[2]/table/tbody/tr[{0}]/td/div/div/table/tbody/tr/td[1]/img
+UPLOADED_LIST_N_NAME=//fieldset[1]/div/form/table/tbody/tr/td[2]/span/div/div[2]/table/tbody/tr[{0}]/td/div/div/table/tbody/tr/td[2]/table/tbody/tr[1]/td[2]
+UPLOADED_LIST_N_SIZE=//fieldset[1]/div/form/table/tbody/tr/td[2]/span/div/div[2]/table/tbody/tr[{0}]/td/div/div/table/tbody/tr/td[2]/table/tbody/tr[2]/td[2]
AUTOMATIC_UPLOAD=//fieldset[2]/form/table/tbody/tr/td[1]/input
FLASH=//fieldset[2]/form/table/tbody/tr/td[2]/input
\ No newline at end of file
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/fileUpload/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/fileUpload/messages.properties 2009-09-09 13:25:06 UTC (rev 15504)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/fileUpload/messages.properties 2009-09-09 13:44:10 UTC (rev 15505)
@@ -3,15 +3,15 @@
COULD_NOT_READ_IMAGE=Could not read the image from the given URL.
LEFT_PANEL_NUMBER_OF_ITEMS=The number of items in the left panel.
-LEFT_PANEL_NAME_N=The name of the item nr. %d in the left panel.
-LEFT_PANEL_CANCEL_N=The link of the item nr. %d in the left panel.
-LEFT_PANEL_DONE_N=The string under item nr. %d's name in the left panel.
+LEFT_PANEL_NAME_N=The name of the item nr. {0} in the left panel.
+LEFT_PANEL_CANCEL_N=The link of the item nr. {0} in the left panel.
+LEFT_PANEL_DONE_N=The string under item nr. {0}'s name in the left panel.
RIGHT_PANEL_CONTENT=The content of the right panel.
RIGHT_PANEL_NUMBER_OF_ITEMS=The number of items in the right panel.
-RIGHT_PANEL_NAME_N=The name of the item nr. %d in the right panel.
-RIGHT_PANEL_SIZE_N=The size of the item nr. %d in the right panel.
-RIGHT_PANEL_COLOR_N_X_Y=The color of pixel [%d,%d] of image nr. %d in the right panel.
+RIGHT_PANEL_NAME_N=The name of the item nr. {0} in the right panel.
+RIGHT_PANEL_SIZE_N=The size of the item nr. {0} in the right panel.
+RIGHT_PANEL_COLOR_X_Y=The color of pixel [{0},{0}] of image in the right panel.
ADD_BUTTON_ENABLED=The "Add" button should be enabled.
ADD_BUTTON_NOT_ENABLED=The "Add" button should not be enabled.
15 years, 4 months
JBoss Rich Faces SVN: r15504 - management/planning.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-09-09 09:25:06 -0400 (Wed, 09 Sep 2009)
New Revision: 15504
Added:
management/planning/richfaces_4x_components_priority_list.ods
Log:
First revision of priority list for RF 4 components
Added: management/planning/richfaces_4x_components_priority_list.ods
===================================================================
(Binary files differ)
Property changes on: management/planning/richfaces_4x_components_priority_list.ods
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 4 months
JBoss Rich Faces SVN: r15503 - branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-09-09 05:00:11 -0400 (Wed, 09 Sep 2009)
New Revision: 15503
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java
Log:
* AbstractExtendedDataTableTestCase - modified waitForSplashScreen - longer wait timeout when waiting for splash screen disappears
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java 2009-09-09 08:46:24 UTC (rev 15502)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java 2009-09-09 09:00:11 UTC (rev 15503)
@@ -52,12 +52,12 @@
* Wait for splash screen indicating request of table rerendering disappears
*/
protected void waitForSplash() {
- Wait.dontFail().interval(1).timeout(2000).until(new Condition() {
+ Wait.dontFail().interval(5).timeout(2000).until(new Condition() {
public boolean isTrue() {
return selenium.isElementPresent(LOC_DIV_SPLASH_SCREEN);
}
});
- Wait.interval(1).timeout(2000).until(new Condition() {
+ waitModelUpdate.until(new Condition() {
public boolean isTrue() {
return !selenium.isElementPresent(LOC_DIV_SPLASH_SCREEN);
}
15 years, 4 months