Author: dmaliarevich
Date: 2010-08-26 09:32:45 -0400 (Thu, 26 Aug 2010)
New Revision: 24471
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/wizard/ExportUnknownTagsWizardTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ImportUnknownTagsWizardTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/NewXHTMLPageWizardTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6687 , JUnits for the "New XHTML Page"
Wizard have been added.
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-08-26
13:01:14 UTC (rev 24470)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-08-26
13:32:45 UTC (rev 24471)
@@ -62,8 +62,8 @@
suite.addTestSuite(VPESourceCodeTemplatesPreferencePageTest.class);
suite.addTestSuite(ExternalizeStringsDialogTest.class);
suite.addTestSuite(JspFileEditingTest.class);
- suite.addTestSuite(XhtmlFilePerformanceTest.class);
- suite.addTestSuite(ManagePaletteGroupsTest.class);
+ suite.addTestSuite(XhtmlFilePerformanceTest.class);
+ suite.addTestSuite(ManagePaletteGroupsTest.class);
suite.addTestSuite(PaletteEditorTest.class);
suite.addTestSuite(ToolbarTextFormattingTest.class);
suite.addTestSuite(VisualEditorContextMenuTest.class);
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExportUnknownTagsWizardTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExportUnknownTagsWizardTest.java 2010-08-26
13:01:14 UTC (rev 24470)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExportUnknownTagsWizardTest.java 2010-08-26
13:32:45 UTC (rev 24471)
@@ -53,7 +53,7 @@
bot.menu("File").menu("Export...").click(); //$NON-NLS-1$
//$NON-NLS-2$
bot.shell("Export").activate(); //$NON-NLS-1$
SWTBotTree importTree = bot.tree();
- importTree.expandNode("Other").select("Unknown tags templates");
//$NON-NLS-1$ //$NON-NLS-2$
+ importTree.expandNode("Other").select("User specified tag
templates"); //$NON-NLS-1$ //$NON-NLS-2$
bot.button(WidgetVariables.NEXT_BUTTON).click();
/*
* Check table values
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ImportUnknownTagsWizardTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ImportUnknownTagsWizardTest.java 2010-08-26
13:01:14 UTC (rev 24470)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ImportUnknownTagsWizardTest.java 2010-08-26
13:32:45 UTC (rev 24471)
@@ -41,7 +41,7 @@
bot.menu("File").menu("Import...").click(); //$NON-NLS-1$
//$NON-NLS-2$
bot.shell("Import").activate(); //$NON-NLS-1$
SWTBotTree importTree = bot.tree();
- importTree.expandNode("Other").select("Unknown tags templates");
//$NON-NLS-1$ //$NON-NLS-2$
+ importTree.expandNode("Other").select("User specified tag
templates"); //$NON-NLS-1$ //$NON-NLS-2$
bot.button(WidgetVariables.NEXT_BUTTON).click();
/*
* Load stored tags
@@ -65,22 +65,22 @@
/*
* Check that templates have been added to the preference page
*/
- bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click();
//$NON-NLS-1$ //$NON-NLS-2$
- bot.shell(IDELabel.Shell.PREFERENCES).activate(); //$NON-NLS-1$
+ bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click();
+ bot.shell(IDELabel.Shell.PREFERENCES).activate();
importTree = bot.tree();
- importTree.expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS) //$NON-NLS-1$d
- .expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB) //$NON-NLS-1$
- .expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB_EDITORS) //$NON-NLS-1$
- .select(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB_EDITORS_VPE); //$NON-NLS-1$
- bot.tabItem(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB_EDITORS_VPE_VISUAL_TEMPLATES).activate();
//$NON-NLS-1$
+ importTree.expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS)
+ .expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB)
+ .expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB_EDITORS)
+ .select(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB_EDITORS_VPE);
+ bot.tabItem(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB_EDITORS_VPE_VISUAL_TEMPLATES).activate();
/*
* Check table values on the preferences page
*/
String taglib00 = bot.table().cell(0, 0);
String taglib10 = bot.table().cell(1, 0);
bot.button(WidgetVariables.OK_BUTTON).click();
- assertEquals("Wrong table value.", "taglibName:tagName",
taglib00); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong table value.", "lib:tag", taglib10);
//$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Wrong table value.", "lib:tag", taglib00);
//$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Wrong table value.", "taglibName:tagName",
taglib10); //$NON-NLS-1$ //$NON-NLS-2$
}
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/NewXHTMLPageWizardTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/NewXHTMLPageWizardTest.java 2010-08-26
13:01:14 UTC (rev 24470)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/NewXHTMLPageWizardTest.java 2010-08-26
13:32:45 UTC (rev 24471)
@@ -23,7 +23,7 @@
@Override
protected void closeUnuseDialogs() {
// TODO Auto-generated method stub
-
+
}
@Override
@@ -31,19 +31,68 @@
// TODO Auto-generated method stub
return false;
}
-
+
+ /**
+ * Test new xhtml page wizard basic functionality.
+ */
public void testNewXHTMLPageWizard() {
/*
* Open wizard page
*/
- open.newObject(ActionItem.NewObject.JBossToolsWebXHTMLFile.LABEL);
- bot.shell(IDELabel.Shell.NEW_XHTML_FILE).activate();
-
bot.textWithLabel(ActionItem.NewObject.JBossToolsWebXHTMLFile.TEXT_FILE_NAME).setText("test");
- bot.button(IDELabel.Button.NEXT).click();
- bot.checkBox(IDELabel.NewXHTMLFileDialog.USE_XHTML_TEMPLATE_CHECK_BOX).select();
- bot.table().select(IDELabel.NewXHTMLFileDialog.TEMPLATE_FACELET_FORM_XHTML_NAME);
- bot.button(IDELabel.Button.FINISH).click();
- assertEquals("Active Editor Title should be" ,"test.xhtml",
this.bot.activeEditor().getTitle()); //$NON-NLS-1$ //$NON-NLS-2$
+ open.newObject(ActionItem.NewObject.JBossToolsWebXHTMLFile.LABEL);
+ bot.shell(IDELabel.Shell.NEW_XHTML_FILE).activate();
+ bot.textWithLabel(ActionItem.NewObject.JBossToolsWebXHTMLFile.TEXT_FILE_NAME).setText("test");
//$NON-NLS-1$
+ bot.textWithLabel(
+ ActionItem.NewObject.JBossToolsWebXHTMLFile.TEXT_ENTER_OR_SELECT_THE_PARENT_FOLDER)
+ .setText(JBT_TEST_PROJECT_NAME + "/WebContent/pages"); //$NON-NLS-1$
+ bot.button(IDELabel.Button.NEXT).click();
+ /*
+ * Check that the checkbox is disabled by default
+ */
+ assertFalse(
+ "'" + IDELabel.NewXHTMLFileDialog.USE_XHTML_TEMPLATE_CHECK_BOX
//$NON-NLS-1$
+ + "' checkbox should be disabled by default", //$NON-NLS-1$
+ bot.checkBox(
+ IDELabel.NewXHTMLFileDialog.USE_XHTML_TEMPLATE_CHECK_BOX)
+ .isChecked());
+ bot.checkBox(IDELabel.NewXHTMLFileDialog.USE_XHTML_TEMPLATE_CHECK_BOX).select();
+ bot.table().select(IDELabel.NewXHTMLFileDialog.TEMPLATE_FACELET_FORM_XHTML_NAME);
+ bot.button(IDELabel.Button.FINISH).click();
+ assertEquals("Active Editor Title should be" ,"test.xhtml",
this.bot.activeEditor().getTitle()); //$NON-NLS-1$ //$NON-NLS-2$
}
+ /**
+ * Test blank result without any template text.
+ * Tests
https://jira.jboss.org/browse/JBIDE-6921
+ */
+ public void testBlankResultWithoutAnyTemplateText_JBIDE6921() {
+ open.newObject(ActionItem.NewObject.JBossToolsWebXHTMLFile.LABEL);
+ bot.shell(IDELabel.Shell.NEW_XHTML_FILE).activate();
+ bot.textWithLabel(ActionItem.NewObject.JBossToolsWebXHTMLFile.TEXT_FILE_NAME).setText("test2");
//$NON-NLS-1$
+ bot.textWithLabel(
+ ActionItem.NewObject.JBossToolsWebXHTMLFile.TEXT_ENTER_OR_SELECT_THE_PARENT_FOLDER)
+ .setText(JBT_TEST_PROJECT_NAME + "/WebContent/pages"); //$NON-NLS-1$
+ bot.button(IDELabel.Button.NEXT).click();
+ /*
+ * Check that the checkbox is stored between the dialog's launches
+ */
+ assertTrue(
+ "'" + IDELabel.NewXHTMLFileDialog.USE_XHTML_TEMPLATE_CHECK_BOX
//$NON-NLS-1$
+ + "' checkbox should be enabled (after previous dialog call)",
//$NON-NLS-1$
+ bot.checkBox(
+ IDELabel.NewXHTMLFileDialog.USE_XHTML_TEMPLATE_CHECK_BOX)
+ .isChecked());
+ /*
+ * Make some click on the checkbox and leave it disabled
+ */
+ bot.checkBox(IDELabel.NewXHTMLFileDialog.USE_XHTML_TEMPLATE_CHECK_BOX).select();
+ bot.checkBox(IDELabel.NewXHTMLFileDialog.USE_XHTML_TEMPLATE_CHECK_BOX).deselect();
+ bot.checkBox(IDELabel.NewXHTMLFileDialog.USE_XHTML_TEMPLATE_CHECK_BOX).select();
+ bot.checkBox(IDELabel.NewXHTMLFileDialog.USE_XHTML_TEMPLATE_CHECK_BOX).deselect();
+ bot.button(IDELabel.Button.FINISH).click();
+ assertEquals("Active Editor Title should be" ,"test2.xhtml",
this.bot.activeEditor().getTitle()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Created XHTML file should be blank" ,"",
this.bot.activeEditor().toTextEditor().getText()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ }
+
}