Author: vpakan(a)redhat.com
Date: 2011-03-08 07:08:10 -0500 (Tue, 08 Mar 2011)
New Revision: 29600
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/DataDefinitionTagTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ListShuttleTagTest.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
Added DataDefinitionTagTest and ListShuttleTagTest.
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-03-08
11:46:49 UTC (rev 29599)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-03-08
12:08:10 UTC (rev 29600)
@@ -36,10 +36,12 @@
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ColumnsTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ComboBoxTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.CoreHTMLTagsTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.DataDefinitionTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.FileUploadTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.InplaceInputTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.InplaceSelectInputTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.JSFTagsTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.ListShuttleTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.PanelMenuTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.PickListTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ProgressTagTest;
@@ -115,6 +117,8 @@
suite.addTestSuite(PickListTagTest.class);
suite.addTestSuite(ProgressTagTest.class);
suite.addTestSuite(PanelMenuTagTest.class);
+ suite.addTestSuite(ListShuttleTagTest.class);
+ suite.addTestSuite(DataDefinitionTagTest.class);
suite.addTestSuite(XhtmlFilePerformanceTest.class);
return new TestSetup(suite);
}
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/DataDefinitionTagTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/DataDefinitionTagTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/DataDefinitionTagTest.java 2011-03-08
12:08:10 UTC (rev 29600)
@@ -0,0 +1,79 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2011 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+import org.jboss.tools.ui.bot.ext.Timing;
+
+/**
+ * Tests Rich Faces Data Definition Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class DataDefinitionTagTest extends RichFacesTagsTest{
+ private static String testText = "test_text";
+ private static int numRows = 3;
+ @Override
+ protected void initPageContent() {
+ xhtmlEditor.setText("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" +
+ "<html
xmlns=\"http://www.w3.org/1999/xhtml\"\n" +
+ "
xmlns:ui=\"http://java.sun.com/jsf/facelets\"\n" +
+ "
xmlns:f=\"http://java.sun.com/jsf/core\"\n" +
+ "
xmlns:rich=\"http://richfaces.org/rich\"\n" +
+ "
xmlns:a4j=\"http://richfaces.org/a4j\">\n" +
+ " <head>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <f:view>\n" +
+ " <h:form>\n" +
+ " <rich:dataDefinitionList id=\"defList\"
rows=\"" + numRows +"\" title=\"Book Store\">\n" +
+ " " + testText +"\n" +
+ " </rich:dataDefinitionList>\n" +
+ " </h:form>\n" +
+ " </f:view>\n" +
+ " </body>\n" +
+ "</html>");
+ }
+
+ @Override
+ protected void verifyTag() {
+ assertVisualEditorContainsNodeWithValue(xhtmlWebBrowser,
+ DataDefinitionTagTest.testText,
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsManyNodes(xhtmlWebBrowser,
+ "DD",
+ DataDefinitionTagTest.numRows,
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "DL",
+ new String[]{"class"},
+ new String[]{"listClass"},
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "DD",
+ new String[]{"class"},
+ new String[]{"columnClass"},
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ // check tag selection
+ xhtmlWebBrowser.selectDomNode(xhtmlWebBrowser.getDomNodeByTagName("DD",2),
0);
+ bot.sleep(Timing.time3S());
+ String selectedText = xhtmlEditor.getSelection();
+ String hasToStartWith = "<rich:dataDefinitionList ";
+ assertTrue("Selected text in Source Pane has to start with '" +
hasToStartWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().startsWith(hasToStartWith));
+ String hasEndWith = "</rich:dataDefinitionList>";
+ assertTrue("Selected text in Source Pane has to end with '" +
hasEndWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().endsWith(hasEndWith));
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/DataDefinitionTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ListShuttleTagTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ListShuttleTagTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ListShuttleTagTest.java 2011-03-08
12:08:10 UTC (rev 29600)
@@ -0,0 +1,109 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2011 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+import org.jboss.tools.ui.bot.ext.Timing;
+
+/**
+ * Tests Rich Faces List Shuttle Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class ListShuttleTagTest extends RichFacesTagsTest{
+ @Override
+ protected void initPageContent() {
+ xhtmlEditor.setText("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" +
+ "<html
xmlns=\"http://www.w3.org/1999/xhtml\"\n" +
+ "
xmlns:ui=\"http://java.sun.com/jsf/facelets\"\n" +
+ "
xmlns:f=\"http://java.sun.com/jsf/core\"\n" +
+ "
xmlns:rich=\"http://richfaces.org/rich\"\n" +
+ "
xmlns:a4j=\"http://richfaces.org/a4j\">\n" +
+ " <head>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <f:view>\n" +
+ " <rich:listShuttle>\n" +
+ " </rich:listShuttle>\n" +
+ " </f:view>\n" +
+ " </body>\n" +
+ "</html>");
+ }
+
+ @Override
+ protected void verifyTag() {
+ assertVisualEditorContainsNodeWithValue(
+ xhtmlWebBrowser,
+ "Copy all",
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(
+ xhtmlWebBrowser,
+ "Copy",
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(
+ xhtmlWebBrowser,
+ "Remove All",
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(
+ xhtmlWebBrowser,
+ "Remove",
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(
+ xhtmlWebBrowser,
+ "First",
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(
+ xhtmlWebBrowser,
+ "Up",
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(
+ xhtmlWebBrowser,
+ "Last",
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(
+ xhtmlWebBrowser,
+ "Down",
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "DIV",
+ new String[]{"class"},
+ new String[]{"rich-shuttle-button-content"},
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "TABLE",
+ new String[]{"class"},
+ new String[]{"rich-list-shuttle"},
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "DIV",
+ new String[]{"class"},
+ new String[]{"rich-shuttle-controls"},
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "DIV",
+ new String[]{"class"},
+ new String[]{"rich-shuttle-control"},
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ // check tag selection
+
xhtmlWebBrowser.selectDomNode(xhtmlWebBrowser.getDomNodeByTagName("DIV",4), 0);
+ bot.sleep(Timing.time3S());
+ String selectedText = xhtmlEditor.getSelection();
+ String hasToStartWith = "<rich:listShuttle>";
+ assertTrue("Selected text in Source Pane has to start with '" +
hasToStartWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().startsWith(hasToStartWith));
+ String hasEndWith = "</rich:listShuttle>";
+ assertTrue("Selected text in Source Pane has to end with '" +
hasEndWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().endsWith(hasEndWith));
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ListShuttleTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain