Author: vpakan(a)redhat.com
Date: 2010-11-10 09:39:29 -0500 (Wed, 10 Nov 2010)
New Revision: 26413
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/IncludedTagLibsTest.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
Added Included Tag Libs Test
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-11-10
14:09:59 UTC (rev 26412)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-11-10
14:39:29 UTC (rev 26413)
@@ -101,6 +101,7 @@
public static final String REMOVE = "Remove";
public static final String EDIT = "Edit...";
public static final String ADD_WITHOUT_DOTS = "Add";
+ public static final String EDIT_WITHOUT_DOTS = "Edit";
public static final String DROOLS_WORKBENCH = "Drools workbench";
public static final String REFRESH = "Refresh";
}
@@ -599,7 +600,9 @@
public static class PageDesignOptionsDialog{
- public static final String INCLUDED_TAG_LIBS_TAB = "Included tag tibs";
+ public static final String INCLUDED_TAG_LIBS_TAB = "Included tag libs";
+ public static final String INCLUDED_TAG_LIBS_URI = "URI*";
+ public static final String INCLUDED_TAG_LIBS_PREFIX = "Prefix";
}
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 2010-11-10
14:09:59 UTC (rev 26412)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-11-10
14:39:29 UTC (rev 26413)
@@ -14,6 +14,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.VisualEditorContextMenuTest;
import org.jboss.tools.vpe.ui.bot.test.editor.XhtmlFilePerformanceTest;
import
org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.AddSubstitutedELExpressionFolderScopeTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.IncludedTagLibsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.ToolbarTextFormattingTest;
import
org.jboss.tools.vpe.ui.bot.test.editor.preferences.AlwaysHideSelectionBarWithoutPromptTest;
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.BorderForUnknownTagsTest;
@@ -74,6 +75,7 @@
suite.addTestSuite(EditingActionsTest.class);
suite.addTestSuite(TextEditingActionsTest.class);
suite.addTestSuite(PromptForTagAttributesDuringTagInsertTest.class);
+ suite.addTestSuite(IncludedTagLibsTest.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/pagedesign/IncludedTagLibsTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/IncludedTagLibsTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/IncludedTagLibsTest.java 2010-11-10
14:39:29 UTC (rev 26413)
@@ -0,0 +1,109 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2010 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.pagedesign;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+
+/**
+ * Tests functionality of Included Tag Libs tab page of Page Design Options Dialog
+ * @author vlado pakan
+ *
+ */
+public class IncludedTagLibsTest extends PageDesignTestCase {
+
+ private SWTBot addTaglibReferenceDialogBot = null;
+ private SWTBot optionsDialogBot = null;
+ private SWTBot editTaglibReferenceDialogBot = null;
+
+ public void testIncludedTagLibs(){
+ openPage();
+ bot.toolbarButtonWithTooltip(PAGE_DESIGN).click();
+ optionsDialogBot = bot.shell(IDELabel.Shell.PAGE_DESIGN_OPTIONS).activate().bot();
+
optionsDialogBot.tabItem(IDELabel.PageDesignOptionsDialog.INCLUDED_TAG_LIBS_TAB).activate();
+ optionsDialogBot.button(IDELabel.Button.ADD_WITHOUT_DOTS).click();
+ addTaglibReferenceDialogBot =
optionsDialogBot.shell(IDELabel.Shell.ADD_TAGLIB_REFRENCE).activate().bot();
+ SWTBotText txMessage = addTaglibReferenceDialogBot.text(2);
+ SWTBotText txURI =
addTaglibReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.INCLUDED_TAG_LIBS_URI);
+ SWTBotText txPrefix =
addTaglibReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.INCLUDED_TAG_LIBS_PREFIX);
+ // Tests default message
+ final String defaultMessage = txMessage.getText();
+ final String defaultMessageStartsWith = "Add TLD definition";
+ assertTrue("Default Dialog Message has to start with '" +
defaultMessageStartsWith + "' but is: " + defaultMessage,
+ defaultMessage.startsWith(defaultMessageStartsWith));
+ // Tests empty prefix message
+ final String testURI = "http://java.sun.com/jsf/core";
+ txURI.setText(testURI);
+ final String emptyPrefixMessage = " Prefix should be set.";
+ assertTrue("Dialog Message has to be '" + emptyPrefixMessage +
"' but is: " + txMessage.getText(),
+ txMessage.getText().equals(emptyPrefixMessage));
+ // Tests when URI and Prefix is properly set
+ final String testPrefix = "pf";
+ txPrefix.setText(testPrefix);
+ assertTrue("Dialog Message has to be '" + defaultMessage + "'
but is: " + txMessage.getText(),
+ txMessage.getText().equals(defaultMessage));
+ // Tests incorrect prefix
+ final String incorrectPrefix = testPrefix + ";";
+ txPrefix.setText(incorrectPrefix);
+ final String incorrectPrefixMessage = " Incorrect Prefix: " +
incorrectPrefix;
+ assertTrue("Dialog Message has to be '" + incorrectPrefixMessage +
"' but is: " + txMessage.getText(),
+ txMessage.getText().equals(incorrectPrefixMessage));
+ // Sets proper values and close dialog
+ txPrefix.setText(testPrefix);
+ txURI.setText(testURI);
+ assertTrue("Dialog Message has to be '" + defaultMessage + "'
but is: " + txMessage.getText(),
+ txMessage.getText().equals(defaultMessage));
+ addTaglibReferenceDialogBot.button(IDELabel.Button.FINISH).click();
+ addTaglibReferenceDialogBot = null;
+ // Reopens dialog and tests saved values
+ optionsDialogBot.button(IDELabel.Button.EDIT_WITHOUT_DOTS).click();
+ editTaglibReferenceDialogBot =
optionsDialogBot.shell(IDELabel.Shell.ADD_TAGLIB_REFRENCE).activate().bot();
+ txMessage = editTaglibReferenceDialogBot.text(2);
+ txURI =
editTaglibReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.INCLUDED_TAG_LIBS_URI);
+ txPrefix =
editTaglibReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.INCLUDED_TAG_LIBS_PREFIX);
+ assertTrue("Dialog Message has to be '" + defaultMessage + "'
but is: " + txMessage.getText(),
+ txMessage.getText().equals(defaultMessage));
+ assertTrue("URI value has to be'" + testURI + "' but is:
" + txURI.getText(),
+ txURI.getText().equals(testURI));
+ assertTrue("Prefix value has to be'" + testPrefix + "' but is:
" + txPrefix.getText(),
+ txPrefix.getText().equals(testPrefix));
+ editTaglibReferenceDialogBot.button(IDELabel.Button.CANCEL).click();
+ editTaglibReferenceDialogBot = null;
+ optionsDialogBot.button(IDELabel.Button.OK).click();
+ optionsDialogBot = null;
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+ if (addTaglibReferenceDialogBot != null){
+ addTaglibReferenceDialogBot.button(IDELabel.Button.CANCEL).click();
+ addTaglibReferenceDialogBot = null;
+ }
+ if (editTaglibReferenceDialogBot != null){
+ editTaglibReferenceDialogBot.button(IDELabel.Button.CANCEL).click();
+ editTaglibReferenceDialogBot = null;
+ }
+ if (optionsDialogBot != null){
+ optionsDialogBot.button(IDELabel.Button.OK).click();
+ optionsDialogBot = null;
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return optionsDialogBot != null
+ || addTaglibReferenceDialogBot != null
+ || editTaglibReferenceDialogBot != null;
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/IncludedTagLibsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain