Author: vpakan(a)redhat.com
Date: 2011-03-25 12:40:02 -0400 (Fri, 25 Mar 2011)
New Revision: 30030
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/EditorTagTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/TreeTagTest.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
Added tests for editor and tree richFaces tag.
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-25
13:15:51 UTC (rev 30029)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-03-25
16:40:02 UTC (rev 30030)
@@ -37,6 +37,7 @@
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.EditorTagTest;
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;
@@ -45,6 +46,7 @@
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;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.TreeTagTest;
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4556Test;
import org.jboss.tools.vpe.ui.bot.test.palette.CancelTagLibDefenitionTest;
import org.jboss.tools.vpe.ui.bot.test.palette.ImportTagsFromTLDFileTest;
@@ -119,6 +121,8 @@
suite.addTestSuite(PanelMenuTagTest.class);
suite.addTestSuite(ListShuttleTagTest.class);
suite.addTestSuite(DataDefinitionTagTest.class);
+ suite.addTestSuite(EditorTagTest.class);
+ suite.addTestSuite(TreeTagTest.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/EditorTagTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/EditorTagTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/EditorTagTest.java 2011-03-25
16:40:02 UTC (rev 30030)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+
+ * 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 Editor Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class EditorTagTest 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:editor width=\"264\" height=\"200\"
styleClass=\"btn\" style=\"width:500;
background-color:red\">\n" +
+ " </rich:editor>\n" +
+ " </f:view>\n" +
+ " </body>\n" +
+ "</html>");
+ }
+
+ @Override
+ protected void verifyTag() {
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "DIV",
+ new String[]{"class"},
+ new String[]{"mceIframeContainer"},
+ 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:editor ";
+ assertTrue("Selected text in Source Pane has to start with '" +
hasToStartWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().startsWith(hasToStartWith));
+ String hasEndWith = "</rich:editor>";
+ 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/EditorTagTest.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/TreeTagTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/TreeTagTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/TreeTagTest.java 2011-03-25
16:40:02 UTC (rev 30030)
@@ -0,0 +1,84 @@
+/*******************************************************************************
+
+ * 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 Editor Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class TreeTagTest extends RichFacesTagsTest{
+ private static final String typeLibrary = "library";
+ private static final String typePathway = "pathway";
+ private static final String typeOrganism = "organism";
+ @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:h=\"http://java.sun.com/jsf/html\"\n" +
+ "
xmlns:a4j=\"http://richfaces.org/a4j\">\n" +
+ " <head>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <f:view>\n" +
+ " <rich:tree>\n" +
+ " <rich:treeNode type=\"" + TreeTagTest.typeLibrary +
"\">\n" +
+ " <h:outputText value=\"" + TreeTagTest.typeLibrary +
"\"/>\n" +
+ " </rich:treeNode>\n" +
+ " <rich:treeNode type=\"" + TreeTagTest.typePathway +
"\">\n" +
+ " <h:outputText value=\"" + TreeTagTest.typePathway +
"\"/>\n" +
+ " </rich:treeNode>\n" +
+ " <rich:treeNode type=\"" + TreeTagTest.typeOrganism +
"\">\n" +
+ " <h:outputText value=\"" + TreeTagTest.typeOrganism +
"\"/>\n" +
+ " </rich:treeNode>\n" +
+ " </rich:tree>\n" +
+ " </f:view>\n" +
+ " </body>\n" +
+ "</html>");
+ }
+
+ @Override
+ protected void verifyTag() {
+ assertVisualEditorContainsNodeWithValue(xhtmlWebBrowser,
+ TreeTagTest.typePathway,
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(xhtmlWebBrowser,
+ TreeTagTest.typeLibrary,
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(xhtmlWebBrowser,
+ TreeTagTest.typeOrganism,
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "IMG",
+ new String[]{"class"},
+ new String[]{"treePictureStyle"},
+ 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:tree>";
+ assertTrue("Selected text in Source Pane has to start with '" +
hasToStartWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().startsWith(hasToStartWith));
+ String hasEndWith = "</rich:tree>";
+ 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/TreeTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain