Adding a test case for creation of a classification
authorn.hoffmann <n.hoffmann@localhost>
Fri, 1 Apr 2011 15:24:43 +0000 (15:24 +0000)
committern.hoffmann <n.hoffmann@localhost>
Fri, 1 Apr 2011 15:24:43 +0000 (15:24 +0000)
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/ClassificationTest.java

index 3d826618e31e9382aed371957987d174ac86078e..d73aa5bcc5a54f068f031f866e175f3da5ae426a 100644 (file)
@@ -6,6 +6,7 @@ package eu.etaxonomy.taxeditor.test;
 import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
 import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;\r
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;\r
+import org.junit.Before;\r
 import org.junit.Test;\r
 \r
 /**\r
@@ -14,16 +15,30 @@ import org.junit.Test;
  */\r
 public class ClassificationTest extends AbstractEditorTest {\r
 \r
+       private SWTBotView navigatorView;\r
+       private SWTBotTree tree;\r
+\r
+       @Before\r
+       public void setup() {\r
+               super.setup();\r
+               navigatorView = view("Taxon Navigator");\r
+               tree = tree(navigatorView.getWidget());\r
+       }\r
+       \r
        @Test\r
        public void canDeleteClassification() throws Exception {\r
-               SWTBotView navigatorView = view("Taxon Navigator");\r
-               SWTBotTree tree = tree(navigatorView.getWidget());\r
                tree.select(0);\r
-               \r
-               \r
-//             SWTBotTreeItem treeItem = tree.getTreeItem("TestFolder 01").select();\r
                ContextMenuHelper.clickContextMenu(tree, "Delete");\r
                bot.waitUntil(Conditions.shellIsActive("Confirm Deletion"));\r
                bot.button("OK").click();\r
        }\r
+       \r
+       @Test\r
+       public void canCreateClassification() throws Exception {\r
+               tree.setFocus();\r
+               ContextMenuHelper.clickContextMenu(tree, "New", "Classification");\r
+               bot.waitUntil(Conditions.shellIsActive("New Entity"));\r
+               bot.textWithLabel("Label").setText("Classification");\r
+               bot.button("Finish").click();\r
+       }\r
 }\r