Author: vpakan(a)redhat.com
Date: 2012-03-16 14:44:47 -0400 (Fri, 16 Mar 2012)
New Revision: 39587
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ArticleTagTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AsideTagTest.java
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/VPEAutoTestCase.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AbstractTagTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/TestPageType.java
Log:
Added tests for HTML5 tags <ASIDE> and <ARTICLE>.
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 2012-03-16
18:41:37 UTC (rev 39586)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2012-03-16
18:44:47 UTC (rev 39587)
@@ -44,6 +44,8 @@
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ActionParamTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.AjaxInvisibleTagsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.AjaxValidatorTagTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.ArticleTagTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.AsideTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.BeanValidatorTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.CalendarTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ColumnGroupTagTest;
@@ -104,7 +106,7 @@
@RunWith(RequirementAwareSuite.class)
@SuiteClasses ({
- VisualEditorContextMenuTest.class,
+ VisualEditorContextMenuTest.class,
EditingActionsTest.class,
NewXHTMLPageWizardTest.class,
CodeCompletionTest.class,
@@ -190,7 +192,9 @@
MarkersTest.class,
JBIDE9445Test_DuplicateSourceMenu.class,
TestNPEinHugeFile.class,
- Jbide10020_TestHotKeyForVpeRefresh.class
+ Jbide10020_TestHotKeyForVpeRefresh.class,
+ ArticleTagTest.class,
+ AsideTagTest.class
})
public class VPEAllBotTests extends SWTBotTestCase{
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2012-03-16
18:41:37 UTC (rev 39586)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2012-03-16
18:44:47 UTC (rev 39587)
@@ -695,5 +695,37 @@
}
}
+ /**
+ * Creates new empty HTML page within test project
+ *
+ * @param pageName
+ * @param subDirs
+ * - complete path to page location within workspace
+ */
+ protected void createHtmlPage(String pageName, String... subDirs) {
+ SWTBotTreeItem tiPageParent = null;
+ if (subDirs == null || subDirs.length == 0) {
+ tiPageParent = packageExplorer.selectTreeItem("pages",
+ new String[] { VPEAutoTestCase.JBT_TEST_PROJECT_NAME,
+ "WebContent" });
+ } else {
+ String[] subPath = Arrays.copyOfRange(subDirs, 0,
+ subDirs.length - 1);
+ tiPageParent = packageExplorer.selectTreeItem(
+ subDirs[subDirs.length - 1], subPath);
+ }
+ tiPageParent.expand();
+ try {
+ tiPageParent.getNode(pageName).doubleClick();
+ } catch (WidgetNotFoundException e) {
+ open.newObject(ActionItem.NewObject.WebHTMLPage.LABEL);
+ bot.shell(IDELabel.Shell.NEW_HTML_FILE).activate();
+ bot.textWithLabel(ActionItem.NewObject.WebHTMLPage.TEXT_FILE_NAME)
+ .setText(pageName);
+ bot.button(IDELabel.Button.NEXT).click();
+ bot.button(IDELabel.Button.FINISH).click();
+ }
+ bot.sleep(Timing.time2S());
+ }
}
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AbstractTagTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AbstractTagTest.java 2012-03-16
18:41:37 UTC (rev 39586)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AbstractTagTest.java 2012-03-16
18:44:47 UTC (rev 39587)
@@ -25,6 +25,7 @@
*/
public abstract class AbstractTagTest extends VPEEditorTestCase {
+ private static final String TEST_PAGE_NAME_HTML = "TagTest.html";
private static final String TEST_PAGE_NAME_JSP = "TagTest.jsp";
private static final String TEST_PAGE_NAME_XHTML = "TagTest.xhtml";
@@ -51,7 +52,11 @@
*/
protected void initTestPage(TestPageType testPageType , String pageText){
this.testPageType = testPageType;
- if (testPageType.equals(TestPageType.JSP)){
+ if (testPageType.equals(TestPageType.HTML)){
+ createHtmlPage(AbstractTagTest.TEST_PAGE_NAME_HTML);
+ sourceEditor = botExt.swtBotEditorExtByTitle(AbstractTagTest.TEST_PAGE_NAME_HTML);
+ visualEditor = new SWTBotWebBrowser(AbstractTagTest.TEST_PAGE_NAME_HTML,botExt);
+ }else if (testPageType.equals(TestPageType.JSP)){
createJspPage(AbstractTagTest.TEST_PAGE_NAME_JSP);
sourceEditor = botExt.swtBotEditorExtByTitle(AbstractTagTest.TEST_PAGE_NAME_JSP);
visualEditor = new SWTBotWebBrowser(AbstractTagTest.TEST_PAGE_NAME_JSP,botExt);
@@ -127,7 +132,9 @@
protected String getTestPageFileName() {
String fileName = null;
- if (testPageType.equals(TestPageType.JSP)){
+ if (testPageType.equals(TestPageType.HTML)){
+ fileName = AbstractTagTest.TEST_PAGE_NAME_HTML;
+ }else if (testPageType.equals(TestPageType.JSP)){
fileName = AbstractTagTest.TEST_PAGE_NAME_JSP;
} else if (testPageType.equals(TestPageType.XHTML)){
fileName = AbstractTagTest.TEST_PAGE_NAME_XHTML;
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ArticleTagTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ArticleTagTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ArticleTagTest.java 2012-03-16
18:44:47 UTC (rev 39587)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+
+ * 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;
+
+/**
+ * Tests Rich Faces Calendar Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class ArticleTagTest extends AbstractTagTest{
+ private static String ARTICLE_TEXT = "!@#$ ARTICLE TEXT $#@!";
+ @Override
+ protected void initTestPage() {
+ initTestPage(TestPageType.HTML,
+ "<!DOCTYPE html>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " <meta http-equiv=\"Content-Type\"
content=\"text/html; charset=UTF-8\">\n" +
+ " <title>Insert title here</title>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <article>\n" +
+ " " + ArticleTagTest.ARTICLE_TEXT + "\n" +
+ " </article>\n" +
+ " </body>\n" +
+ "</html>\n");
+ }
+
+ @Override
+ protected void verifyTag() {
+ // check Problems View for Errors
+ assertProbelmsViewNoErrors(botExt);
+ // visual representation contains ARTICLE tag
+ assertVisualEditorContains(getVisualEditor(), "ARTICLE", null, null,
getTestPageFileName());
+ // visual representation contains ARTICLE_TEXT text
+ assertVisualEditorContainsNodeWithValue(getVisualEditor(),
+ ArticleTagTest.ARTICLE_TEXT, getTestPageFileName());
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ArticleTagTest.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/AsideTagTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AsideTagTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AsideTagTest.java 2012-03-16
18:44:47 UTC (rev 39587)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+
+ * 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;
+
+/**
+ * Tests Rich Faces Calendar Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class AsideTagTest extends AbstractTagTest{
+ private static String ASIDE_TEXT = "!@#$ ASIDE TEXT $#@!";
+ @Override
+ protected void initTestPage() {
+ initTestPage(TestPageType.HTML,
+ "<!DOCTYPE html>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " <meta http-equiv=\"Content-Type\"
content=\"text/html; charset=UTF-8\">\n" +
+ " <title>Insert title here</title>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <aside>\n" +
+ " " + AsideTagTest.ASIDE_TEXT + "\n" +
+ " </aside>\n" +
+ " </body>\n" +
+ "</html>\n");
+ }
+
+ @Override
+ protected void verifyTag() {
+ // check Problems View for Errors
+ assertProbelmsViewNoErrors(botExt);
+ // visual representation contains ARTICLE tag
+ assertVisualEditorContains(getVisualEditor(), "ASIDE", null, null,
getTestPageFileName());
+ // visual representation contains ARTICLE_TEXT text
+ assertVisualEditorContainsNodeWithValue(getVisualEditor(),
+ AsideTagTest.ASIDE_TEXT, getTestPageFileName());
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AsideTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/TestPageType.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/TestPageType.java 2012-03-16
18:41:37 UTC (rev 39586)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/TestPageType.java 2012-03-16
18:44:47 UTC (rev 39587)
@@ -11,6 +11,7 @@
package org.jboss.tools.vpe.ui.bot.test.editor.tags;
public enum TestPageType {
+ HTML,
XHTML,
JSP;
}