Adding a test case for creation of a classification
[taxeditor.git] / eu.etaxonomy.taxeditor.test / src / test / java / eu / etaxonomy / taxeditor / test / ClassificationTest.java
1 /**
2 *
3 */
4 package eu.etaxonomy.taxeditor.test;
5
6 import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
7 import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
8 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
9 import org.junit.Before;
10 import org.junit.Test;
11
12 /**
13 * @author n.hoffmann
14 *
15 */
16 public class ClassificationTest extends AbstractEditorTest {
17
18 private SWTBotView navigatorView;
19 private SWTBotTree tree;
20
21 @Before
22 public void setup() {
23 super.setup();
24 navigatorView = view("Taxon Navigator");
25 tree = tree(navigatorView.getWidget());
26 }
27
28 @Test
29 public void canDeleteClassification() throws Exception {
30 tree.select(0);
31 ContextMenuHelper.clickContextMenu(tree, "Delete");
32 bot.waitUntil(Conditions.shellIsActive("Confirm Deletion"));
33 bot.button("OK").click();
34 }
35
36 @Test
37 public void canCreateClassification() throws Exception {
38 tree.setFocus();
39 ContextMenuHelper.clickContextMenu(tree, "New", "Classification");
40 bot.waitUntil(Conditions.shellIsActive("New Entity"));
41 bot.textWithLabel("Label").setText("Classification");
42 bot.button("Finish").click();
43 }
44 }